Skip to content

Disable surveys if running in codespaces #14332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 9, 2020
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
4 changes: 4 additions & 0 deletions src/client/activation/extensionSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { inject, injectable, optional } from 'inversify';
import * as querystring from 'querystring';
import { env, UIKind } from 'vscode';
import { IApplicationEnvironment, IApplicationShell } from '../common/application/types';
import { ShowExtensionSurveyPrompt } from '../common/experiments/groups';
import '../common/extensions';
Expand Down Expand Up @@ -53,6 +54,9 @@ 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) {
return false;
}
const doNotShowSurveyAgain = this.persistentState.createGlobalPersistentState(
extensionSurveyStateKeys.doNotShowAgain,
false
Expand Down
7 changes: 5 additions & 2 deletions src/client/datascience/dataScienceSurveyBanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict';

import { inject, injectable, named } from 'inversify';
import { Event, EventEmitter } from 'vscode';
import { env, Event, EventEmitter, UIKind } from 'vscode';
import { IApplicationShell } from '../common/application/types';
import '../common/extensions';
import {
Expand Down Expand Up @@ -100,7 +100,10 @@ export class DataScienceSurveyBanner implements IPythonExtensionBanner {
this.isInitialized = true;
}
public get enabled(): boolean {
return this.persistentState.createGlobalPersistentState<boolean>(DSSurveyStateKeys.ShowBanner, true).value;
return (
this.persistentState.createGlobalPersistentState<boolean>(DSSurveyStateKeys.ShowBanner, true).value &&
env.uiKind !== UIKind.Web
);
}

public async showBanner(): Promise<void> {
Expand Down
7 changes: 5 additions & 2 deletions src/client/datascience/notebook/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'use strict';

import { inject, injectable } from 'inversify';
import { env, UIKind } from 'vscode';
import { IExtensionSingleActivationService } from '../../activation/types';
import { IApplicationShell, IVSCodeNotebook } from '../../common/application/types';
import { traceError } from '../../common/logger';
Expand All @@ -27,8 +28,10 @@ export type NotebookSurveyUsageData = {
@injectable()
export class NotebookSurveyBanner {
public get enabled(): boolean {
return !this.persistentState.createGlobalPersistentState<NotebookSurveyUsageData>(storageKey, {}).value
.surveyDisabled;
return (
!this.persistentState.createGlobalPersistentState<NotebookSurveyUsageData>(storageKey, {}).value
.surveyDisabled && env.uiKind !== UIKind.Web
);
}
private disabledInCurrentSession: boolean = false;
constructor(
Expand Down