Unverified Commit 7e5d0a4b authored by Robert Knight's avatar Robert Knight Committed by GitHub

Merge pull request #576 from hypothesis/hide-new-note-btn

Add config option to enable the new note button when the notes tab is selected.
parents ed148af4 2e8806e6
...@@ -23,6 +23,7 @@ function configFrom(window_) { ...@@ -23,6 +23,7 @@ function configFrom(window_) {
disableToolbarHighlightsBtn: settings.hostPageSetting('disableToolbarHighlightsBtn'), disableToolbarHighlightsBtn: settings.hostPageSetting('disableToolbarHighlightsBtn'),
disableToolbarNewNoteBtn: settings.hostPageSetting('disableToolbarNewNoteBtn'), disableToolbarNewNoteBtn: settings.hostPageSetting('disableToolbarNewNoteBtn'),
disableBucketBar: settings.hostPageSetting('disableBucketBar'), disableBucketBar: settings.hostPageSetting('disableBucketBar'),
enableExperimentalNewNoteButton: settings.hostPageSetting('enableExperimentalNewNoteButton'),
enableSidebarDropShadow: settings.hostPageSetting('enableSidebarDropShadow'), enableSidebarDropShadow: settings.hostPageSetting('enableSidebarDropShadow'),
theme: settings.hostPageSetting('theme'), theme: settings.hostPageSetting('theme'),
usernameUrl: settings.hostPageSetting('usernameUrl'), usernameUrl: settings.hostPageSetting('usernameUrl'),
......
...@@ -12,6 +12,8 @@ module.exports = { ...@@ -12,6 +12,8 @@ module.exports = {
this.isThemeClean = settings.theme === 'clean'; this.isThemeClean = settings.theme === 'clean';
this.enableExperimentalNewNoteButton = settings.enableExperimentalNewNoteButton;
this.selectTab = function (type) { this.selectTab = function (type) {
annotationUI.clearSelectedAnnotations(); annotationUI.clearSelectedAnnotations();
annotationUI.selectTab(type); annotationUI.selectTab(type);
......
...@@ -15,7 +15,9 @@ describe('selectionTabs', function () { ...@@ -15,7 +15,9 @@ describe('selectionTabs', function () {
var fakeFeatures = { var fakeFeatures = {
flagEnabled: sinon.stub().returns(true), flagEnabled: sinon.stub().returns(true),
}; };
var fakeSettings = {}; var fakeSettings = {
enableExperimentalNewNoteButton: true,
};
angular.mock.module('app', { angular.mock.module('app', {
annotationUI: fakeAnnotationUI, annotationUI: fakeAnnotationUI,
......
...@@ -31,6 +31,10 @@ function hostPageConfig(window) { ...@@ -31,6 +31,10 @@ function hostPageConfig(window) {
'services', 'services',
'branding', 'branding',
// New note button override.
// This should be removed once new note button is enabled for everybody.
'enableExperimentalNewNoteButton',
// OAuth feature flag override. // OAuth feature flag override.
// This should be removed once OAuth is enabled for first party accounts. // This should be removed once OAuth is enabled for first party accounts.
'oauthEnabled', 'oauthEnabled',
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</a> </a>
</div> </div>
<new-note-btn <new-note-btn
ng-if="vm.selectedTab === vm.TAB_NOTES"> ng-if="vm.selectedTab === vm.TAB_NOTES && vm.enableExperimentalNewNoteButton">
</new-note-btn> </new-note-btn>
<div ng-if="!vm.isLoading()" class="selection-tabs__empty-message"> <div ng-if="!vm.isLoading()" class="selection-tabs__empty-message">
<div ng-if="vm.showNotesUnavailableMessage()" class="annotation-unavailable-message"> <div ng-if="vm.showNotesUnavailableMessage()" class="annotation-unavailable-message">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment