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(
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() {
if (!indicateOrphans) {
return false;
}
if (typeof self.annotation.$orphan === 'undefined') {
return self.annotation.$anchorTimeout;
}
......
......@@ -19,10 +19,6 @@ module.exports = {
annotationUI.selectTab(type);
};
this.orphansTabFlagEnabled = function () {
return features.flagEnabled('orphans_tab');
};
this.showAnnotationsUnavailableMessage = function () {
return this.selectedTab === this.TAB_ANNOTATIONS &&
this.totalAnnotations === 0 &&
......
......@@ -48,8 +48,7 @@ function SidebarContentController(
self.rootThread = thread();
self.selectedTab = state.selectedTab;
var separateOrphans = tabs.shouldSeparateOrphans(state);
var counts = tabs.counts(state.annotations, separateOrphans);
var counts = tabs.counts(state.annotations, true /* separate orphans */);
Object.assign(self, {
totalNotes: counts.notes,
......@@ -227,8 +226,7 @@ function SidebarContentController(
focusAnnotation(selectedAnnot);
scrollToAnnotation(selectedAnnot);
var separateOrphans = tabs.shouldSeparateOrphans(annotationUI.getState());
annotationUI.selectTab(tabs.tabForAnnotation(selectedAnnot, separateOrphans));
annotationUI.selectTab(tabs.tabForAnnotation(selectedAnnot, true /* separate orphans */));
});
// Re-fetch annotations when focused group, logged-in user or connected frames
......
......@@ -66,9 +66,8 @@ function RootThread($rootScope, annotationUI, drafts, searchFilter, viewFilter)
return false;
}
var separateOrphans = tabs.shouldSeparateOrphans(state);
return tabs.shouldShowInTab(thread.annotation, state.selectedTab,
separateOrphans);
true /* separate orphans */);
};
}
......
......@@ -5,18 +5,8 @@
var countIf = require('./util/array-util').countIf;
var metadata = require('./annotation-metadata');
var session = require('./reducers/session');
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.
*
......@@ -78,7 +68,6 @@ function counts(annotations, separateOrphans) {
module.exports = {
counts: counts,
shouldSeparateOrphans: shouldSeparateOrphans,
shouldShowInTab: shouldShowInTab,
tabForAnnotation: tabForAnnotation,
};
......@@ -22,7 +22,7 @@
</span>
</a>
<a class="selection-tabs__type selection-tabs__type--orphan"
ng-if="vm.orphansTabFlagEnabled() && vm.totalOrphans > 0"
ng-if="vm.totalOrphans > 0"
href="#"
ng-class="{'is-selected': vm.selectedTab === vm.TAB_ORPHANS}"
h-on-touch="vm.selectTab(vm.TAB_ORPHANS)">
......
......@@ -46,7 +46,7 @@ describe('rootThread', function () {
isSidebar: true,
selectedAnnotationMap: null,
session: {
features: {'orphans_tab': true},
features: {},
},
sortKey: 'Location',
sortKeysAvailable: ['Location'],
......
......@@ -6,26 +6,6 @@ var tabs = require('../tabs');
var unroll = require('../../shared/test/util').unroll;
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 () {
unroll('shows annotation in correct tab', function (testCase) {
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