Add preview features enabled flag to issue reporter info (#20808)

* Add preview features enabled flag to issue reporter info

* fix tests

* fix key
This commit is contained in:
Charles Gagnon
2022-10-11 15:46:32 -07:00
committed by GitHub
parent 22a2bce55e
commit 3005d5435f
13 changed files with 37 additions and 13 deletions

View File

@@ -142,6 +142,7 @@ export class IssueReporter extends Disposable {
this.handleExtensionData(configuration.data.enabledExtensions);
this.updateExperimentsInfo(configuration.data.experiments);
this.updateRestrictedMode(configuration.data.restrictedMode);
this.updatePreviewFeaturesEnabled(configuration.data.previewFeaturesEnabled); // {{SQL CARBON EDIT}} Add preview features flag
}
render(): void {
@@ -1165,6 +1166,11 @@ export class IssueReporter extends Disposable {
this.issueReporterModel.update({ restrictedMode });
}
// {{SQL CARBON EDIT}} Add preview features flag
private updatePreviewFeaturesEnabled(previewFeaturesEnabled: boolean) {
this.issueReporterModel.update({ previewFeaturesEnabled });
}
private updateExperimentsInfo(experimentInfo: string | undefined) {
this.issueReporterModel.update({ experimentInfo });
const target = document.querySelector<HTMLElement>('.block-experiments .block-info');

View File

@@ -33,6 +33,7 @@ export interface IssueReporterData {
filterResultCount?: number;
experimentInfo?: string;
restrictedMode?: boolean;
previewFeaturesEnabled?: boolean; // {{SQL CARBON EDIT}} Add preview features flag
}
export class IssueReporterModel {
@@ -70,6 +71,7 @@ ${this.getExtensionVersion()}
Azure Data Studio version: ${this._data.versionInfo && this._data.versionInfo.vscodeVersion}
OS version: ${this._data.versionInfo && this._data.versionInfo.os}
Restricted Mode: ${this._data.restrictedMode ? 'Yes' : 'No'}
Preview Features: ${this._data.previewFeaturesEnabled ? 'Enabled' : 'Disabled'}
${this.getRemoteOSes()}
${this.getInfos()}
<!-- generated by issue reporter -->`;

View File

@@ -34,6 +34,7 @@ undefined
Azure Data Studio version: undefined
OS version: undefined
Restricted Mode: No
Preview Features: Disabled
Extensions: none
<!-- generated by issue reporter -->`);
@@ -65,6 +66,7 @@ undefined
Azure Data Studio version: undefined
OS version: undefined
Restricted Mode: No
Preview Features: Disabled
<details>
<summary>System Info</summary>

View File

@@ -59,6 +59,7 @@ export interface IssueReporterData extends WindowData {
extensionId?: string;
experiments?: string;
restrictedMode: boolean;
previewFeaturesEnabled: boolean; // {{SQL CARBON EDIT}} Add preview features flag
githubAccessToken: string;
readonly issueTitle?: string;
readonly issueBody?: string;

View File

@@ -20,6 +20,8 @@ import { ITASExperimentService } from 'vs/workbench/services/experiment/common/e
import { IAuthenticationService } from 'vs/workbench/services/authentication/browser/authenticationService';
import { registerMainProcessRemoteService } from 'vs/platform/ipc/electron-sandbox/services';
import { IWorkspaceTrustManagementService } from 'vs/platform/workspace/common/workspaceTrust';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; // {{SQL CARBON EDIT}} Add preview features flag
import { CONFIG_WORKBENCH_ENABLEPREVIEWFEATURES } from 'sql/workbench/common/constants'; // {{SQL CARBON EDIT}} Add preview features flag
export class WorkbenchIssueService implements IWorkbenchIssueService {
declare readonly _serviceBrand: undefined;
@@ -33,7 +35,8 @@ export class WorkbenchIssueService implements IWorkbenchIssueService {
@IWorkspaceTrustManagementService private readonly workspaceTrustManagementService: IWorkspaceTrustManagementService,
@IProductService private readonly productService: IProductService,
@ITASExperimentService private readonly experimentService: ITASExperimentService,
@IAuthenticationService private readonly authenticationService: IAuthenticationService
@IAuthenticationService private readonly authenticationService: IAuthenticationService,
@IConfigurationService private readonly configurationService: IConfigurationService // {{SQL CARBON EDIT}} Add preview features flag
) { }
async openReporter(dataOverrides: Partial<IssueReporterData> = {}): Promise<void> {
@@ -89,6 +92,7 @@ export class WorkbenchIssueService implements IWorkbenchIssueService {
enabledExtensions: extensionData,
experiments: experiments?.join('\n'),
restrictedMode: !this.workspaceTrustManagementService.isWorkspaceTrusted(),
previewFeaturesEnabled: this.configurationService.getValue(CONFIG_WORKBENCH_ENABLEPREVIEWFEATURES), // {{SQL CARBON EDIT}} Add preview features flag
githubAccessToken,
}, dataOverrides);
return this.issueService.openReporter(issueReporterData);