@@ -127,7 +127,14 @@ export class PasswordCard extends MozLitElement {
127
127
this . messageToViewModel ( "Command" , { commandId, snapshotId : lineIndex } ) ;
128
128
}
129
129
130
+ #recordInteractionType( type ) {
131
+ Glean . contextualManager . interactionType . record ( {
132
+ interaction_type : type ,
133
+ } ) ;
134
+ }
135
+
130
136
async onEditButtonClick ( ) {
137
+ this . #recordInteractionType( "edit" ) ;
131
138
const isAuthenticated = await this . reauthCommandHandler ( ( ) =>
132
139
this . messageToViewModel ( "Command" , {
133
140
commandId : "Edit" ,
@@ -144,10 +151,12 @@ export class PasswordCard extends MozLitElement {
144
151
145
152
onViewAlertClick ( ) {
146
153
this . handleViewAlertClick ( ) ;
154
+ this . #recordInteractionType( "view_alert" ) ;
147
155
}
148
156
149
157
#onOriginLineClick( lineIndex ) {
150
158
this . handleCommand ( "OpenLink" , lineIndex ) ;
159
+ this . #recordInteractionType( "url_navigate" ) ;
151
160
}
152
161
153
162
#onCopyButtonClick( lineIndex ) {
@@ -197,6 +206,7 @@ export class PasswordCard extends MozLitElement {
197
206
.value=${ this . username . value }
198
207
.onLineClick=${ ( ) => {
199
208
this . #onCopyButtonClick( this . username . lineIndex ) ;
209
+ this . #recordInteractionType( "copy_username" ) ;
200
210
return true ;
201
211
} }
202
212
?alert=${ ! this . username . value . length }
@@ -213,17 +223,24 @@ export class PasswordCard extends MozLitElement {
213
223
.value =${ this . password . value }
214
224
.visible =${ ! this . password . concealed }
215
225
?alert=${ this . password . vulnerable }
216
- .onLineClick=${ ( ) =>
217
- this . reauthCommandHandler ( ( ) =>
218
- this . #onCopyButtonClick( this . password . lineIndex )
219
- ) }
220
- .onButtonClick=${ ( ) =>
226
+ .onLineClick=${ ( ) => {
227
+ this . reauthCommandHandler ( ( ) => {
228
+ this . #onCopyButtonClick( this . password . lineIndex ) ;
229
+ } ) ;
230
+ this . #recordInteractionType( "copy_password" ) ;
231
+ } }
232
+ .onButtonClick=${ ( ) => {
233
+ const interactionType = this . password . concealed
234
+ ? "view_password"
235
+ : "hide_password" ;
236
+ this . #recordInteractionType( interactionType ) ;
221
237
this . reauthCommandHandler ( ( ) =>
222
238
this . onPasswordRevealClick (
223
239
this . password . concealed ,
224
240
this . password . lineIndex
225
241
)
226
- ) }
242
+ ) ;
243
+ } }
227
244
>
228
245
</ concealed-login-line >
229
246
` ;
0 commit comments