Commit 2d875fe1 authored by Robert Knight's avatar Robert Knight

Remove checks for `orphans_tab` feature flag

This has been enabled for all users for many months now.
parent 6cbad41e
...@@ -447,14 +447,7 @@ function AnnotationController( ...@@ -447,14 +447,7 @@ function AnnotationController(
return serviceUrl('search.tag', {tag: tag}); return serviceUrl('search.tag', {tag: tag});
}; };
// Note: We fetch the feature flag outside the `isOrphan` method to avoid a
// lookup on every $digest cycle
var indicateOrphans = features.flagEnabled('orphans_tab');
this.isOrphan = function() { this.isOrphan = function() {
if (!indicateOrphans) {
return false;
}
if (typeof self.annotation.$orphan === 'undefined') { if (typeof self.annotation.$orphan === 'undefined') {
return self.annotation.$anchorTimeout; return self.annotation.$anchorTimeout;
} }
......
...@@ -19,10 +19,6 @@ module.exports = { ...@@ -19,10 +19,6 @@ module.exports = {
annotationUI.selectTab(type); annotationUI.selectTab(type);
}; };
this.orphansTabFlagEnabled = function () {
return features.flagEnabled('orphans_tab');
};
this.showAnnotationsUnavailableMessage = function () { this.showAnnotationsUnavailableMessage = function () {
return this.selectedTab === this.TAB_ANNOTATIONS && return this.selectedTab === this.TAB_ANNOTATIONS &&
this.totalAnnotations === 0 && this.totalAnnotations === 0 &&
......
...@@ -48,8 +48,7 @@ function SidebarContentController( ...@@ -48,8 +48,7 @@ function SidebarContentController(
self.rootThread = thread(); self.rootThread = thread();
self.selectedTab = state.selectedTab; self.selectedTab = state.selectedTab;
var separateOrphans = tabs.shouldSeparateOrphans(state); var counts = tabs.counts(state.annotations, true /* separate orphans */);
var counts = tabs.counts(state.annotations, separateOrphans);
Object.assign(self, { Object.assign(self, {
totalNotes: counts.notes, totalNotes: counts.notes,
...@@ -227,8 +226,7 @@ function SidebarContentController( ...@@ -227,8 +226,7 @@ function SidebarContentController(
focusAnnotation(selectedAnnot); focusAnnotation(selectedAnnot);
scrollToAnnotation(selectedAnnot); scrollToAnnotation(selectedAnnot);
var separateOrphans = tabs.shouldSeparateOrphans(annotationUI.getState()); annotationUI.selectTab(tabs.tabForAnnotation(selectedAnnot, true /* separate orphans */));
annotationUI.selectTab(tabs.tabForAnnotation(selectedAnnot, separateOrphans));
}); });
// Re-fetch annotations when focused group, logged-in user or connected frames // Re-fetch annotations when focused group, logged-in user or connected frames
......
...@@ -66,9 +66,8 @@ function RootThread($rootScope, annotationUI, drafts, searchFilter, viewFilter) ...@@ -66,9 +66,8 @@ function RootThread($rootScope, annotationUI, drafts, searchFilter, viewFilter)
return false; return false;
} }
var separateOrphans = tabs.shouldSeparateOrphans(state);
return tabs.shouldShowInTab(thread.annotation, state.selectedTab, return tabs.shouldShowInTab(thread.annotation, state.selectedTab,
separateOrphans); true /* separate orphans */);
}; };
} }
......
...@@ -5,18 +5,8 @@ ...@@ -5,18 +5,8 @@
var countIf = require('./util/array-util').countIf; var countIf = require('./util/array-util').countIf;
var metadata = require('./annotation-metadata'); var metadata = require('./annotation-metadata');
var session = require('./reducers/session');
var uiConstants = require('./ui-constants'); var uiConstants = require('./ui-constants');
/**
* Return true if Annotations and Orphans should be displayed in separate tabs.
*
* @param {object} state - The current application state.
*/
function shouldSeparateOrphans(state) {
return session.isFeatureEnabled(state, 'orphans_tab');
}
/** /**
* Return the tab in which an annotation should be displayed. * Return the tab in which an annotation should be displayed.
* *
...@@ -78,7 +68,6 @@ function counts(annotations, separateOrphans) { ...@@ -78,7 +68,6 @@ function counts(annotations, separateOrphans) {
module.exports = { module.exports = {
counts: counts, counts: counts,
shouldSeparateOrphans: shouldSeparateOrphans,
shouldShowInTab: shouldShowInTab, shouldShowInTab: shouldShowInTab,
tabForAnnotation: tabForAnnotation, tabForAnnotation: tabForAnnotation,
}; };
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</span> </span>
</a> </a>
<a class="selection-tabs__type selection-tabs__type--orphan" <a class="selection-tabs__type selection-tabs__type--orphan"
ng-if="vm.orphansTabFlagEnabled() && vm.totalOrphans > 0" ng-if="vm.totalOrphans > 0"
href="#" href="#"
ng-class="{'is-selected': vm.selectedTab === vm.TAB_ORPHANS}" ng-class="{'is-selected': vm.selectedTab === vm.TAB_ORPHANS}"
h-on-touch="vm.selectTab(vm.TAB_ORPHANS)"> h-on-touch="vm.selectTab(vm.TAB_ORPHANS)">
......
...@@ -46,7 +46,7 @@ describe('rootThread', function () { ...@@ -46,7 +46,7 @@ describe('rootThread', function () {
isSidebar: true, isSidebar: true,
selectedAnnotationMap: null, selectedAnnotationMap: null,
session: { session: {
features: {'orphans_tab': true}, features: {},
}, },
sortKey: 'Location', sortKey: 'Location',
sortKeysAvailable: ['Location'], sortKeysAvailable: ['Location'],
......
...@@ -6,26 +6,6 @@ var tabs = require('../tabs'); ...@@ -6,26 +6,6 @@ var tabs = require('../tabs');
var unroll = require('../../shared/test/util').unroll; var unroll = require('../../shared/test/util').unroll;
describe('tabs', function () { describe('tabs', function () {
describe('shouldSeparateOrphans', function () {
it('returns true if the "orphans_tab" flag is enabled', function () {
var state = {
session: {
features: {'orphans_tab': true},
},
};
assert.isTrue(tabs.shouldSeparateOrphans(state));
});
it('returns false if the "orphans_tab" flag is not enabled', function () {
var state = {
session: {
features: {'orphans_tab': false},
},
};
assert.isFalse(tabs.shouldSeparateOrphans(state));
});
});
describe('tabForAnnotation', function () { describe('tabForAnnotation', function () {
unroll('shows annotation in correct tab', function (testCase) { unroll('shows annotation in correct tab', function (testCase) {
var ann = testCase.ann; var ann = testCase.ann;
......
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