Skip to content
Snippets Groups Projects
Select Git revision
  • fc336e0eb7d1443ff8f3705b82bd3883cf855fad
  • mui5-tetras-main-stable default protected
  • mui5-tetras-main-old-stable
  • preprod protected
  • 75-dernieres-ameliorations-avant-workshop-du-7-02
  • wip-fix-xywh
  • wip-positionement-annot
  • wip-surface-transformer
  • uploads-file
  • 69-la-video-demare-quand-on-fait-glisser-le-slider-et-le-clic-creer-un-decalage-entre-le-player
  • 61-recettage-des-outils-d-annotation
  • gestion_multiple_ouverture_pannel_annotation
  • autorisation_un_pannel_annotation
  • autorisation_un_pannel_edition_annotation
  • récupération_temps_video
  • save-shapes-and-position
  • fix-error-create-annotation-pannel
  • time-saving-on-annotation
  • tetras-main protected
  • fix-poc-mirador
  • tetras-antho-test
21 results

AnnotationCreation.js

Blame
  • CollectionInfo.js 1.91 KiB
    import React, { Component } from 'react';
    import PropTypes from 'prop-types';
    import Button from '@material-ui/core/Button';
    import Typography from '@material-ui/core/Typography';
    import ViewListIcon from '@material-ui/icons/ViewListSharp';
    import CollapsibleSection from '../containers/CollapsibleSection';
    
    /**
     * ManifestInfo
     */
    export class CollectionInfo extends Component {
      /** */
      constructor(props) {
        super(props);
    
        this.openCollectionDialog = this.openCollectionDialog.bind(this);
      }
    
      /** */
      openCollectionDialog() {
        const { collectionPath, showCollectionDialog, windowId } = this.props;
    
        const manifestId = collectionPath[collectionPath.length - 1];
    
        showCollectionDialog(manifestId, collectionPath.slice(0, -1), windowId);
      }
    
      /**
       * render
       * @return
       */
      render() {
        const {
          collectionLabel,
          collectionPath,
          id,
          t,
        } = this.props;
    
        if (collectionPath.length === 0) return null;
    
        return (
          <CollapsibleSection
            id={`${id}-collection`}
            label={t('collection')}
          >
            {collectionLabel && (
              <Typography
                aria-labelledby={`${id}-resource ${id}-resource-heading`}
                id={`${id}-resource-heading`}
                variant="h4"
              >
                {collectionLabel}
              </Typography>
            )}
    
            <Button
              color="primary"
              onClick={this.openCollectionDialog}
              startIcon={<ViewListIcon />}
            >
              {t('showCollection')}
            </Button>
          </CollapsibleSection>
        );
      }
    }
    
    CollectionInfo.propTypes = {
      collectionLabel: PropTypes.string,
      collectionPath: PropTypes.arrayOf(PropTypes.string),
      id: PropTypes.string.isRequired,
      showCollectionDialog: PropTypes.func.isRequired,
      t: PropTypes.func,
      windowId: PropTypes.string,
    };
    
    CollectionInfo.defaultProps = {
      collectionLabel: null,
      collectionPath: [],
      t: key => key,
      windowId: null,
    };