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_) {
disableToolbarHighlightsBtn: settings.hostPageSetting('disableToolbarHighlightsBtn'),
disableToolbarNewNoteBtn: settings.hostPageSetting('disableToolbarNewNoteBtn'),
disableBucketBar: settings.hostPageSetting('disableBucketBar'),
enableExperimentalNewNoteButton: settings.hostPageSetting('enableExperimentalNewNoteButton'),
enableSidebarDropShadow: settings.hostPageSetting('enableSidebarDropShadow'),
theme: settings.hostPageSetting('theme'),
usernameUrl: settings.hostPageSetting('usernameUrl'),
......
......@@ -12,6 +12,8 @@ module.exports = {
this.isThemeClean = settings.theme === 'clean';
this.enableExperimentalNewNoteButton = settings.enableExperimentalNewNoteButton;
this.selectTab = function (type) {
annotationUI.clearSelectedAnnotations();
annotationUI.selectTab(type);
......
......@@ -15,7 +15,9 @@ describe('selectionTabs', function () {
var fakeFeatures = {
flagEnabled: sinon.stub().returns(true),
};
var fakeSettings = {};
var fakeSettings = {
enableExperimentalNewNoteButton: true,
};
angular.mock.module('app', {
annotationUI: fakeAnnotationUI,
......
......@@ -31,6 +31,10 @@ function hostPageConfig(window) {
'services',
'branding',
// New note button override.
// This should be removed once new note button is enabled for everybody.
'enableExperimentalNewNoteButton',
// OAuth feature flag override.
// This should be removed once OAuth is enabled for first party accounts.
'oauthEnabled',
......
......@@ -34,7 +34,7 @@
</a>
</div>
<new-note-btn
ng-if="vm.selectedTab === vm.TAB_NOTES">
ng-if="vm.selectedTab === vm.TAB_NOTES && vm.enableExperimentalNewNoteButton">
</new-note-btn>
<div ng-if="!vm.isLoading()" class="selection-tabs__empty-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