Skip to content
Snippets Groups Projects
Select Git revision
  • 48baab94e9958b94d44dcb116a748554655f139c
  • 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

AnnotationExportDialog.test.js

  • WindowSideBarInfoPanel.js 2.45 KiB
    import React, { Component } from 'react';
    import PropTypes from 'prop-types';
    import Divider from '@material-ui/core/Divider';
    import Typography from '@material-ui/core/Typography';
    import { SanitizedHtml } from './SanitizedHtml';
    import { LabelValueMetadata } from './LabelValueMetadata';
    import ns from '../config/css-ns';
    
    
    /**
     * WindowSideBarInfoPanel
     */
    export class WindowSideBarInfoPanel extends Component {
      /**
       * render
       * @return
       */
      render() {
        const {
          canvasDescription,
          canvasLabel,
          canvasMetadata,
          classes,
          manifestDescription,
          manifestLabel,
          manifestMetadata,
          t,
        } = this.props;
    
        return (
          <div className={ns('window-sidebar-info-panel')}>
    
            <Typography variant="h2" className={classes.windowSideBarH2}>
              {t('aboutThisItem')}
            </Typography>
    
            {canvasLabel && (
              <Typography variant="h3" className={classes.windowSideBarH3}>
                {canvasLabel}
              </Typography>
            )}
    
            {canvasDescription && (
              <Typography variant="body2">
                <SanitizedHtml htmlString={canvasDescription} ruleSet="iiif" />
              </Typography>
            )}
    
            {canvasMetadata.length > 0 && (
              <LabelValueMetadata labelValuePairs={canvasMetadata} />
            )}
    
            <Divider />
    
            {manifestLabel && (
              <Typography variant="h3" className={classes.windowSideBarH3}>
                {manifestLabel}
              </Typography>
            )}
    
            {manifestDescription && (
              <Typography variant="body2">
                <SanitizedHtml htmlString={manifestDescription} ruleSet="iiif" />
              </Typography>
            )}
    
            {manifestMetadata.length > 0 && (
              <LabelValueMetadata labelValuePairs={manifestMetadata} />
            )}
    
          </div>
        );
      }
    }
    
    WindowSideBarInfoPanel.propTypes = {
      canvasDescription: PropTypes.string,
      canvasLabel: PropTypes.string,
      canvasMetadata: PropTypes.array, // eslint-disable-line react/forbid-prop-types
      classes: PropTypes.object, // eslint-disable-line react/forbid-prop-types
      manifestLabel: PropTypes.string,
      manifestDescription: PropTypes.string,
      manifestMetadata: PropTypes.array, // eslint-disable-line react/forbid-prop-types
      t: PropTypes.func,
    };
    
    WindowSideBarInfoPanel.defaultProps = {
      canvasDescription: null,
      canvasLabel: null,
      canvasMetadata: [],
      classes: {},
      manifestLabel: null,
      manifestDescription: null,
      manifestMetadata: [],
      t: key => key,
    };