diff --git a/src/components/AnnotationManifestsAccordion.js b/src/components/AnnotationManifestsAccordion.js index 95cb2f11e3b6d0068c055259380a269b1b21f48f..749330b99e8777f0c74b35af0653534569c4f834 100644 --- a/src/components/AnnotationManifestsAccordion.js +++ b/src/components/AnnotationManifestsAccordion.js @@ -10,7 +10,6 @@ import { } from '@material-ui/core'; import Button from '@material-ui/core/Button'; import Tooltip from '@material-ui/core/Tooltip'; -import { removeDuplicates } from '../helper/utils'; /** * AnnotationManifestsAccordion @@ -45,12 +44,20 @@ export class AnnotationManifestsAccordion extends Component { this.state = { annotation }; } + /** */ - componentDidMount() { - const { annotation } = this.state; + handleOpenManifestSideToSide(e, manifestId) { + const { addResource, addWindow } = this.props; + addResource(manifestId); + addWindow({ manifestId }); + } + /** */ + // eslint-disable-next-line class-methods-use-this,require-jsdoc + handleOpenAccordion(e) { + const { annotation } = this.state; /** */ - async function loadManifest(manifests) { + async function load(manifests) { return Promise.all(manifests.map((manifest) => fetch(manifest.id) .then((response) => response.json()) .then((data) => { @@ -61,25 +68,13 @@ export class AnnotationManifestsAccordion extends Component { }))); } - loadManifest(annotation.manifests) + load(annotation.manifests) .then((values) => { if (values) { annotation.manifests = values; this.setState({ annotation }); } }); - } - - /** */ - handleOpenManifestSideToSide(e, manifestId) { - const { addResource, addWindow } = this.props; - addResource(manifestId); - addWindow({ manifestId }); - } - - /** */ - // eslint-disable-next-line class-methods-use-this,require-jsdoc - handleOpenAccordion(e) { e.stopPropagation(); } @@ -105,7 +100,6 @@ export class AnnotationManifestsAccordion extends Component { onClick={(e) => this.handleOpenAccordion(e)} > <Typography className={classes.heading}>{t('manifestFound')}</Typography> - </AccordionSummary> <AccordionDetails className={classes.manifestContainer}> {annotation.manifests.map(manifest => ( @@ -127,7 +121,7 @@ export class AnnotationManifestsAccordion extends Component { this.handleOpenManifestSideToSide(e, manifest.id); }} > - {t('openInCompanionWindow')} + {t('open')} </Button> </Tooltip> </CardActions> diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 43e937a3040bb7cf3ff7e8e42e179083e4217449..b0f88dbeb88dc2cb0ebf24298a69d74b64815ad6 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -81,7 +81,7 @@ "login": "Log in", "logout": "Log out", "manifestError": "The resource cannot be added:", - "manifestFound": "Manifests found:", + "manifestFound": "Details", "maximizeWindow": "Maximize window", "minimizeWindow": "Minimize window", "mirador": "Mirador", @@ -100,6 +100,7 @@ "numItems_one": "{{number}} item", "numItems_other": "{{number}} items", "off": "Off", + "open": "Open", "openCompanionWindow_annotations": "Annotations", "openCompanionWindow_attribution": "Rights", "openCompanionWindow_canvas": "Index", diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json index 7ff8bc8d4b56c0ed0d72a654a177236fe65bf27b..d835bed0d136fe344f1f62acbc95f94e28b50f46 100644 --- a/src/locales/fr/translation.json +++ b/src/locales/fr/translation.json @@ -78,7 +78,7 @@ "login": "Se connecter", "logout": "Se déconnecter", "manifestError": "Cette ressource ne peut pas être ajoutée :", - "manifestFound": "Manifestes trouvés:", + "manifestFound": "Détails", "maximizeWindow": "Agrandir cette fenêtre", "minimizeWindow": "Réduire cette fenêtre", "mirador": "Mirador", @@ -96,6 +96,7 @@ "numItems_one": "{{number}} image", "numItems_other": "{{number}} images", "off": "aucun", + "open": "Ouvrir", "openCompanionWindow_annotations": "Annotations", "openCompanionWindow_attribution": "Droits", "openCompanionWindow_canvas": "Index",