Commit 3d8edb37 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov Committed by Viacheslav Pavlov
Browse files

Page titles not set

Added missing titles
fixed stepper pages
now titles are set by specific entity title not by generic "page type"
contentHeaderWithButton now sets it's background color depending on it's type
fixed vocabulary public routes
PageTitle introduced, setPageTitle now used only by PageTitle component
parent deee86d3
...@@ -254,7 +254,7 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> { ...@@ -254,7 +254,7 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> {
<Grid item xs={ 12 } className="p-10" id="dataset-top"> <Grid item xs={ 12 } className="p-10" id="dataset-top">
<Card className={ classes.card } square> <Card className={ classes.card } square>
<CardHeader className={ classes.cardHeader } <CardHeader className={ classes.cardHeader }
title={ <Markdown basic source={ dataset.title }/> } title={ t('datasets.public.p.display.title') }
subheader={ <small>{ dataset.versionTag }</small> }/> subheader={ <small>{ dataset.versionTag }</small> }/>
<CardContent className={ classes.cardContent }> <CardContent className={ classes.cardContent }>
{ dataset.description && <Markdown className="mb-20" source={ dataset.description }/> } { dataset.description && <Markdown className="mb-20" source={ dataset.description }/> }
......
...@@ -17,6 +17,7 @@ import PaginationComponent from 'ui/common/pagination'; ...@@ -17,6 +17,7 @@ import PaginationComponent from 'ui/common/pagination';
import DescriptorListCard from 'descriptorlists/ui/c/Card'; import DescriptorListCard from 'descriptorlists/ui/c/Card';
import DescriptorListFilters from './c/Filters'; import DescriptorListFilters from './c/Filters';
import PrettyFilters from 'ui/common/filter/PrettyFilters'; import PrettyFilters from 'ui/common/filter/PrettyFilters';
import PageTitle from 'ui/common/PageTitle';
import PageLayout, { PageContents } from 'ui/layout/PageLayout'; import PageLayout, { PageContents } from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader'; import ContentHeader from 'ui/common/heading/ContentHeader';
import BrowsePageTemplate from 'ui/pages/_base/BrowsePage'; import BrowsePageTemplate from 'ui/pages/_base/BrowsePage';
...@@ -38,6 +39,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> { ...@@ -38,6 +39,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> {
<DescriptorListFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters }/> <DescriptorListFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters }/>
}> }>
<ScrollToTopOnMount/> <ScrollToTopOnMount/>
<PageTitle title={ t('descriptorlists.common.modelName_plural') }/>
<ContentHeader <ContentHeader
title={ t('descriptorlists.common.modelName_plural') } title={ t('descriptorlists.common.modelName_plural') }
subtitle={ t('descriptorlists.public.p.browse.subtitle') } subtitle={ t('descriptorlists.public.p.browse.subtitle') }
......
...@@ -13,6 +13,7 @@ import { copyDescriptor } from 'descriptors/actions/public'; ...@@ -13,6 +13,7 @@ import { copyDescriptor } from 'descriptors/actions/public';
import DescriptorList from 'model/catalog/DescriptorList'; import DescriptorList from 'model/catalog/DescriptorList';
import Loading from 'ui/common/Loading'; import Loading from 'ui/common/Loading';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton'; import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import PageTitle from 'ui/common/PageTitle';
import BackButton from 'ui/common/buttons/BackButton'; import BackButton from 'ui/common/buttons/BackButton';
import PageLayout from 'ui/layout/PageLayout'; import PageLayout from 'ui/layout/PageLayout';
import DescriptorListDisplay from './c/DescriptorListDisplay'; import DescriptorListDisplay from './c/DescriptorListDisplay';
...@@ -61,8 +62,10 @@ class DescriptorListPage extends React.Component<IDescriptorListPageProps, any> ...@@ -61,8 +62,10 @@ class DescriptorListPage extends React.Component<IDescriptorListPageProps, any>
return ( return (
<PageLayout> <PageLayout>
<ContentHeaderWithButton title={ t('descriptorlists.public.p.display.title') } <PageTitle title={ !stillLoading ? `${descriptorList.title} ${descriptorList.versionTag}` : t('common:label.loading', {what: t('descriptorlists.public.p.display.title')}) }/>
buttons={ <BackButton defaultTarget="/descriptorlists"/> } <ContentHeaderWithButton
title={ !stillLoading ? `${descriptorList.title} ${descriptorList.versionTag}` : t('common:label.loading', {what: t('descriptorlists.public.p.display.title')}) }
buttons={ <BackButton defaultTarget="/descriptorlists"/> }
/> />
{ stillLoading ? <Loading className={ classes.contentContainer }/> : { stillLoading ? <Loading className={ classes.contentContainer }/> :
<span> <span>
......
...@@ -216,12 +216,7 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> { ...@@ -216,12 +216,7 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> {
<Card className={ classes.card } square> <Card className={ classes.card } square>
<CardHeader <CardHeader
className={ classes.cardHeader } className={ classes.cardHeader }
title={ ( title={ t('descriptorlists.public.p.display.title') }/>
<span>
<Markdown basic source={ descriptorList.title }/>
<small>{ descriptorList.versionTag }</small>
</span>
) }/>
<Divider/> <Divider/>
<CardContent className={ classes.cardContent }> <CardContent className={ classes.cardContent }>
{ descriptorList.state !== PublishState.PUBLISHED && { descriptorList.state !== PublishState.PUBLISHED &&
......
...@@ -21,7 +21,6 @@ interface IDescriptorListProps extends React.ClassAttributes<any> { ...@@ -21,7 +21,6 @@ interface IDescriptorListProps extends React.ClassAttributes<any> {
uuid: string; uuid: string;
pageTitle: string; pageTitle: string;
navigateTo: (path: string) => void; navigateTo: (path: string) => void;
setPageTitle: (title: string) => void;
t: any; t: any;
loadMyPartners: any; loadMyPartners: any;
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
"admin": { "admin": {
"p": { "p": {
"edit": { "edit": {
"title": "Edit descriptor", "title": "Edit {{title}} descriptor",
"dataPublication": "Data publication", "details": "Descriptor details",
"back": "BACK TO DASHBOARD" "back": "BACK TO DASHBOARD"
} }
}, },
......
...@@ -14,6 +14,7 @@ import PaginationComponent from 'ui/common/pagination'; ...@@ -14,6 +14,7 @@ import PaginationComponent from 'ui/common/pagination';
import DescriptorCard from 'descriptors/ui/c/DescriptorCard'; import DescriptorCard from 'descriptors/ui/c/DescriptorCard';
import DescriptorFilters from 'descriptors/ui/c/Filters'; import DescriptorFilters from 'descriptors/ui/c/Filters';
import PrettyFilters from 'ui/common/filter/PrettyFilters'; import PrettyFilters from 'ui/common/filter/PrettyFilters';
import PageTitle from 'ui/common/PageTitle';
import PageLayout, { PageContents } from 'ui/layout/PageLayout'; import PageLayout, { PageContents } from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader'; import ContentHeader from 'ui/common/heading/ContentHeader';
...@@ -34,8 +35,10 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> { ...@@ -34,8 +35,10 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> {
<PageLayout sidebar={ <PageLayout sidebar={
<DescriptorFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters }/> <DescriptorFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters }/>
}> }>
<ContentHeader title={ t('descriptors.public.p.browse.title') } <PageTitle title={ t('descriptors.public.p.browse.title') }/>
subtitle={ t('descriptors.public.p.browse.subtitle') } <ContentHeader
title={ t('descriptors.public.p.browse.title') }
subtitle={ t('descriptors.public.p.browse.subtitle') }
/> />
<ScrollToTopOnMount/> <ScrollToTopOnMount/>
<PaginationComponent <PaginationComponent
......
...@@ -28,6 +28,7 @@ import DescriptorScale from 'descriptors/ui/c/DescriptorScale'; ...@@ -28,6 +28,7 @@ import DescriptorScale from 'descriptors/ui/c/DescriptorScale';
import BackButton from 'ui/common/buttons/BackButton'; import BackButton from 'ui/common/buttons/BackButton';
import Permissions from 'ui/common/permission/Permissions'; import Permissions from 'ui/common/permission/Permissions';
import PageLayout from 'ui/layout/PageLayout'; import PageLayout from 'ui/layout/PageLayout';
import PageTitle from 'ui/common/PageTitle';
import Grid from '@material-ui/core/Grid'; import Grid from '@material-ui/core/Grid';
import Card, { CardHeader, CardContent, CardActions } from 'ui/common/Card'; import Card, { CardHeader, CardContent, CardActions } from 'ui/common/Card';
...@@ -136,12 +137,13 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> { ...@@ -136,12 +137,13 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
return ( return (
<PageLayout> <PageLayout>
<ScrollToTopOnMount/> <ScrollToTopOnMount/>
<ContentHeaderWithButton title={ t('descriptors.public.p.display.title') } buttons={ <BackButton defaultTarget="/descriptors"/> }/> <PageTitle title={ !stillLoading ? descriptor.title : t('common:label.loading', { what: t('descriptors.public.p.display.title') }) }/>
<ContentHeaderWithButton title={ !stillLoading ? descriptor.title : t('common:label.loading', { what: t('descriptors.public.p.display.title') }) } buttons={ <BackButton defaultTarget="/descriptors"/> }/>
{ stillLoading ? <Loading/> : { stillLoading ? <Loading/> :
<Grid container spacing={ 0 } className="p-10 back-gray"> <Grid container spacing={ 0 } className="p-10 back-gray">
<Grid item xs={ 12 } className="p-10"> <Grid item xs={ 12 } className="p-10">
<Card square> <Card square>
<CardHeader title={ <Markdown basic source={ descriptor.title }/> }/> <CardHeader title={ t('descriptors.public.p.display.title') }/>
<CardContent> <CardContent>
{ descriptor.state !== PublishState.PUBLISHED && <h2>{ t('descriptors.public.p.display.isNotPublishedAlert') }</h2> } { descriptor.state !== PublishState.PUBLISHED && <h2>{ t('descriptors.public.p.display.isNotPublishedAlert') }</h2> }
{ descriptor.key && <h2>{ t('descriptors.public.p.display.keyAlert') }</h2> } { descriptor.key && <h2>{ t('descriptors.public.p.display.keyAlert') }</h2> }
......
...@@ -16,6 +16,7 @@ import Grid from '@material-ui/core/Grid'; ...@@ -16,6 +16,7 @@ import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper'; import Paper from '@material-ui/core/Paper';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton'; import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import BackButton from 'ui/common/buttons/BackButton'; import BackButton from 'ui/common/buttons/BackButton';
import PageTitle from 'ui/common/PageTitle';
interface IDescriptorEditPageProps extends React.ClassAttributes<any> { interface IDescriptorEditPageProps extends React.ClassAttributes<any> {
classes: any; classes: any;
...@@ -74,8 +75,9 @@ class DescriptorEditPage extends React.Component<IDescriptorEditPageProps, any> ...@@ -74,8 +75,9 @@ class DescriptorEditPage extends React.Component<IDescriptorEditPageProps, any>
return ( return (
<div> <div>
<PageTitle title={ t('descriptors.admin.p.edit.title', {title: descriptor ? descriptor.title : ''}) }/>
<ContentHeaderWithButton <ContentHeaderWithButton
title={ t('descriptors.admin.p.edit.dataPublication') } title={ t('descriptors.admin.p.edit.title', {title: descriptor ? descriptor.title : ''}) }
buttons={ buttons={
<BackButton <BackButton
defaultTarget="/dashboard/descriptors" defaultTarget="/dashboard/descriptors"
...@@ -89,7 +91,7 @@ class DescriptorEditPage extends React.Component<IDescriptorEditPageProps, any> ...@@ -89,7 +91,7 @@ class DescriptorEditPage extends React.Component<IDescriptorEditPageProps, any>
<Paper className="p-20"> <Paper className="p-20">
<DescriptorForm <DescriptorForm
initialValues={ descriptor } initialValues={ descriptor }
pageTitle={ t('descriptors.admin.p.edit.title') } pageTitle={ t('descriptors.admin.p.edit.details') }
onPublish={ this.onPublish } onPublish={ this.onPublish }
onSubmit={ this.onSave } onSubmit={ this.onSave }
/> />
......
...@@ -22,7 +22,6 @@ import Button from '@material-ui/core/Button'; ...@@ -22,7 +22,6 @@ import Button from '@material-ui/core/Button';
import { Toggle } from 'ui/common/forms'; import { Toggle } from 'ui/common/forms';
import Grid from '@material-ui/core/Grid'; import Grid from '@material-ui/core/Grid';
import { setPageTitle } from 'actions/pageTitle';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import RadioSelection from 'ui/common/forms/RadioSelection'; import RadioSelection from 'ui/common/forms/RadioSelection';
import withStyles from '@material-ui/core/styles/withStyles'; import withStyles from '@material-ui/core/styles/withStyles';
...@@ -42,12 +41,6 @@ const styles = (theme) => ({ ...@@ -42,12 +41,6 @@ const styles = (theme) => ({
class DescriptorForm extends React.Component<any, any> { class DescriptorForm extends React.Component<any, any> {
public constructor(props: any) {
super(props);
const { setPageTitle, pageTitle } = this.props;
setPageTitle(pageTitle);
}
private requiresMaxValue = () => { private requiresMaxValue = () => {
const { dataType } = this.props; const { dataType } = this.props;
return dataType === 'SCALE'; return dataType === 'SCALE';
...@@ -267,7 +260,7 @@ const mapStateToProps = (state, ownProps) => ({ ...@@ -267,7 +260,7 @@ const mapStateToProps = (state, ownProps) => ({
}); });
const mapDispatchToProps = (dispatch) => bindActionCreators({ const mapDispatchToProps = (dispatch) => bindActionCreators({
setPageTitle, // none
}, dispatch); }, dispatch);
export default translate()(connect(mapStateToProps, mapDispatchToProps)( export default translate()(connect(mapStateToProps, mapDispatchToProps)(
......
...@@ -20,6 +20,7 @@ import ContentHeader from 'ui/common/heading/ContentHeader'; ...@@ -20,6 +20,7 @@ import ContentHeader from 'ui/common/heading/ContentHeader';
import LocationMap from 'ui/common/LocationMap'; import LocationMap from 'ui/common/LocationMap';
import Loading from 'ui/common/Loading'; import Loading from 'ui/common/Loading';
import Number from 'ui/common/Number'; import Number from 'ui/common/Number';
import PageTitle from 'ui/common/PageTitle';
interface ICountryDisplayPageProps extends React.ClassAttributes<any> { interface ICountryDisplayPageProps extends React.ClassAttributes<any> {
details: CountryDetails; details: CountryDetails;
...@@ -78,6 +79,7 @@ class CountryDisplayPage extends React.Component<ICountryDisplayPageProps> { ...@@ -78,6 +79,7 @@ class CountryDisplayPage extends React.Component<ICountryDisplayPageProps> {
return ( return (
<PageLayout> <PageLayout>
<PageTitle title={ `${t('geo.public.p.countryList.countryProfile', { code: isoCode }) }` } />
<ContentHeader title={ `${t('geo.public.p.countryList.countryProfile', { code: isoCode }) }` }/> <ContentHeader title={ `${t('geo.public.p.countryList.countryProfile', { code: isoCode }) }` }/>
<div> <div>
{ stillLoading ? <Loading /> : { stillLoading ? <Loading /> :
......
...@@ -15,6 +15,7 @@ import ContentHeader from 'ui/common/heading/ContentHeader'; ...@@ -15,6 +15,7 @@ import ContentHeader from 'ui/common/heading/ContentHeader';
import GridContainer from 'ui/layout/GridContainer'; import GridContainer from 'ui/layout/GridContainer';
import CountryCard from 'geo/ui/c/CountryCard'; import CountryCard from 'geo/ui/c/CountryCard';
import Loading from 'ui/common/Loading'; import Loading from 'ui/common/Loading';
import PageTitle from 'ui/common/PageTitle';
interface ICountryListPageProps extends React.ClassAttributes<any> { interface ICountryListPageProps extends React.ClassAttributes<any> {
t: any; t: any;
...@@ -46,6 +47,7 @@ class CountryListPage extends React.Component<ICountryListPageProps> { ...@@ -46,6 +47,7 @@ class CountryListPage extends React.Component<ICountryListPageProps> {
return ( return (
<PageLayout> <PageLayout>
<PageTitle title={ t(`geo.public.p.countryList.title`) }/>
<ContentHeader <ContentHeader
title={ t(`geo.public.p.countryList.title`) } title={ t(`geo.public.p.countryList.title`) }
subTitle={ t(`geo.public.p.countryList.subTitle`) } subTitle={ t(`geo.public.p.countryList.subTitle`) }
......
...@@ -21,6 +21,7 @@ import Loading from 'ui/common/Loading'; ...@@ -21,6 +21,7 @@ import Loading from 'ui/common/Loading';
import GeoRegionCard from 'geo/ui/c/GeoRegionCard'; import GeoRegionCard from 'geo/ui/c/GeoRegionCard';
import CountryCard from 'geo/ui/c/CountryCard'; import CountryCard from 'geo/ui/c/CountryCard';
import ActionButton from 'ui/common/buttons/ActionButton'; import ActionButton from 'ui/common/buttons/ActionButton';
import PageTitle from 'ui/common/PageTitle';
interface IRegionDisplayPageProps extends React.ClassAttributes<any> { interface IRegionDisplayPageProps extends React.ClassAttributes<any> {
details: RegionDetails; details: RegionDetails;
...@@ -63,6 +64,7 @@ class RegionDisplayPage extends React.Component<IRegionDisplayPageProps> { ...@@ -63,6 +64,7 @@ class RegionDisplayPage extends React.Component<IRegionDisplayPageProps> {
return ( return (
<PageLayout> <PageLayout>
<PageTitle title={ details && details.name ? details.name : '' } />
<ContentHeader title={ details && details.name ? details.name : '' } /> <ContentHeader title={ details && details.name ? details.name : '' } />
{ stillLoading ? <Loading /> : { stillLoading ? <Loading /> :
<div> <div>
......
...@@ -15,6 +15,7 @@ import ContentHeader from 'ui/common/heading/ContentHeader'; ...@@ -15,6 +15,7 @@ import ContentHeader from 'ui/common/heading/ContentHeader';
import GridContainer from 'ui/layout/GridContainer'; import GridContainer from 'ui/layout/GridContainer';
import Loading from 'ui/common/Loading'; import Loading from 'ui/common/Loading';
import GeoRegionCard from 'geo/ui/c/GeoRegionCard'; import GeoRegionCard from 'geo/ui/c/GeoRegionCard';
import PageTitle from 'ui/common/PageTitle';
interface IRegionListPageProps extends React.ClassAttributes<any> { interface IRegionListPageProps extends React.ClassAttributes<any> {
t: any; t: any;
...@@ -46,6 +47,7 @@ class RegionListPage extends React.Component<IRegionListPageProps> { ...@@ -46,6 +47,7 @@ class RegionListPage extends React.Component<IRegionListPageProps> {
return ( return (
<PageLayout> <PageLayout>
<PageTitle title={ t(`geo.public.p.regionList.title`) }/>
<ContentHeader <ContentHeader
title={ t(`geo.public.p.regionList.title`) } title={ t(`geo.public.p.regionList.title`) }
subTitle={ t(`geo.public.p.regionList.subTitle`) } subTitle={ t(`geo.public.p.regionList.subTitle`) }
......
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
} }
}, },
"dashboard": { "dashboard": {
"p": {
"edit": {
"title": "Edit {{instName}}"
}
},
"c": { "c": {
"form": { "form": {
"gaTracker": "GA Tracker code", "gaTracker": "GA Tracker code",
......
...@@ -17,6 +17,7 @@ import Loading from 'ui/common/Loading'; ...@@ -17,6 +17,7 @@ import Loading from 'ui/common/Loading';
import PagedLoader from 'ui/common/PagedLoader'; import PagedLoader from 'ui/common/PagedLoader';
import PrettyFilters from 'ui/common/filter/PrettyFilters'; import PrettyFilters from 'ui/common/filter/PrettyFilters';
import PaginationComponent from 'ui/common/pagination'; import PaginationComponent from 'ui/common/pagination';
import PageTitle from 'ui/common/PageTitle';
import InstituteCard from 'institutes/ui/с/InstituteCard'; import InstituteCard from 'institutes/ui/с/InstituteCard';
import InstituteFilters from './с/Filters'; import InstituteFilters from './с/Filters';
...@@ -38,6 +39,7 @@ class BrowsePage extends BrowsePageTemplate<FaoInstitute> { ...@@ -38,6 +39,7 @@ class BrowsePage extends BrowsePageTemplate<FaoInstitute> {
<InstituteFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters } t={ t } /> <InstituteFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters } t={ t } />
}> }>
<PageTitle title={ t('institutes.public.p.browse.title') }/>
<ContentHeader title={ t('institutes.public.p.browse.title') } subTitle={ t('institutes.public.p.browse.subTitle') } /> <ContentHeader title={ t('institutes.public.p.browse.title') } subTitle={ t('institutes.public.p.browse.subTitle') } />
<PaginationComponent <PaginationComponent
......
...@@ -33,6 +33,7 @@ import Permissions from 'ui/common/permission/Permissions'; ...@@ -33,6 +33,7 @@ import Permissions from 'ui/common/permission/Permissions';
import FaoInstitute from 'model/genesys/FaoInstitute'; import FaoInstitute from 'model/genesys/FaoInstitute';
import ButtonBar from 'ui/common/buttons/ButtonBar'; import ButtonBar from 'ui/common/buttons/ButtonBar';
import DownloadDialog from 'ui/common/download-dialog'; import DownloadDialog from 'ui/common/download-dialog';
import PageTitle from 'ui/common/PageTitle';
interface IDisplayPageProps extends React.ClassAttributes<any> { interface IDisplayPageProps extends React.ClassAttributes<any> {
t: any; t: any;
...@@ -127,7 +128,8 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> { ...@@ -127,7 +128,8 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
return ( return (
<PageLayout withFooter> <PageLayout withFooter>
<ScrollToTopOnMount /> <ScrollToTopOnMount />
<ContentHeader title={ t('institutes.public.p.display.title') }/> <PageTitle title={ !stillLoading ? institute.details.fullName || institute.details.code : t('common:label.loading', { what: t('institutes.public.p.display.title') }) } />
<ContentHeader title={ !stillLoading ? institute.details.fullName || institute.details.code : t('common:label.loading', { what: t('institutes.public.p.display.title') }) } />
{ stillLoading ? <Loading /> : { stillLoading ? <Loading /> :
<div> <div>
...@@ -135,7 +137,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> { ...@@ -135,7 +137,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
{ institute && { institute &&
<PageContents className="pt-1rem"> <PageContents className="pt-1rem">
<MainSection title={ `${institute.details.fullName}` }> <MainSection title={ t('institutes.public.p.display.title') }>
<Properties> <Properties>
<PropertiesItem title={ t('institutes.common.instituteCode') }>{ institute.details.code }</PropertiesItem> <PropertiesItem title={ t('institutes.common.instituteCode') }>{ institute.details.code }</PropertiesItem>
<PropertiesItem title={ t('institutes.public.p.display.type') }>{ institute.details.type }</PropertiesItem> <PropertiesItem title={ t('institutes.public.p.display.type') }>{ institute.details.type }</PropertiesItem>
......
...@@ -13,6 +13,8 @@ import { PageContents } from 'ui/layout/PageLayout'; ...@@ -13,6 +13,8 @@ import { PageContents } from 'ui/layout/PageLayout';
import Grid from '@material-ui/core/Grid'; import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper'; import Paper from '@material-ui/core/Paper';
import InstituteForm from './c/InstituteForm'; import InstituteForm from './c/InstituteForm';
import ContentHeader from 'ui/common/heading/ContentHeader';
import PageTitle from 'ui/common/PageTitle';
interface IInstituteEditPageProps extends React.ClassAttributes<any> { interface IInstituteEditPageProps extends React.ClassAttributes<any> {
t: any; t: any;
...@@ -66,23 +68,27 @@ class InstituteEditPage extends React.Component<IInstituteEditPageProps, any> { ...@@ -66,23 +68,27 @@ class InstituteEditPage extends React.Component<IInstituteEditPageProps, any> {
} }
return ( return (
<PageContents className="pt-1rem"> <div>
<Grid item xs={ 12 }> <PageTitle title={ t('institutes.dashboard.p.edit.title', {instName: institute && institute.fullName || wiewsCode || t('institutes.common.modelName') }) } />
<Paper className="p-20 mb-10"> <ContentHeader title={ t('institutes.dashboard.p.edit.title', {instName: institute && institute.fullName || wiewsCode || t('institutes.common.modelName') }) }/>
<InstituteForm <PageContents className="pt-1rem">
wiewsCode={ wiewsCode } <Grid item xs={ 12 }>
initialValues={ { <Paper className="p-20 mb-10">
settings: institute.settings, <InstituteForm
codeSGSV: institute.codeSGSV, wiewsCode={ wiewsCode }
uniqueAcceNumbs: `${institute.uniqueAcceNumbs}`, initialValues={ {
allowMaterialRequests: `${institute.allowMaterialRequests}`, settings: institute.settings,
} } codeSGSV: institute.codeSGSV,
onSubmit={ this.onSave } uniqueAcceNumbs: `${institute.uniqueAcceNumbs}`,
t={ t } allowMaterialRequests: `${institute.allowMaterialRequests}`,
/> } }
</Paper> onSubmit={ this.onSave }
</Grid> t={ t }
</PageContents> />
</Paper>
</Grid>
</PageContents>
</div>
); );
} }
......
...@@ -18,6 +18,7 @@ import { PageContents } from 'ui/layout/PageLayout'; ...@@ -18,6 +18,7 @@ import { PageContents } from 'ui/layout/PageLayout';
import Loading from 'ui/common/Loading'; import Loading from 'ui/common/Loading';
// import PagedLoader from 'ui/common/PagedLoader'; // import PagedLoader from 'ui/common/PagedLoader';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton'; import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import PageTitle from 'ui/common/PageTitle';
import Grid from '@material-ui/core/Grid'; import Grid from '@material-ui/core/Grid';
import ParameterDialog from './ParameterDialog'; import ParameterDialog from './ParameterDialog';
import DimensionDialog from './DimensionDialog'; import DimensionDialog from './DimensionDialog';
...@@ -68,6 +69,7 @@ class Dashboard extends React.Component<IDashboardProps, any> { ...@@ -68,6 +69,7 @@ class Dashboard extends React.Component<IDashboardProps, any> {
return ( return (
<div> <div>
<PageTitle title={ t(`kpi.admin.p.dashboard.title`) }/>
<ContentHeaderWithButton title={ t(`kpi.admin.p.dashboard.title`) } buttons={ <div> <ContentHeaderWithButton title={ t(`kpi.admin.p.dashboard.title`) } buttons={ <div>
<ParameterDialog/> <ParameterDialog/>
<DimensionDialog/> <DimensionDialog/>
......
...@@ -2,6 +2,8 @@ import * as React from 'react'; ...@@ -2,6 +2,8 @@ import * as React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { translate } from 'react-i18next'; import { translate } from 'react-i18next';
import withStyles from '@material-ui/core/styles/withStyles';
// Actions // Actions
import { deleteExecution, executeExecution, getExecution, listDimensions, listParameters, loadMoreExecutionRuns } from 'kpi/actions/admin'; import { deleteExecution, executeExecution, getExecution, listDimensions, listParameters, loadMoreExecutionRuns } from 'kpi/actions/admin';
import { showSnackbar } from 'actions/snackbar'; import { showSnackbar } from 'actions/snackbar';
...@@ -23,8 +25,8 @@ import Button from '@material-ui/core/Button'; ...@@ -23,8 +25,8 @@ import Button from '@material-ui/core/Button';
import RunTable from './c/RunTable'; import RunTable from './c/RunTable';
import ExecutionDialog from './ExecutionDialog'; import ExecutionDialog from './ExecutionDialog';
import FileCopyIcon from '@material-ui/icons/FileCopy'; import FileCopyIcon from '@material-ui/icons/FileCopy';
import PageTitle from 'ui/common/PageTitle';
import DateInput from './c/DateInput'; import DateInput from './c/DateInput';
import withStyles from '@material-ui/core/styles/withStyles';