diff --git a/src/components/AnnotationManifestsAccordion.js b/src/components/AnnotationManifestsAccordion.js index 9ea6b71038d10f3820ac7cba6c1f65b585841ccc..d06c1d7f9142fafed1aa35a9ea7e823f5c4917ee 100644 --- a/src/components/AnnotationManifestsAccordion.js +++ b/src/components/AnnotationManifestsAccordion.js @@ -4,13 +4,12 @@ import AccordionSummary from '@material-ui/core/AccordionSummary'; import ExpandMoreIcon from '@material-ui/icons/ExpandMoreSharp'; import Typography from '@material-ui/core/Typography'; import AccordionDetails from '@material-ui/core/AccordionDetails'; -import PlaylistAddIcon from '@material-ui/icons/PlaylistAdd'; import PropTypes from 'prop-types'; import { Card, CardActionArea, CardActions, CardContent, CardMedia, Fab, } from '@material-ui/core'; import Button from '@material-ui/core/Button'; -import async from 'async'; +import Tooltip from '@material-ui/core/Tooltip'; /** * AnnotationManifestsAccordion @@ -45,7 +44,7 @@ export class AnnotationManifestsAccordion extends Component { /** Merge array even if some are null) */ const concat = (...arrays) => [].concat(...arrays.filter(Array.isArray)); - annotation.manifests = concat(searchManifestInContent(annotation.content),searchManifestInID(annotation.id)); + annotation.manifests = concat(searchManifestInContent(annotation.content), searchManifestInID(annotation.id)); if (annotation.manifests) { annotation.manifests = annotation.manifests.map(id => ({ id })); } else { @@ -54,19 +53,6 @@ export class AnnotationManifestsAccordion extends Component { this.state = { 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(); - } - /** */ componentDidMount() { const { annotation } = this.state; @@ -92,6 +78,19 @@ export class AnnotationManifestsAccordion extends Component { }); } + /** */ + 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(); + } + /** */ render() { const { @@ -114,7 +113,7 @@ export class AnnotationManifestsAccordion extends Component { expandIcon={<ExpandMoreIcon />} onClick={(e) => this.handleOpenAccordion(e)} > - <Typography className={classes.heading}>Manifests found:</Typography> + <Typography className={classes.heading}>{t('manifestsFound')}</Typography> </AccordionSummary> <AccordionDetails> <Typography> @@ -135,15 +134,17 @@ export class AnnotationManifestsAccordion extends Component { </CardContent> </CardActionArea> <CardActions> - <Button - size="small" - color="primary" - onClick={(e) => { - this.handleOpenManifestSideToSide(e, manifest.id); - }} - > - Open in new panel - </Button> + <Tooltip title={t('openManifestInOtherWindow', { manifest: manifest.id })}> + <Button + size="small" + color="primary" + onClick={(e) => { + this.handleOpenManifestSideToSide(e, manifest.id); + }} + > + {t('openInCompanionWindow')} + </Button> + </Tooltip> </CardActions> </Card> </Typography> diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index d9f88532e3897436fa5bb8044308b05028fe9ba4..b32cbf1220c27d5fd9e31f3c83ac6b3f42ecaa7d 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -81,6 +81,7 @@ "login": "Log in", "logout": "Log out", "manifestError": "The resource cannot be added:", + "manifestFound": "Manifests found:", "maximizeWindow": "Maximize window", "minimizeWindow": "Minimize window", "mirador": "Mirador", diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json index 7f14e3552b69edb90c5042c31bca1d4f234091f2..46020e6baa92049ef49a7af876797748487e640c 100644 --- a/src/locales/fr/translation.json +++ b/src/locales/fr/translation.json @@ -78,6 +78,7 @@ "login": "Se connecter", "logout": "Se déconnecter", "manifestError": "Cette ressource ne peut pas être ajoutée :", + "manifestFound": "Manifests trouvés:", "maximizeWindow": "Agrandir cette fenêtre", "minimizeWindow": "Réduire cette fenêtre", "mirador": "Mirador",