Skip to content

Display survey for native notebooks on/after 1st August (#12961) #12975

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 1 commit into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions src/client/datascience/notebook/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ export class NotebookSurveyBanner {
if (!this.enabled || this.disabledInCurrentSession) {
return false;
}
const currentDate = new Date();
if (currentDate.getMonth() < 7 && currentDate.getFullYear() <= 2020) {
return false;
}

const data = this.persistentState.createGlobalPersistentState<NotebookSurveyUsageData>(storageKey, {});

const totalActionsInPreviousSessions =
Expand Down
1 change: 1 addition & 0 deletions src/test/datascience/notebook/survey.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ suite('Data Science - NativeNotebook Survey', () => {
shell = mock<IApplicationShell>();
browser = mock<IBrowserService>();
clock = fakeTimers.install();
clock.setSystemTime(new Date(2020, 7, 1)); // Survey will work only after 1st August.
});
async function loadAndActivateExtension() {
const surveyBanner = new NotebookSurveyBanner(instance(shell), instance(stateFactory), instance(browser));
Expand Down