Skip to content
Snippets Groups Projects
Commit 9b80751b authored by Anthony's avatar Anthony
Browse files

Merge branch '19-optimisation-and-wording-for-coheso' into 'annotation-on-video'

Resolve "Optimisation and wording for coheso"

See merge request iiif/mirador-video-annotation!16
parents 92c0cb06 78edf348
No related branches found
No related tags found
1 merge request!16Resolve "Optimisation and wording for coheso"
Pipeline #1397 failed
...@@ -10,7 +10,6 @@ import { ...@@ -10,7 +10,6 @@ import {
} from '@material-ui/core'; } from '@material-ui/core';
import Button from '@material-ui/core/Button'; import Button from '@material-ui/core/Button';
import Tooltip from '@material-ui/core/Tooltip'; import Tooltip from '@material-ui/core/Tooltip';
import { removeDuplicates } from '../helper/utils';
/** /**
* AnnotationManifestsAccordion * AnnotationManifestsAccordion
...@@ -45,12 +44,20 @@ export class AnnotationManifestsAccordion extends Component { ...@@ -45,12 +44,20 @@ export class AnnotationManifestsAccordion extends Component {
this.state = { annotation }; this.state = { annotation };
} }
/** */ /** */
componentDidMount() { handleOpenManifestSideToSide(e, manifestId) {
const { annotation } = this.state; const { addResource, addWindow } = this.props;
addResource(manifestId);
addWindow({ manifestId });
}
/** */ /** */
async function loadManifest(manifests) { // eslint-disable-next-line class-methods-use-this,require-jsdoc
handleOpenAccordion(e) {
const { annotation } = this.state;
/** */
async function load(manifests) {
return Promise.all(manifests.map((manifest) => fetch(manifest.id) return Promise.all(manifests.map((manifest) => fetch(manifest.id)
.then((response) => response.json()) .then((response) => response.json())
.then((data) => { .then((data) => {
...@@ -61,25 +68,13 @@ export class AnnotationManifestsAccordion extends Component { ...@@ -61,25 +68,13 @@ export class AnnotationManifestsAccordion extends Component {
}))); })));
} }
loadManifest(annotation.manifests) load(annotation.manifests)
.then((values) => { .then((values) => {
if (values) { if (values) {
annotation.manifests = values; annotation.manifests = values;
this.setState({ annotation }); 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(); e.stopPropagation();
} }
...@@ -105,7 +100,6 @@ export class AnnotationManifestsAccordion extends Component { ...@@ -105,7 +100,6 @@ export class AnnotationManifestsAccordion extends Component {
onClick={(e) => this.handleOpenAccordion(e)} onClick={(e) => this.handleOpenAccordion(e)}
> >
<Typography className={classes.heading}>{t('manifestFound')}</Typography> <Typography className={classes.heading}>{t('manifestFound')}</Typography>
</AccordionSummary> </AccordionSummary>
<AccordionDetails className={classes.manifestContainer}> <AccordionDetails className={classes.manifestContainer}>
{annotation.manifests.map(manifest => ( {annotation.manifests.map(manifest => (
...@@ -127,7 +121,7 @@ export class AnnotationManifestsAccordion extends Component { ...@@ -127,7 +121,7 @@ export class AnnotationManifestsAccordion extends Component {
this.handleOpenManifestSideToSide(e, manifest.id); this.handleOpenManifestSideToSide(e, manifest.id);
}} }}
> >
{t('openInCompanionWindow')} {t('open')}
</Button> </Button>
</Tooltip> </Tooltip>
</CardActions> </CardActions>
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
"login": "Log in", "login": "Log in",
"logout": "Log out", "logout": "Log out",
"manifestError": "The resource cannot be added:", "manifestError": "The resource cannot be added:",
"manifestFound": "Manifests found:", "manifestFound": "Details",
"maximizeWindow": "Maximize window", "maximizeWindow": "Maximize window",
"minimizeWindow": "Minimize window", "minimizeWindow": "Minimize window",
"mirador": "Mirador", "mirador": "Mirador",
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
"numItems_one": "{{number}} item", "numItems_one": "{{number}} item",
"numItems_other": "{{number}} items", "numItems_other": "{{number}} items",
"off": "Off", "off": "Off",
"open": "Open",
"openCompanionWindow_annotations": "Annotations", "openCompanionWindow_annotations": "Annotations",
"openCompanionWindow_attribution": "Rights", "openCompanionWindow_attribution": "Rights",
"openCompanionWindow_canvas": "Index", "openCompanionWindow_canvas": "Index",
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
"login": "Se connecter", "login": "Se connecter",
"logout": "Se déconnecter", "logout": "Se déconnecter",
"manifestError": "Cette ressource ne peut pas être ajoutée :", "manifestError": "Cette ressource ne peut pas être ajoutée :",
"manifestFound": "Manifestes trouvés:", "manifestFound": "Détails",
"maximizeWindow": "Agrandir cette fenêtre", "maximizeWindow": "Agrandir cette fenêtre",
"minimizeWindow": "Réduire cette fenêtre", "minimizeWindow": "Réduire cette fenêtre",
"mirador": "Mirador", "mirador": "Mirador",
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
"numItems_one": "{{number}} image", "numItems_one": "{{number}} image",
"numItems_other": "{{number}} images", "numItems_other": "{{number}} images",
"off": "aucun", "off": "aucun",
"open": "Ouvrir",
"openCompanionWindow_annotations": "Annotations", "openCompanionWindow_annotations": "Annotations",
"openCompanionWindow_attribution": "Droits", "openCompanionWindow_attribution": "Droits",
"openCompanionWindow_canvas": "Index", "openCompanionWindow_canvas": "Index",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment