Skip to content

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

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 2 commits into from
Jul 14, 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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

August is the 8th month.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

months are 0 based indices in dates. (did mention that earlier when this was brought up #12961 (comment))

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that means days too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, days are not, start from 1

});
async function loadAndActivateExtension() {
const surveyBanner = new NotebookSurveyBanner(instance(shell), instance(stateFactory), instance(browser));
Expand Down