Commit a432922f authored by Robert Knight's avatar Robert Knight

Remove page_numbers feature flag

This is now enabled for everyone.
parent 8e1232ee
...@@ -55,7 +55,6 @@ function AnnotationHeader({ ...@@ -55,7 +55,6 @@ function AnnotationHeader({
const defaultAuthority = store.defaultAuthority(); const defaultAuthority = store.defaultAuthority();
const displayNamesEnabled = store.isFeatureEnabled('client_display_names'); const displayNamesEnabled = store.isFeatureEnabled('client_display_names');
const userURL = store.getLink('user', { user: annotation.user }); const userURL = store.getLink('user', { user: annotation.user });
const pageNumbersEnabled = store.isFeatureEnabled('page_numbers');
const authorName = useMemo( const authorName = useMemo(
() => () =>
...@@ -107,10 +106,10 @@ function AnnotationHeader({ ...@@ -107,10 +106,10 @@ function AnnotationHeader({
// contexts where it is the same for all cards and is shown elsewhere in the // contexts where it is the same for all cards and is shown elsewhere in the
// UI (eg. the top bar). This is to reduce visual clutter. // UI (eg. the top bar). This is to reduce visual clutter.
let group; let group;
if (!pageNumbersEnabled || store.route() !== 'sidebar') { if (store.route() !== 'sidebar') {
group = store.getGroup(annotation.group); group = store.getGroup(annotation.group);
} }
const pageNumber = pageNumbersEnabled ? getPageLabel(annotation) : undefined; const pageNumber = getPageLabel(annotation);
return ( return (
<header> <header>
......
...@@ -36,7 +36,6 @@ describe('AnnotationHeader', () => { ...@@ -36,7 +36,6 @@ describe('AnnotationHeader', () => {
beforeEach(() => { beforeEach(() => {
activeFeatures = { activeFeatures = {
client_display_names: true, client_display_names: true,
page_numbers: false,
}; };
fakeAnnotationAuthorLink = sinon fakeAnnotationAuthorLink = sinon
...@@ -331,14 +330,23 @@ describe('AnnotationHeader', () => { ...@@ -331,14 +330,23 @@ describe('AnnotationHeader', () => {
}); });
}); });
describe('Annotation share info', () => { describe('Annotation group info', () => {
it('should render annotation share/group information if group is available', () => { [
const wrapper = createAnnotationHeader(); { route: 'sidebar', groupVisible: false },
{ route: 'notebook', groupVisible: true },
assert.isTrue(wrapper.find('AnnotationShareInfo').exists()); ].forEach(({ route, groupVisible }) => {
it('should render group if not in sidebar', () => {
fakeStore.route.returns(route);
const wrapper = createAnnotationHeader();
assert.equal(
wrapper.find('AnnotationShareInfo').exists(),
groupVisible,
);
});
}); });
it('should not render annotation share/group information if group is unavailable', () => { it('should not render group if unavailable', () => {
fakeStore.route.returns('notebook');
fakeStore.getGroup.returns(undefined); fakeStore.getGroup.returns(undefined);
const wrapper = createAnnotationHeader(); const wrapper = createAnnotationHeader();
...@@ -452,10 +460,8 @@ describe('AnnotationHeader', () => { ...@@ -452,10 +460,8 @@ describe('AnnotationHeader', () => {
}); });
}); });
context('when page_numbers feature is enabled', () => { describe('page numbers', () => {
beforeEach(() => { beforeEach(() => {
activeFeatures.page_numbers = true;
// Un-mock the `pageLabel` function. // Un-mock the `pageLabel` function.
$imports.$restore({ $imports.$restore({
'../../helpers/annotation-metadata': true, '../../helpers/annotation-metadata': true,
...@@ -480,22 +486,6 @@ describe('AnnotationHeader', () => { ...@@ -480,22 +486,6 @@ describe('AnnotationHeader', () => {
assert.isTrue(pageNumber.exists()); assert.isTrue(pageNumber.exists());
assert.equal(pageNumber.text(), 'p. 11'); assert.equal(pageNumber.text(), 'p. 11');
}); });
it('should hide group name in sidebar', () => {
fakeStore.route.returns('sidebar');
const wrapper = createAnnotationHeader({
annotation: fixtures.defaultAnnotation(),
});
assert.isFalse(wrapper.exists('AnnotationShareInfo'));
});
it('should still show group name outside the sidebar', () => {
fakeStore.route.returns('annotation');
const wrapper = createAnnotationHeader({
annotation: fixtures.defaultAnnotation(),
});
assert.isTrue(wrapper.exists('AnnotationShareInfo'));
});
}); });
it( it(
......
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