diff --git a/src/client/components/main_layout/InfoHeader.js b/src/client/components/main_layout/InfoHeader.js index 47f51a6652c621d0b4233fc914167263acb07b3b..744e80eeb38c4885bbfd52bf06169cf90fd9014c 100644 --- a/src/client/components/main_layout/InfoHeader.js +++ b/src/client/components/main_layout/InfoHeader.js @@ -8,6 +8,7 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import Typography from '@material-ui/core/Typography'; import Grid from '@material-ui/core/Grid'; //import Divider from '@material-ui/core/Divider'; +import intl from 'react-intl-universal'; const styles = theme => ({ root: { @@ -80,7 +81,10 @@ const InfoHeader = props => { id="panel1a-header" IconButtonProps={{ onClick: handleExpandButtonOnClick }} > - <Typography component="h1" variant="h3">{props.title}</Typography> + <Typography component="h1" variant="h3"> + {props.pageType === 'facetResults' && intl.getHTML(`perspectives.${props.resultClass}.label`)} + {props.pageType === 'instancePage' && intl.getHTML(`perspectives.${props.resultClass}.instancePage.label`)} + </Typography> {props.pageType === 'instancePage' && <React.Fragment> <Typography className={props.classes.label} component="h1" variant="h6">{generateLabel()}</Typography> @@ -91,7 +95,8 @@ const InfoHeader = props => { className={props.classes.content} style={{ height: props.descriptionHeight }} > - {props.description} + {props.pageType === 'facetResults' && intl.getHTML(`perspectives.${props.resultClass}.longDescription`)} + {props.pageType === 'instancePage' && intl.getHTML(`perspectives.${props.resultClass}.instancePage.description`)} </ExpansionPanelDetails> </ExpansionPanel> </Grid> @@ -105,8 +110,6 @@ InfoHeader.propTypes = { pageType: PropTypes.string.isRequired, expanded: PropTypes.bool.isRequired, updateExpanded: PropTypes.func.isRequired, - title: PropTypes.string.isRequired, - description: PropTypes.object.isRequired, descriptionHeight: PropTypes.number.isRequired, }; diff --git a/src/client/components/main_layout/Main.js b/src/client/components/main_layout/Main.js index 8e164b467704d70c16a3b782e16c071227aa99a4..6d2107333b488e1eb49aefa415f3dee105746b37 100644 --- a/src/client/components/main_layout/Main.js +++ b/src/client/components/main_layout/Main.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import intl from 'react-intl-universal'; import classNames from 'classnames'; import Card from '@material-ui/core/Card'; import CardActionArea from '@material-ui/core/CardActionArea'; @@ -91,10 +92,10 @@ let Main = props => { /> <CardContent className={classes.cardContent}> <Typography gutterBottom variant="h5" component="h2"> - {perspective.label} + {intl.get(`perspectives.${perspective.id}.label`)} </Typography> <Typography component="p"> - {perspective.mainPageDesc} + {intl.get(`perspectives.${perspective.id}.shortDescription`)} </Typography> </CardContent> </CardActionArea> @@ -111,10 +112,10 @@ let Main = props => { /> <CardContent className={classes.cardContent}> <Typography gutterBottom variant="h5" component="h2"> - {perspective.label} + {intl.get(`perspectives.${perspective.id}.label`)} </Typography> <Typography component="p"> - {perspective.mainPageDesc} + {intl.get(`perspectives.${perspective.id}.shortDescription`)} </Typography> </CardContent> </CardActionArea> diff --git a/src/client/components/main_layout/TopBar.js b/src/client/components/main_layout/TopBar.js index f823fe1199b679695243f4fe5c5e2e044661ca98..20f6d1a1b41ad94d1e2c45498dc3632733aa4dcc 100644 --- a/src/client/components/main_layout/TopBar.js +++ b/src/client/components/main_layout/TopBar.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import intl from 'react-intl-universal'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import IconButton from '@material-ui/core/IconButton'; @@ -12,7 +13,7 @@ import Button from '@material-ui/core/Button'; import { Link, NavLink } from 'react-router-dom'; import TopBarSearchField from './TopBarSearchField'; import TopBarInfoButton from './TopBarInfoButton'; -// import TopBarLanguageButton from './TopBarLanguageButton'; +import TopBarLanguageButton from './TopBarLanguageButton'; import Divider from '@material-ui/core/Divider'; import { has } from 'lodash'; @@ -91,7 +92,7 @@ class TopBar extends React.Component { rel='noopener noreferrer' > <MenuItem> - {perspective.label.toUpperCase()} + {intl.get(`perspectives.${perspective.id}.label`).toUpperCase()} </MenuItem> </a> ); @@ -102,7 +103,7 @@ class TopBar extends React.Component { component={this.AdapterLink} to={`/${perspective.id}/faceted-search`} > - {perspective.label.toUpperCase()} + {intl.get(`perspectives.${perspective.id}.label`).toUpperCase()} </MenuItem> ); } @@ -120,7 +121,7 @@ class TopBar extends React.Component { <Button className={this.props.classes.appBarButton} > - {perspective.label} + {intl.get(`perspectives.${perspective.id}.label`).toUpperCase()} </Button> </a> ); @@ -134,7 +135,7 @@ class TopBar extends React.Component { isActive={(match, location) => location.pathname.startsWith(`/${perspective.id}`)} activeClassName={this.props.classes.appBarButtonActive} > - {perspective.label} + {intl.get(`perspectives.${perspective.id}.label`).toUpperCase()} </Button> ); } @@ -225,11 +226,11 @@ class TopBar extends React.Component { > Instructions </Button> - { /*<TopBarLanguageButton + <TopBarLanguageButton currentLocale={currentLocale} availableLocales={availableLocales} loadLocales={this.props.loadLocales} - /> */ } + /> </div> <div className={classes.sectionMobile}> <IconButton aria-haspopup="true" onClick={this.handleMobileMenuOpen} color="inherit"> diff --git a/src/client/components/perspectives/PerspectiveArrayMMM.js b/src/client/components/perspectives/PerspectiveConfigMMM.js similarity index 85% rename from src/client/components/perspectives/PerspectiveArrayMMM.js rename to src/client/components/perspectives/PerspectiveConfigMMM.js index b4e79938470753527556d0ac726b3d45fcad1edb..037ad833668405a6a10b94f31b208e60b8bb675f 100644 --- a/src/client/components/perspectives/PerspectiveArrayMMM.js +++ b/src/client/components/perspectives/PerspectiveConfigMMM.js @@ -5,66 +5,9 @@ import AddLocationIcon from '@material-ui/icons/AddLocation'; import RedoIcon from '@material-ui/icons/Redo'; import CloudDownloadIcon from '@material-ui/icons/CloudDownload'; -export const perspectiveArr = [ +export const perspectiveConfig = [ { id: 'manuscripts', - label: 'Manuscripts', - instancePageLabel: 'Manuscript', - mainPageDesc: 'Physical manuscript objects', - perspectiveDesc: - <React.Fragment> - <Typography paragraph={true}> - Use this perspective to access data related to physical manuscript objects. - The paginated tabular result view is default, including all manuscripts in - the MMM data. One table row is equivalent to one manuscript. If two or more - source datasets include the same manuscript and this has been - manually verified, the information from the source datasets has been merged - into one table row. - </Typography> - <Typography paragraph={true}> - To view the production places of manuscripts on a map, choose the “Production - Place†tab. - </Typography> - </React.Fragment> - , - instancePageDesc: - <React.Fragment> - <Typography paragraph={true}> - This landing page provides a human-readable summary of the data points that link - to this Manuscript. The data included in this summary reflects only those data - points used in the MMM interface. Click the Open in Linked Data Browser button to - view the complete set of classes and properties linked to this record. To cite this - record, use its url. - </Typography> - <Typography paragraph={true}> - MMM’s Manuscript entity corresponds to FRBRoo’s Manifestation Singleton, defined as - “physical objects that each carry an instance of [an Expression], and that were - produced as unique objects…†The various types of records that describe manuscripts - in each of the three contributing MMM datasets have been mapped to this entity. - </Typography> - <Typography variant='h6'>Manuscript labels</Typography> - <Typography paragraph={true}> - If the Bibale or Oxford databases reference a shelf mark for the manuscript, - that information will appear as its label. Otherwise, an SDBM ID number will serve - as its label. SDBM ID numbers contain prefixes that indicate different things about - the type of record they contain: - </Typography> - <ul> - <li><Typography> - SDBM_MS: SDBM Manuscript Record, which aggregates the data of two or more SDBM - Entries. Each Entry represents a different observation of a manuscript at a different - point in time, derived from various sources. - </Typography></li> - <li><Typography> - SDBM_MS_orphan: a single Entry in the SDBM, meaning it has not been linked to any - other Entries and therefore has no SDBM Manuscript Record. - </Typography></li> - <li><Typography> - SDBM_MS_part: a record identified as a fragment of a larger manuscript. - </Typography></li> - </ul> - </React.Fragment> - , perspectiveDescHeight: 99, defaultActiveFacets: new Set(['prefLabel']), tabs: [ @@ -95,12 +38,7 @@ export const perspectiveArr = [ value: 0, icon: <CalendarViewDayIcon />, }, - // { - // id: 'map', - // label: 'map', - // value: 1, - // icon: <AddLocationIcon />, - // }, + { id: 'export', value: 1, diff --git a/src/client/components/perspectives/PerspectiveArrayOnlyInfoPagesMMM.js b/src/client/components/perspectives/PerspectiveConfigOnlyInfoPagesMMM.js similarity index 97% rename from src/client/components/perspectives/PerspectiveArrayOnlyInfoPagesMMM.js rename to src/client/components/perspectives/PerspectiveConfigOnlyInfoPagesMMM.js index 3df76b9b9544d9ac200ff4d21a675ced2e71c2db..ca5246bd654be75238ec48f4f7323eb0e48fd57b 100644 --- a/src/client/components/perspectives/PerspectiveArrayOnlyInfoPagesMMM.js +++ b/src/client/components/perspectives/PerspectiveConfigOnlyInfoPagesMMM.js @@ -1,7 +1,7 @@ import React from 'react'; import Typography from '@material-ui/core/Typography'; -export const perspectiveArrOnlyInfoPages = [ +export const perspectiveConfigOnlyInfoPages = [ { id: 'collections', instancePageLabel: 'Collection', diff --git a/src/client/containers/SemanticPortal.js b/src/client/containers/SemanticPortal.js index 60e4a6da1f652674e3f2c00ee6c3877236b0a401..21fe7d49b36cf120a190200fe772ecb6d90921e6 100644 --- a/src/client/containers/SemanticPortal.js +++ b/src/client/containers/SemanticPortal.js @@ -22,11 +22,11 @@ import InstanceHomePage from '../components/main_layout/InstanceHomePage'; // import FeedbackPage from '../components/main_layout/FeedbackPage'; import TextPage from '../components/main_layout/TextPage'; import { - perspectiveArr, + perspectiveConfig, aboutTheProject, instructions -} from '../components/perspectives/PerspectiveArrayMMM'; -import { perspectiveArrOnlyInfoPages } from '../components/perspectives/PerspectiveArrayOnlyInfoPagesMMM'; +} from '../components/perspectives/PerspectiveConfigMMM'; +import { perspectiveConfigOnlyInfoPages } from '../components/perspectives/PerspectiveConfigOnlyInfoPagesMMM'; import InfoHeader from '../components/main_layout/InfoHeader'; import { has } from 'lodash'; //import { urlToState } from '../helpers/helpers'; @@ -274,7 +274,7 @@ let SemanticPortal = props => { search={props.clientSideFacetedSearch} fetchResultsClientSide={props.fetchResultsClientSide} clearResults={props.clearResults} - perspectives={perspectiveArr} + perspectives={perspectiveConfig} currentLocale={props.options.currentLocale} availableLocales={props.options.availableLocales} loadLocales={props.loadLocales} @@ -283,7 +283,7 @@ let SemanticPortal = props => { exact path="/" render={() => <Grid container spacing={1} className={classes.mainContainer}> - <Main perspectives={perspectiveArr}/> + <Main perspectives={perspectiveConfig}/> <Footer /> </Grid> } @@ -303,7 +303,7 @@ let SemanticPortal = props => { } /> { /* routes for perspectives that don't have an external url */ } - {perspectiveArr.map(perspective => { + {perspectiveConfig.map(perspective => { if (!has(perspective, 'externalUrl')) { return( <React.Fragment key={perspective.id}> @@ -314,11 +314,9 @@ let SemanticPortal = props => { <React.Fragment> <InfoHeader resultClass={perspective.id} - pageType='facetedSearch' + pageType='facetResults' expanded={props[perspective.id].facetedSearchHeaderExpanded} updateExpanded={props.updatePerspectiveHeaderExpanded} - title={perspective.label} - description={perspective.perspectiveDesc} descriptionHeight={perspective.perspectiveDescHeight} /> <Grid container spacing={1} className={props[perspective.id].facetedSearchHeaderExpanded @@ -358,8 +356,6 @@ let SemanticPortal = props => { instanceData={props[perspective.id].instance} expanded={props[perspective.id].instancePageHeaderExpanded} updateExpanded={props.updatePerspectiveHeaderExpanded} - title={perspective.instancePageLabel} - description={perspective.instancePageDesc} descriptionHeight={perspective.perspectiveDescHeight} /> <Grid container spacing={1} className={props[perspective.id].instancePageHeaderExpanded @@ -388,7 +384,7 @@ let SemanticPortal = props => { } })} { /* create routes for classes that have only info pages and no perspective */} - {perspectiveArrOnlyInfoPages.map(perspective => + {perspectiveConfigOnlyInfoPages.map(perspective => <Route key={perspective.id} path={`/${perspective.id}/page/:id`} @@ -401,8 +397,6 @@ let SemanticPortal = props => { instanceData={props[perspective.id].instance} expanded={props[perspective.id].instancePageHeaderExpanded} updateExpanded={props.updatePerspectiveHeaderExpanded} - title={perspective.instancePageLabel} - description={perspective.instancePageDesc} descriptionHeight={99} /> <Grid container spacing={1} className={props[perspective.id].instancePageHeaderExpanded diff --git a/src/client/translations/localeEN.js b/src/client/translations/localeEN.js index 3e16b7bda0a2b96a914ad4e28309316791d322f7..95f72385b74cafaf194fd29300592cbc8b912caa 100644 --- a/src/client/translations/localeEN.js +++ b/src/client/translations/localeEN.js @@ -13,12 +13,22 @@ export default { }, 'perspectives': { 'manuscripts': { - 'perspectiveLabel': 'Manuscripts', - 'instancePageLabel': 'Manuscript', - 'mainPageDescription': 'Physical manuscript objects', - 'perspectiveDescription': { - 'paragraph1': 'pi' - }, + 'label': 'Manuscripts', + 'shortDescription': 'Physical manuscript objects', + 'longDescription': ` + <p class="MuiTypography-root MuiTypography-body1 MuiTypography-paragraph"> + Use this perspective to access data related to physical manuscript objects. + The paginated tabular result view is default, including all manuscripts in + the MMM data. One table row is equivalent to one manuscript. If two or more + source datasets include the same manuscript and this has been + manually verified, the information from the source datasets has been merged + into one table row. + </p> + <p class="MuiTypography-root MuiTypography-body1 MuiTypography-paragraph"> + To view the production places of manuscripts on a map, choose the “Production + Place†tab. + </p> + `, 'tableColumns': { 'uri': { 'label': 'URI', @@ -28,7 +38,64 @@ export default { 'label': 'Label', 'description': 'A short label describing the manuscript.' } + }, + 'instancePage': { + 'label': 'Manuscript', + 'description': ` + <p class="MuiTypography-root MuiTypography-body1 MuiTypography-paragraph"> + This landing page provides a human-readable summary of the data points that link + to this Manuscript. The data included in this summary reflects only those data + points used in the MMM interface. Click the Open in Linked Data Browser button to + view the complete set of classes and properties linked to this record. To cite this + record, use its url. + </p> + <p class="MuiTypography-root MuiTypography-body1 MuiTypography-paragraph"> + MMM’s Manuscript entity corresponds to FRBRoo’s Manifestation Singleton, defined as + “physical objects that each carry an instance of [an Expression], and that were + produced as unique objects…†The various types of records that describe manuscripts + in each of the three contributing MMM datasets have been mapped to this entity. + </p> + <h6 class="MuiTypography-root MuiTypography-h6"> + Manuscript labels + </h6> + <p class="MuiTypography-root MuiTypography-body1 MuiTypography-paragraph"> + If the Bibale or Oxford databases reference a shelf mark for the manuscript, + that information will appear as its label. Otherwise, an SDBM ID number will serve + as its label. SDBM ID numbers contain prefixes that indicate different things about + the type of record they contain: + </p> + <ul class="MuiTypography-root MuiTypography-body1"> + <li> + SDBM_MS: SDBM Manuscript Record, which aggregates the data of two or more SDBM + Entries. Each Entry represents a different observation of a manuscript at a different + point in time, derived from various sources. + </li> + <li> + SDBM_MS_orphan: a single Entry in the SDBM, meaning it has not been linked to any + other Entries and therefore has no SDBM Manuscript Record. + </li> + <li> + SDBM_MS_part: a record identified as a fragment of a larger manuscript. + </li> + </ul> + ` } + }, + 'works': { + 'label': 'Works', + 'shortDescription': 'Physical manuscript objects', + }, + 'events': { + 'label': 'Events', + 'shortDescription': 'Physical manuscript objects', + }, + 'actors': { + 'label': 'Actors', + 'shortDescription': 'Physical manuscript objects', + }, + 'places': { + 'label': 'Places', + 'shortDescription': 'Physical manuscript objects', } } };