@@ -29,6 +29,18 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
29
29
30
30
const configurationKey = 'workbench.accounts.experimental.showEntitlements' ;
31
31
32
+ type EntitlementEnablementClassification = {
33
+ enabled : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; isMeasurement : true ; comment : 'Flag indicating if the account entitlement is enabled' } ;
34
+ owner : 'bhavyaus' ;
35
+ comment : 'Reporting when the account entitlement is shown' ;
36
+ } ;
37
+
38
+ type EntitlementActionClassification = {
39
+ command : { classification : 'PublicNonPersonalData' ; purpose : 'FeatureInsight' ; comment : 'The command being executed by the entitlement action' } ;
40
+ owner : 'bhavyaus' ;
41
+ comment : 'Reporting the account entitlement action' ;
42
+ } ;
43
+
32
44
class AccountsEntitlement extends Disposable implements IWorkbenchContribution {
33
45
private isInitialized = false ;
34
46
private contextKey = new RawContextKey < boolean > ( configurationKey , true ) . bindTo ( this . contextService ) ;
@@ -136,15 +148,17 @@ class AccountsEntitlement extends Disposable implements IWorkbenchContribution {
136
148
return ;
137
149
}
138
150
139
- const accountsMenuBadgeDisposable = this . _register ( new MutableDisposable ( ) ) ;
140
-
141
151
this . contextKey . set ( true ) ;
142
- const badge = new NumberBadge ( 1 , ( ) => menuTitle ) ;
143
- accountsMenuBadgeDisposable . value = this . activityService . showAccountsActivity ( { badge, } ) ;
152
+ this . telemetryService . publicLog2 < { enabled : boolean } , EntitlementEnablementClassification > ( configurationKey , { enabled : true } ) ;
144
153
145
154
const orgs = parsedResult [ 'organization_login_list' ] as any [ ] ;
146
155
const menuTitle = orgs ? this . productService . gitHubEntitlement ! . command . title . replace ( '{{org}}' , orgs [ orgs . length - 1 ] ) : this . productService . gitHubEntitlement ! . command . titleWithoutPlaceHolder ;
147
156
157
+ const badge = new NumberBadge ( 1 , ( ) => menuTitle ) ;
158
+ const accountsMenuBadgeDisposable = this . _register ( new MutableDisposable ( ) ) ;
159
+ accountsMenuBadgeDisposable . value = this . activityService . showAccountsActivity ( { badge, } ) ;
160
+
161
+
148
162
registerAction2 ( class extends Action2 {
149
163
constructor ( ) {
150
164
super ( {
@@ -167,6 +181,7 @@ class AccountsEntitlement extends Disposable implements IWorkbenchContribution {
167
181
const contextKeyService = accessor . get ( IContextKeyService ) ;
168
182
const storageService = accessor . get ( IStorageService ) ;
169
183
const dialogService = accessor . get ( IDialogService ) ;
184
+ const telemetryService = accessor . get ( ITelemetryService ) ;
170
185
171
186
const confirmation = await dialogService . confirm ( {
172
187
type : 'question' ,
@@ -176,6 +191,13 @@ class AccountsEntitlement extends Disposable implements IWorkbenchContribution {
176
191
177
192
if ( confirmation . confirmed ) {
178
193
commandService . executeCommand ( productService . gitHubEntitlement ! . command . action , productService . gitHubEntitlement ! . extensionId ! ) ;
194
+ telemetryService . publicLog2 < { command : string } , EntitlementActionClassification > ( 'accountsEntitlements.action' , {
195
+ command : productService . gitHubEntitlement ! . command . action ,
196
+ } ) ;
197
+ } else {
198
+ telemetryService . publicLog2 < { command : string } , EntitlementActionClassification > ( 'accountsEntitlements.action' , {
199
+ command : productService . gitHubEntitlement ! . command . action + '-dismissed' ,
200
+ } ) ;
179
201
}
180
202
181
203
accountsMenuBadgeDisposable . clear ( ) ;
0 commit comments