-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show the shorter version of the empty annotations/notes message when …
…the sidebar tutorial is displayed and the new note button is enabled. Fixes #610
- Loading branch information
Sheetal Umesh Kumar
authored and
Sheetal Umesh Kumar
committed
Dec 5, 2017
1 parent
0315976
commit 7a86766
Showing
7 changed files
with
159 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Returns true if the sidebar tutorial has to be shown to a user for a given session. | ||
*/ | ||
function shouldShowSidebarTutorial(sessionState) { | ||
if (sessionState.preferences.show_sidebar_tutorial) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
module.exports = { | ||
shouldShowSidebarTutorial: shouldShowSidebarTutorial, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
var sessionUtil = require('../session-util'); | ||
|
||
describe('sessionUtil.shouldShowSidebarTutorial', function () { | ||
it('shows sidebar tutorial if the settings object has the show_sidebar_tutorial key set', function () { | ||
var sessionState = { | ||
preferences: { | ||
show_sidebar_tutorial: true, | ||
}, | ||
}; | ||
|
||
assert.isTrue(sessionUtil.shouldShowSidebarTutorial(sessionState)); | ||
}); | ||
|
||
it('hides sidebar tutorial if the settings object does not have the show_sidebar_tutorial key set', function () { | ||
var sessionState = { | ||
preferences: { | ||
show_sidebar_tutorial: false, | ||
}, | ||
}; | ||
|
||
assert.isFalse(sessionUtil.shouldShowSidebarTutorial(sessionState)); | ||
}); | ||
}); |