diff --git a/__tests__/src/lib/MiradorViewer.test.js b/__tests__/src/lib/MiradorViewer.test.js index 95e24df1a37ef6281bee1149ddec896302ff40fb..500ddff3b4979e7c7d272f05e994b132d220a7f2 100644 --- a/__tests__/src/lib/MiradorViewer.test.js +++ b/__tests__/src/lib/MiradorViewer.test.js @@ -30,32 +30,34 @@ describe('MiradorViewer', () => { }); describe('processConfig', () => { it('transforms config values to actions to dispatch to store', () => { - instance = new MiradorViewer({ - catalog: [ - { manifestId: 'http://media.nga.gov/public/manifests/nga_highlights.json', provider: 'National Gallery of Art' }, - ], - id: 'mirador', - windows: [ - { - canvasId: 'https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892', - loadedManifest: 'https://iiif.harvardartmuseums.org/manifests/object/299843', - thumbnailNavigationPosition: 'far-bottom', - }, - { - loadedManifest: 'https://iiif.harvardartmuseums.org/manifests/object/299843', - view: 'book', - }, - ], - }, - { - plugins: [{ - config: { - foo: 'bar', - }, - mode: 'add', - target: 'WindowTopBarPluginArea', - }], - }); + instance = new MiradorViewer( + { + catalog: [ + { manifestId: 'http://media.nga.gov/public/manifests/nga_highlights.json', provider: 'National Gallery of Art' }, + ], + id: 'mirador', + windows: [ + { + canvasId: 'https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892', + loadedManifest: 'https://iiif.harvardartmuseums.org/manifests/object/299843', + thumbnailNavigationPosition: 'far-bottom', + }, + { + loadedManifest: 'https://iiif.harvardartmuseums.org/manifests/object/299843', + view: 'book', + }, + ], + }, + { + plugins: [{ + config: { + foo: 'bar', + }, + mode: 'add', + target: 'WindowTopBarPluginArea', + }], + }, + ); const { windows, catalog, config } = instance.store.getState(); const windowIds = Object.keys(windows); @@ -74,35 +76,37 @@ describe('MiradorViewer', () => { expect(config.foo).toBe('bar'); }); it('merges translation configs from multiple plugins', () => { - instance = new MiradorViewer({ - id: 'mirador', - }, - { - plugins: [ - { - config: { - translations: { - en: { - foo: 'bar', + instance = new MiradorViewer( + { + id: 'mirador', + }, + { + plugins: [ + { + config: { + translations: { + en: { + foo: 'bar', + }, }, }, + mode: 'add', + target: 'WindowTopBarPluginArea', }, - mode: 'add', - target: 'WindowTopBarPluginArea', - }, - { - config: { - translations: { - en: { - bat: 'bar', + { + config: { + translations: { + en: { + bat: 'bar', + }, }, }, + mode: 'wrap', + target: 'Window', }, - mode: 'wrap', - target: 'Window', - }, - ], - }); + ], + }, + ); const { config } = instance.store.getState(); diff --git a/src/components/AnnotationsOverlay.js b/src/components/AnnotationsOverlay.js index 56215888e5e55166056bb0a7f1a1cde67b38dab9..7e923fe2fa125eee63747b38d3907e7613354f15 100644 --- a/src/components/AnnotationsOverlay.js +++ b/src/components/AnnotationsOverlay.js @@ -86,7 +86,10 @@ export class AnnotationsOverlay extends Component { this.initializeViewer(); const annotationsUpdated = !AnnotationsOverlay.annotationsMatch(annotations, prevProps.annotations); - const searchAnnotationsUpdated = !AnnotationsOverlay.annotationsMatch(searchAnnotations, prevProps.searchAnnotations); + const searchAnnotationsUpdated = !AnnotationsOverlay.annotationsMatch( + searchAnnotations, + prevProps.searchAnnotations, + ); const hoveredAnnotationsUpdated = ( xor(hoveredAnnotationIds, prevProps.hoveredAnnotationIds).length > 0 diff --git a/src/containers/SearchHit.js b/src/containers/SearchHit.js index c1da963977a805c33b72c8fb991702120ade2f32..60abacf26dfe4560dcbdd509abc4d37ea33a4a1c 100644 --- a/src/containers/SearchHit.js +++ b/src/containers/SearchHit.js @@ -23,7 +23,14 @@ const mapStateToProps = (state, { annotationId, hit = { annotations: [] }, companionWindowId, windowId, }) => { const realAnnoId = annotationId || hit.annotations[0]; - const hitAnnotation = getResourceAnnotationForSearchHit(state, { annotationUri: realAnnoId, companionWindowId, windowId }); + const hitAnnotation = getResourceAnnotationForSearchHit( + state, + { + annotationUri: realAnnoId, + companionWindowId, + windowId, + }, + ); const annotationLabel = getResourceAnnotationLabel(state, { annotationUri: realAnnoId, companionWindowId, windowId }); const selectedCanvasIds = getVisibleCanvasIds(state, { windowId }); diff --git a/src/state/sagas/iiif.js b/src/state/sagas/iiif.js index bf34810fd9f1aaf70102277594a5841467521040..e661170c5eca3d5fb1a2106fb4c43125afaaec31 100644 --- a/src/state/sagas/iiif.js +++ b/src/state/sagas/iiif.js @@ -63,7 +63,12 @@ function* fetchIiifResourceWithAuth(url, iiifResource, options, { degraded, fail } } - const { error, json, response } = yield call(fetchIiifResource, url, urlOptions, { failure: arg => arg, success: arg => arg }); + const { error, json, response } = yield call( + fetchIiifResource, + url, + urlOptions, + { failure: arg => arg, success: arg => arg }, + ); // Hard error either requesting the resource or deserializing the JSON. if (error) { diff --git a/src/state/sagas/windows.js b/src/state/sagas/windows.js index ca256b1bc25db1c75e9db72f85e3299a5be42a1d..bfcd275aaadc06cc862791933b86f5f078ed4e90 100644 --- a/src/state/sagas/windows.js +++ b/src/state/sagas/windows.js @@ -154,7 +154,14 @@ export function* setCurrentAnnotationsOnCurrentCanvas({ const companionWindowIds = Object.keys(searches || {}); if (companionWindowIds.length === 0) return; - const annotationBySearch = yield select(getAnnotationsBySearch, { canvasIds: visibleCanvases, companionWindowIds, windowId }); + const annotationBySearch = yield select( + getAnnotationsBySearch, + { + canvasIds: visibleCanvases, + companionWindowIds, + windowId, + }, + ); yield all( Object.keys(annotationBySearch) diff --git a/src/state/selectors/searches.js b/src/state/selectors/searches.js index 00656169c8bfb5ed4c110e1434aa02a034ee8b4f..ae63e2a090618dfbcfaf2a988405f403875e7cea 100644 --- a/src/state/selectors/searches.js +++ b/src/state/selectors/searches.js @@ -108,7 +108,9 @@ export const getSortedSearchHitsForCompanionWindow = createSelector( [ getSearchHitsForCompanionWindow, getCanvases, - (state, { companionWindowId, windowId }) => annotationUri => getResourceAnnotationForSearchHit(state, { annotationUri, companionWindowId, windowId }), + (state, { companionWindowId, windowId }) => ( + annotationUri => getResourceAnnotationForSearchHit(state, { annotationUri, companionWindowId, windowId }) + ), ], (searchHits, canvases, annotationForSearchHit) => { if (!canvases || canvases.length === 0) return [];