Commit cd25a28e authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '175-page-titles-not-set' into 'master'

Page titles not set

Closes #175

See merge request genesys-pgr/genesys-ui!179
parents deee86d3 3d8edb37
......@@ -88,6 +88,7 @@
"lastModified": "Last modified",
"lastUpdated": "Last updated",
"lastUpdatedBy": "Last updated by {{who}}",
"loading": "Loading {{what}}",
"modified": "Modified",
"name": "Name",
"newVersionAvailable": "New version available",
......
......@@ -783,6 +783,7 @@
"edit": {
"articleSaved": "Article saved",
"activityPostSaved": "Activity post saved",
"activityPostPageTitle": "Activity post details",
"transifex": {
"fetch": "Fetch translations",
"fetchStarted": "Fetch started",
......@@ -1254,8 +1255,8 @@
"admin": {
"p": {
"edit": {
"title": "Edit descriptor",
"dataPublication": "Data publication",
"title": "Edit {{title}} descriptor",
"details": "Descriptor details",
"back": "BACK TO DASHBOARD"
}
},
......@@ -1514,6 +1515,11 @@
}
},
"dashboard": {
"p": {
"edit": {
"title": "Edit {{instName}}"
}
},
"c": {
"form": {
"gaTracker": "GA Tracker code",
......@@ -1729,7 +1735,8 @@
"display": {
"email": "Contact email",
"metadata": "Record metadata",
"urls": "Websites"
"urls": "Websites",
"title": "Data provider details"
}
}
}
......@@ -1743,14 +1750,16 @@
"imageGallery": {
"toFolder": "To folder",
"deleteGallery": "Delete gallery",
"deleteGalleryAlert": "Gallery at {{folderPath, string}} could not be deleted."
"deleteGalleryAlert": "Gallery at {{folderPath, string}} could not be deleted.",
"title": "Image gallery details"
},
"repositoryBrowser": {
"viewGallery": "View gallery",
"createGallery": "Create gallery",
"createGalleryAlert": "Image gallery at {{folderPath, string}} could not be created.",
"deleteFolder": "Delete folder",
"deleteFolderAlert": "Folder {{folderPath, string}} could not be deleted."
"deleteFolderAlert": "Folder {{folderPath, string}} could not be deleted.",
"title": "File repository"
}
},
"dialog": {
......@@ -1844,7 +1853,7 @@
},
"p": {
"browse": {
"title": "{{totalElements, number}} requests for PGR material"
"title": "Requests for PGR material"
},
"display": {
"title": "Request from {{email, string}}",
......@@ -1952,8 +1961,12 @@
"createSubsets": "Create subset"
},
"p": {
"browse": {
"title": "Subsets dashboard"
},
"stepper": {
"stepperTitle": "Steps for subset data publication completion",
"publisher": "Subset data publisher",
"accessionList": {
"stepName": "List of accessions",
"instructions": "INSTRUCTIONS FOR USE",
......@@ -2152,7 +2165,8 @@
"confirm": "Do you wish to set a new FTP password for this account?"
},
"profile": {
"title": "User profile"
"title": "User profile",
"profile": "{{fullName}} profile information"
}
}
},
......@@ -2263,7 +2277,7 @@
"p": {
"browse": {
"create": "Create vocabulary",
"title": "What do you want to do?",
"title": "Browse vocabularies",
"update": "Update vocabularies"
},
"display": {
......@@ -2273,6 +2287,10 @@
"term": "Term",
"terms": "terms",
"title": "Vocabulary details"
},
"edit": {
"title": "{{code}} vocabulary edit",
"titleCreate": "Create vocabulary"
}
}
},
......
......@@ -22,6 +22,7 @@ import Tabs, { Tab } from 'ui/common/Tabs';
import AccessionFilters from './c/Filters';
import ButtonBar from 'ui/common/buttons/ButtonBar';
import DownloadDialog, { DOWNLOAD_LIMIT } from 'ui/common/download-dialog';
import PageTitle from 'ui/common/PageTitle';
class BrowsePage extends BrowsePageTemplate<Accession> {
......@@ -52,6 +53,7 @@ class BrowsePage extends BrowsePageTemplate<Accession> {
<PageLayout sidebar={
<AccessionFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters } />
}>
<PageTitle title={ t('accessions.public.p.browse.title') }/>
<ContentHeader title={ t('accessions.public.p.browse.title') } subTitle={ t('accessions.public.p.browse.subTitle') } />
<PaginationComponent
pageObj={ paged }
......
......@@ -41,6 +41,7 @@ import Authorize from 'ui/common/authorized/Authorize';
import TemperatureChart from './c/TemperatureChart';
import PrecipitationChart from './c/PrecipitationChart';
import ClimateTable from './c/ClimateTable';
import PageTitle from 'ui/common/PageTitle';
import ActionButton from 'ui/common/buttons/ActionButton';
const styles = (theme) => ({
......@@ -206,7 +207,11 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
return (
<PageLayout withFooter>
<ScrollToTopOnMount />
<ContentHeader title={ t('accessions.public.p.display.title') } subtitle={ t('accessions.public.p.display.subTitle') } />
<PageTitle title={ !stillLoading ? accession.accessionNumber : t('common:label.loading', { what: t('accessions.public.p.display.title') }) } />
<ContentHeader
title={ !stillLoading ? accession.accessionNumber : t('common:label.loading', { what: t('accessions.public.p.display.title') }) }
subtitle={ t('accessions.public.p.display.subTitle') }
/>
{ stillLoading ? <Loading /> :
<div>
......@@ -216,7 +221,7 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
<PageContents className="pt-1rem">
<MainSection className={ isChecked ? classes.selected : accession.historic ? classes.historic : '' } title={
<div>
{ t('accessions.common.modelName') }: { accession.accessionNumber }
{ t('accessions.public.p.display.title') }
<div className="float-right">
<Authorize role={ ROLE_USER }>
<Button className="mr-20" variant="contained" onClick={ this.loadAuditLog }>{ t('accessions.public.p.display.loadChanges') }</Button>
......
......@@ -9,6 +9,7 @@ import AccessionFilter from 'model/accession/AccessionFilter';
import Loading from 'ui/common/Loading';
import AccessionMapInfo from 'model/accession/AccessionMapInfo';
import MapLayer from 'model/genesys/MapTileLayer';
import ContentHeader from 'ui/common/heading/ContentHeader';
import Button from '@material-ui/core/Button';
import Tabs, { Tab } from 'ui/common/Tabs';
import PrettyFilters from 'ui/common/filter/PrettyFilters';
......@@ -17,6 +18,7 @@ import ContentLayout from 'ui/layout/ContentLayout';
import MapConfigSection from './c/MapConfigSection';
import AccessionService from 'service/genesys/AccessionService';
import PageTitle from 'ui/common/PageTitle';
let Map;
let TileLayer;
......@@ -156,7 +158,9 @@ class BrowsePage extends React.Component<IMapPageProps, any> {
rightAlwaysCollapsible
customHeaderHeight
>
<Tabs
<PageTitle title={ t('accessions.public.p.browse.title') } />
<ContentHeader title={ t('accessions.public.p.browse.title') } subTitle={ t('accessions.public.p.browse.subTitle') } />
<Tabs
tab={ currentTab }
actions={
<ButtonBar>
......
......@@ -24,6 +24,7 @@ import Tabs, { Tab } from 'ui/common/Tabs';
import PropertiesCard from 'ui/common/PropertiesCard';
import PrettyFilters from 'ui/common/filter/PrettyFilters';
import Number from 'ui/common/Number';
import PageTitle from 'ui/common/PageTitle';
import AccessionFilters from './c/Filters';
......@@ -136,6 +137,7 @@ class BrowsePage extends React.Component<IOverviewPageProps, any> {
}
withFooter
>
<PageTitle title={ t('accessions.public.p.browse.title') }/>
<ContentHeader title={ t('accessions.public.p.browse.title') } subTitle={ t('accessions.public.p.browse.subTitle') } />
<Tabs
tab={ currentTab }
......
......@@ -35,6 +35,7 @@
"edit": {
"articleSaved": "Article saved",
"activityPostSaved": "Activity post saved",
"activityPostPageTitle": "Activity post details",
"transifex": {
"fetch": "Fetch translations",
"fetchStarted": "Fetch started",
......
......@@ -14,6 +14,7 @@ import Menu from 'model/cms/Menu';
import PageLayout from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader';
import Loading from 'ui/common/Loading';
import PageTitle from 'ui/common/PageTitle';
import ArticleSection from './c/ArticleSection';
import Grid from '@material-ui/core/Grid';
import MenuStepper from 'cms/ui/c/MenuStepper';
......@@ -79,6 +80,7 @@ class ActivityPostDisplayPage extends React.Component<IActivityPostDisplayPage>
<Loading/>
) : (
<Grid container style={ {height: '100%'} }>
<PageTitle title={ title }/>
<ContentHeader title={ title }/>
<ArticleSection title={ title } body={ activityPost.body }/>
<MenuStepper menu={ lastNewsMenu }/>
......
......@@ -11,6 +11,7 @@ import Article from 'model/cms/Article';
// UI
import PageLayout from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader';
import PageTitle from 'ui/common/PageTitle';
import ArticleSection from './c/ArticleSection';
import MenuStepper from './c/MenuStepper';
......@@ -67,6 +68,7 @@ class ContentPage extends React.Component<IContentPageProps> {
<PageLayout withFooter>
{ article &&
<Grid container style={ {height: '100%'} }>
<PageTitle title={ article.title }/>
<ContentHeader title={ article.title } />
<ArticleSection body={ article.body }/>
{ menuKey && <MenuStepper menu={ menu } t={ t }/> }
......
......@@ -4,13 +4,13 @@ import {bindActionCreators} from 'redux';
import { translate } from 'react-i18next';
// Actions
import { setPageTitle } from 'actions/pageTitle';
import {loadDocumentation} from 'cms/actions/public';
// Model
import ADoc from 'model/cms/ADoc';
// UI
import PageLayout from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader';
import PageTitle from 'ui/common/PageTitle';
import DocumentationSection from './c/DocumentationSection';
import Grid from '@material-ui/core/Grid';
......@@ -22,7 +22,6 @@ interface IDocumentationPageProps {
i18n: any;
documentation: ADoc;
loadDocumentation: (slug: string) => void;
setPageTitle: any;
}
class ContentPage extends React.Component<IDocumentationPageProps> {
......@@ -39,14 +38,10 @@ class ContentPage extends React.Component<IDocumentationPageProps> {
}
}
public componentWillReceiveProps(nextProps) {
const { slug, documentation, loadDocumentation, setPageTitle, loadingSlug } = nextProps;
const { slug, documentation, loadDocumentation, loadingSlug } = nextProps;
if ((!documentation && !loadingSlug) || (loadingSlug && slug !== loadingSlug)) {
loadDocumentation(slug);
} else {
if (documentation && documentation.title) {
setPageTitle(documentation.title);
}
}
}
......@@ -58,6 +53,7 @@ class ContentPage extends React.Component<IDocumentationPageProps> {
<PageLayout withFooter>
{ documentation &&
<Grid container>
<PageTitle title={ documentation.title }/>
<ContentHeader title={ documentation.title } />
<DocumentationSection documentation={ documentation }/>
</Grid>
......@@ -75,6 +71,5 @@ const mapStateToProps = (state, ownProps) => ({
const mapDispatchToProps = (dispatch) => bindActionCreators({
loadDocumentation,
setPageTitle,
}, dispatch);
export default translate()(connect(mapStateToProps, mapDispatchToProps)(ContentPage));
......@@ -13,9 +13,9 @@ import ActivityPost from 'model/cms/ActivityPost';
// UI
import BrowsePageTemplate, { IBrowsePageProps } from 'ui/pages/_base/BrowsePage';
import PageLayout, { PageContents } from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader';
import Loading from 'ui/common/Loading';
import PagedLoader from 'ui/common/PagedLoader';
import PageTitle from 'ui/common/PageTitle';
import ActivityPostFilters from './c/ActivityPostFilters';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import Button from '@material-ui/core/Button/Button';
......@@ -38,8 +38,9 @@ class ActivityPostBrowsePage extends BrowsePageTemplate<ActivityPost> {
<PageLayout sidebar={
<ActivityPostFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters }/>
}>
<ContentHeader title={ t('cms.admin.p.browseActivityPost.title') }/>
<PageTitle title={ t('cms.admin.p.browseActivityPost.title') }/>
<ContentHeaderWithButton
title={ t('cms.admin.p.browseActivityPost.title') }
buttons={
<Link to="/admin/content/activity-post/edit">
<Button variant="contained">{ t('cms.admin.p.browseActivityPost.create') }</Button>
......
......@@ -21,6 +21,7 @@ import ButtonBar from 'ui/common/buttons/ButtonBar';
import ActivityPostForm from 'cms/ui/admin/c/ActivityPostForm';
import ArticleSection from 'cms/ui/c/ArticleSection';
import Footer from 'ui/layout/Footer';
import PageTitle from 'ui/common/PageTitle';
const styles = () => ({
activityPost: {
......@@ -106,6 +107,7 @@ class ActivityPostEditPage extends React.Component<IArticleEditPageProps, any> {
return (
<div>
<PageTitle title={ activityPost.title.split(/<\w>|<\/\w>/).join('') }/>
<ContentHeaderWithButton
title={ <span dangerouslySetInnerHTML={ { __html: activityPost.title } }/> }
classes={ { subHeader: classes.customSubHeader } }
......
......@@ -13,12 +13,12 @@ import Article from 'model/cms/Article';
// UI
import BrowsePageTemplate, { IBrowsePageProps } from 'ui/pages/_base/BrowsePage';
import PageLayout, { PageContents } from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader';
import Loading from 'ui/common/Loading';
import PagedLoader from 'ui/common/PagedLoader';
import ArticleFilters from './c/ArticleFilters';
import ArticleCard from './c/ArticleCard';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import PageTitle from 'ui/common/PageTitle';
import Button from '@material-ui/core/Button/Button';
class BrowsePage extends BrowsePageTemplate<Article> {
......@@ -38,8 +38,9 @@ class BrowsePage extends BrowsePageTemplate<Article> {
<PageLayout sidebar={
<ArticleFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters }/>
}>
<ContentHeader title={ t('cms.admin.p.browse.title') }/>
<PageTitle title={ t('cms.admin.p.browse.title') }/>
<ContentHeaderWithButton
title={ t('cms.admin.p.browse.title') }
buttons={
<Link to="/admin/content/edit">
<Button variant="contained">{ t('cms.admin.p.browse.create') }</Button>
......
......@@ -15,11 +15,12 @@ import CmsService from 'service/genesys/CmsService';
import { log } from 'utilities/debug';
// ui
import { PageContents } from 'ui/layout/PageLayout';
import PageTitle from 'ui/common/PageTitle';
import Grid from '@material-ui/core/Grid';
import ArticleForm from './c/ArticleForm';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import ActionButton from 'ui/common/buttons/ActionButton';
import ArticleSection from '../c/ArticleSection';
import ArticleSection from 'cms/ui/c/ArticleSection';
import ButtonBar from 'ui/common/buttons/ButtonBar';
const styles = () => ({
......@@ -114,6 +115,7 @@ class ArticleEditPage extends React.Component<IArticleEditPageProps, any> {
return (
<div>
<PageTitle title={ article.title }/>
<ContentHeaderWithButton title={ article.title } classes={ { subHeader: classes.customSubHeader } } buttons={
<ButtonBar>
<ActionButton
......
......@@ -17,6 +17,7 @@ import GridContainer from 'ui/layout/GridContainer';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import ActionButton from 'ui/common/buttons/ActionButton';
import Authorize from 'ui/common/authorized/Authorize';
import PageTitle from 'ui/common/PageTitle';
interface IBrowsePageProps extends React.ClassAttributes<any> {
crops: CropDetails[];
......@@ -36,12 +37,15 @@ class BrowsePage extends React.Component<IBrowsePageProps> {
return (
<PageLayout>
<PageTitle title={ t('crop.public.p.browse.title') } />
<ContentHeader title={ t('crop.public.p.browse.title') } subTitle={ t('crop.public.p.browse.subTitle') } />
<Authorize role="ROLE_ADMINISTRATOR">
<ContentHeaderWithButton buttons={
<div>
<ActionButton title={ t('crop.public.p.browse.createCrop') } action={ this.addNewCropHandle }/>
</div>
<ContentHeaderWithButton
isSecondary
buttons={
<div>
<ActionButton title={ t('crop.public.p.browse.createCrop') } action={ this.addNewCropHandle }/>
</div>
}/>
</Authorize>
<PageContents className="pt-1rem">
......
......@@ -27,6 +27,7 @@ import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import ButtonBar from 'ui/common/buttons/ButtonBar';
import ActionButton from 'ui/common/buttons/ActionButton';
import Authorize from 'ui/common/authorized/Authorize';
import PageTitle from 'ui/common/PageTitle';
/*tslint:disable*/
const styles = (theme) => ({
......@@ -58,6 +59,10 @@ const styles = (theme) => ({
},
},
},
relinkButton: {
marginTop: '4px',
marginBottom: '4px'
},
});
/*tslint:enable*/
......@@ -104,11 +109,13 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
return (
<PageLayout withFooter>
<ContentHeaderWithButton title={ t('crop.public.p.display.title') }
<PageTitle title={ !crop || crop.shortName !== shortName ? t('common:label.loading', { what: shortName }) : crop.name }/>
<ContentHeaderWithButton title={ !crop || crop.shortName !== shortName ? t('common:label.loading', { what: shortName }) : crop.name }
buttons={
<Authorize role="ROLE_ADMINISTRATOR">
<ButtonBar>
<ActionButton
className={ classes.relinkButton }
title={ t('crop.admin.p.link') }
action={ this.relinkAccessions }
/>
......@@ -117,7 +124,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
}
/>
{ !crop || crop.shortName !== shortName ? (<Loading/>) :
<PageContents className="pt-1rem container-spacing-horizontal pb-1rem">
<PageContents className="mt-15 container-spacing-horizontal pb-1rem">
{ cropDetails.blurb && cropDetails.blurb.body &&
<Section title={ shortName }>
<div className={ classes.cropBlurb } dangerouslySetInnerHTML={ {__html: cropDetails.blurb.body} }/>
......
......@@ -14,6 +14,7 @@ import Crop from 'model/genesys/Crop';
import CropForm from './c/CropForm';
import PageLayout, {PageContents} from 'ui/layout/PageLayout';
import PageTitle from 'ui/common/PageTitle';
interface ICropEditPageProps extends React.ClassAttributes<any> {
classes: any;
......@@ -76,6 +77,7 @@ class CropEditPage extends React.Component<ICropEditPageProps, any> {
return (
<PageLayout>
<PageTitle title={ !crop || crop.shortName !== shortName ? t('common:label.loading', { what: shortName }) : crop.name }/>
<PageContents className="pt-1rem">
<Grid item xs={ 12 }>
<Paper className="p-20 mb-10">
......
......@@ -113,9 +113,7 @@ const CropCard = ({crop, classes, compact = false, edit = false, t, ...other}: {
(
<Grid item xs={ 12 }>
<Card className={ classes.root }>
<CardHeader title={
<Link to={ `/c/${crop.shortName}${edit ? '/edit' : '' }` }>{ crop.name }</Link>
}/>
<CardHeader title={ t('crop.public.p.display.title') }/>
<CardContent>
<Properties>
<PropertiesItem title={ t('crop.public.c.cropCard.originalName') }>{ crop.name }</PropertiesItem>
......
......@@ -14,6 +14,7 @@ import PaginationComponent from 'ui/common/pagination';
import DatasetFilters from './c/Filters';
import PrettyFilters from 'ui/common/filter/PrettyFilters';
import PageLayout, { PageContents } from 'ui/layout/PageLayout';
import PageTitle from 'ui/common/PageTitle';
import DatasetCard from './c/Card';
import ContentHeader from 'ui/common/heading/ContentHeader';
......@@ -35,6 +36,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> {
<DatasetFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters }/>
}>
<ScrollToTopOnMount/>
<PageTitle title={ t('datasets.common.modelName_plural') }/>
<ContentHeader title={ t('datasets.common.modelName_plural') } subtitle={ t('datasets.public.p.browse.subtitle') }/>
<PaginationComponent
pageObj={ paged }
......
......@@ -13,8 +13,10 @@ import Page from 'model/Page';
import PageLayout from 'ui/layout/PageLayout';
import BackButton from 'ui/common/buttons/BackButton';
import Loading from 'ui/common/Loading';
import PageTitle from 'ui/common/PageTitle';
import DatasetDisplay from './c/DatasetDisplay';
import Grid from '@material-ui/core/Grid';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
interface IDatasetDetailProps extends React.ClassAttributes<any> {
classes: any;
......@@ -67,11 +69,12 @@ class DatasetDetail extends React.Component<IDatasetDetailProps, any> {
return (
<PageLayout>
<Grid container spacing={ 0 }>
<Grid item xs={ 12 } className={ `back-gray-yellow pl-20 pr-20 pt-10 pb-10 ${classes.backSection}` }>
<h4 className="font-bold lh-35 m-0">{ t('datasets.public.p.display.title') }</h4>
<div className={ classes.flexGrow }/>
<BackButton defaultTarget="/datasets" defaultBackText={ t('common:action.backTo', { where: t('common:label.list') }) }/>
</Grid>
<PageTitle title={ stillLoading ? t('common:label.loading', { what: t('datasets.public.p.display.title') }) : dataset.title }/>
<ContentHeaderWithButton
t={ t }
buttons={ <BackButton defaultTarget="/datasets" defaultBackText={ t('common:action.backTo', { where: t('common:label.list') }) }/> }
title={ stillLoading ? t('common:label.loading', { what: t('datasets.public.p.display.title') }) : dataset.title }
/>
{ stillLoading ? <Loading/> :
<Grid item xs={ 12 } className="p-10">
<DatasetDisplay
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment