Skip to content
Snippets Groups Projects
Commit 6598e6fe authored by Anthony's avatar Anthony
Browse files

Back to normal working with component

parent 49052dd6
Branches
Tags
1 merge request!17WIP thumbnail on accordion.
Pipeline #1399 failed
......@@ -5,12 +5,7 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMoreSharp';
import Typography from '@material-ui/core/Typography';
import AccordionDetails from '@material-ui/core/AccordionDetails';
import PropTypes from 'prop-types';
import {
Card, CardActionArea, CardActions, CardContent, CardMedia, Fab,
} from '@material-ui/core';
import Button from '@material-ui/core/Button';
import Tooltip from '@material-ui/core/Tooltip';
import { AnnotationManifestsItem } from './AnnotationManifestsItem';
import AnnotationManifestsItem from '../containers/AnnotationManifestsItem';
/**
* AnnotationManifestsAccordion
......@@ -78,6 +73,7 @@ export class AnnotationManifestsAccordion extends Component {
manifestId={manifest.id}
language={i18n.language}
key={manifest}
t={t}
/>
))}
</AccordionDetails>
......
......@@ -17,6 +17,12 @@ export class AnnotationManifestsItem extends Component {
constructor(props) {
super(props);
this.handleOpenManifestSideToSide = this.handleOpenManifestSideToSide.bind(this);
/* const {
fetchManifest, manifestId, ready, isFetching, error, provider,
} = props;
if (!ready && !error && !isFetching && provider !== 'file') fetchManifest(manifestId); */
}
/** */
......@@ -26,19 +32,10 @@ export class AnnotationManifestsItem extends Component {
addWindow({ manifestId });
}
/** */
componentDidMount() {
const {
fetchManifest, manifestId, ready, isFetching, error, provider,
} = this.props;
if (!ready && !error && !isFetching && provider !== 'file') fetchManifest(manifestId);
}
/** */
render() {
const {
classes, t, language, manifest,
classes, t, language, manifestId,
} = this.props;
return (
......@@ -47,17 +44,17 @@ export class AnnotationManifestsItem extends Component {
<CardActionArea>
<CardContent>
<Typography>
{ manifest.label ? manifest.label[language] : manifest.id }
{ manifestId }
</Typography>
</CardContent>
</CardActionArea>
<CardActions>
<Tooltip title={t('openManifestInOtherWindow', { manifest: manifest.id })}>
<Tooltip title={t('openManifestInOtherWindow', { manifestId })}>
<Button
size="small"
color="primary"
onClick={(e) => {
this.handleOpenManifestSideToSide(e, manifest.id);
this.handleOpenManifestSideToSide(e, manifestId);
}}
>
{t('open')}
......@@ -77,8 +74,22 @@ AnnotationManifestsItem.propsTypes = {
fetchManifest: PropTypes.func.isRequired,
manifests: PropTypes.arrayOf(PropTypes.string),
t: PropTypes.func.isRequired,
manifestLogo: PropTypes.string,
provider: PropTypes.string,
ready: PropTypes.bool,
isFetching: PropTypes.bool,
error: PropTypes.string,
thumbnail: PropTypes.string,
title: PropTypes.string,
};
AnnotationManifestsItem.defaultProps = {
classes: {},
error: null,
isFetching: false,
manifestLogo: null,
provider: null,
ready: false,
thumbnail: null,
title: null,
};
......@@ -7,8 +7,6 @@ import MenuItem from '@material-ui/core/MenuItem';
import ListItemText from '@material-ui/core/ListItemText';
import Typography from '@material-ui/core/Typography';
import SearchIcon from '@material-ui/icons/SearchSharp';
import InputBase from '@material-ui/core/InputBase';
import CircularProgress from '@material-ui/core/CircularProgress';
import TextField from '@material-ui/core/TextField';
import SanitizedHtml from '../containers/SanitizedHtml';
import { ScrollTo } from './ScrollTo';
......
......@@ -6,11 +6,9 @@ import { withPlugins } from '../extend/withPlugins';
import * as actions from '../state/actions';
import { AnnotationManifestsItem } from '../components/AnnotationManifestsItem';
import {
getCanvases,
getManifest, getManifestLogo,
getManifestoInstance, getManifestProvider, getManifestThumbnail, getManifestTitle,
getSequenceBehaviors,
getWindowManifests
getManifestProvider, getManifestThumbnail, getManifestTitle,
getWindowManifests,
} from '../state/selectors';
/** For connect */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment