Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix all the tests where UIKind is not defined
  • Loading branch information
joyceerhl committed Oct 9, 2020
commit 75ef30fcaf4ddbc212f0c50f0cfd6aade5a4f02e
4 changes: 2 additions & 2 deletions src/client/activation/extensionSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class ExtensionSurveyPrompt implements IExtensionSingleActivationService
@inject(IPlatformService) private platformService: IPlatformService,
@optional() private sampleSizePerOneHundredUsers: number = 10,
@optional() private waitTimeToShowSurvey: number = WAIT_TIME_TO_SHOW_SURVEY
) {}
) { }

public async activate(): Promise<void> {
if (!this.experiments.inExperiment(ShowExtensionSurveyPrompt.enabled)) {
Expand All @@ -54,7 +54,7 @@ export class ExtensionSurveyPrompt implements IExtensionSingleActivationService

@traceDecorators.error('Failed to check whether to display prompt for extension survey')
public shouldShowBanner(): boolean {
if (env.uiKind === UIKind.Web) {
if (env.uiKind === UIKind?.Web) {
return false;
}
const doNotShowSurveyAgain = this.persistentState.createGlobalPersistentState(
Expand Down
4 changes: 2 additions & 2 deletions src/client/datascience/dataScienceSurveyBanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class DataScienceSurveyBannerLogger implements IInteractiveWindowListener
@inject(IPythonExtensionBanner)
@named(BANNER_NAME_DS_SURVEY)
private readonly dataScienceSurveyBanner: IPythonExtensionBanner
) {}
) { }
// tslint:disable-next-line: no-any
public get postMessage(): Event<{ message: string; payload: any }> {
return this.postEmitter.event;
Expand Down Expand Up @@ -102,7 +102,7 @@ export class DataScienceSurveyBanner implements IPythonExtensionBanner {
public get enabled(): boolean {
return (
this.persistentState.createGlobalPersistentState<boolean>(DSSurveyStateKeys.ShowBanner, true).value &&
env.uiKind !== UIKind.Web
env.uiKind !== UIKind?.Web
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/client/datascience/gather/gatherListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class GatherListener implements IInteractiveWindowListener {
@inject(IConfigurationService) private configService: IConfigurationService,
@inject(IDocumentManager) private documentManager: IDocumentManager,
@inject(IDataScienceFileSystem) private fs: IDataScienceFileSystem
) {}
) { }

public dispose() {
noop();
Expand Down Expand Up @@ -225,10 +225,10 @@ export class GatherListener implements IInteractiveWindowListener {
cell.file === Identifiers.EmptyFileName && this.notebookUri ? this.notebookUri.fsPath : cell.file;

const data =
env.uiKind === UIKind.Web
env.uiKind === UIKind?.Web
? createMarkdownCell(
localize.DataScience.gatheredNotebookDescriptionInMarkdownWithoutSurvey().format(file)
)
localize.DataScience.gatheredNotebookDescriptionInMarkdownWithoutSurvey().format(file)
)
: createMarkdownCell(localize.DataScience.gatheredNotebookDescriptionInMarkdown().format(file));

let cells: ICell[] = [
Expand Down
6 changes: 3 additions & 3 deletions src/client/datascience/notebook/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export class NotebookSurveyBanner {
public get enabled(): boolean {
return (
!this.persistentState.createGlobalPersistentState<NotebookSurveyUsageData>(storageKey, {}).value
.surveyDisabled && env.uiKind !== UIKind.Web
.surveyDisabled && env.uiKind !== UIKind?.Web
);
}
private disabledInCurrentSession: boolean = false;
constructor(
@inject(IApplicationShell) private appShell: IApplicationShell,
@inject(IPersistentStateFactory) private persistentState: IPersistentStateFactory,
@inject(IBrowserService) private browserService: IBrowserService
) {}
) { }

public async showBanner(): Promise<void> {
if (!this.enabled || this.disabledInCurrentSession) {
Expand Down Expand Up @@ -135,7 +135,7 @@ export class NotebookSurveyDataLogger implements IExtensionSingleActivationServi
@inject(IDisposableRegistry) private readonly disposables: IDisposableRegistry,
// tslint:disable-next-line: no-use-before-declare
@inject(NotebookSurveyBanner) private readonly survey: NotebookSurveyBanner
) {}
) { }
public async activate() {
if (!this.survey.enabled) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/client/debugger/extension/banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class DebuggerBanner implements IDebuggerBanner {
private disabledInCurrentSession?: boolean;
private userSelected?: boolean;

constructor(@inject(IServiceContainer) private serviceContainer: IServiceContainer) {}
constructor(@inject(IServiceContainer) private serviceContainer: IServiceContainer) { }

public initialize() {
if (this.initialized) {
Expand Down Expand Up @@ -63,7 +63,7 @@ export class DebuggerBanner implements IDebuggerBanner {
// showing banner

public async shouldShow(): Promise<boolean> {
if (!this.isEnabled() || this.disabledInCurrentSession || env.uiKind === UIKind.Web) {
if (!this.isEnabled() || this.disabledInCurrentSession || env.uiKind === UIKind?.Web) {
return false;
}
if (!(await this.passedThreshold())) {
Expand Down