Skip to content

Commit

Permalink
Display survey for native notebooks on/after 1st August (#12961) (#12975
Browse files Browse the repository at this point in the history
)

Co-authored-by: Joyce Er <joyceerhuiling@gmail.com>

Co-authored-by: Joyce Er <joyceerhuiling@gmail.com>
  • Loading branch information
Don Jayamanne and joyceerhl committed Jul 15, 2020
1 parent cc412b1 commit 40d5dcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client/datascience/notebook/survey.ts
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
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

0 comments on commit 40d5dcd

Please sign in to comment.