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
......@@ -30,7 +30,7 @@
"p": {
"browse": {
"create": "Create vocabulary",
"title": "What do you want to do?",
"title": "Browse vocabularies",
"update": "Update vocabularies"
},
"display": {
......@@ -40,6 +40,10 @@
"term": "Term",
"terms": "terms",
"title": "Vocabulary details"
},
"edit": {
"title": "{{code}} vocabulary edit",
"titleCreate": "Create vocabulary"
}
}
},
......
......@@ -21,6 +21,7 @@ import VocabularyFilter from 'model/vocabulary/VocabularyFilter';
import PagedLoader from 'ui/common/PagedLoader';
import BrowsePageTemplate from 'ui/pages/_base/BrowsePage';
import { PageContents } from 'ui/layout/PageLayout';
import PageTitle from 'ui/common/PageTitle';
const styles = (theme) => ({
root: {
......@@ -51,6 +52,7 @@ class BrowsePage extends BrowsePageTemplate<Vocabulary> {
return (
<div>
<PageTitle title={ t('vocabulary.admin.p.browse.title') }/>
<Authorize role="ROLE_ADMINISTRATOR">
<ContentHeaderWithButton
title={ t('vocabulary.admin.p.browse.title') }
......
......@@ -25,6 +25,7 @@ import VocabularyTerm from 'model/vocabulary/VocabularyTerm';
import Vocabulary from 'model/vocabulary/Vocabulary';
import VocabularyTermCard from './c/VocabularyTermCard';
import PagedLoader from 'ui/common/PagedLoader';
import PageTitle from 'ui/common/PageTitle';
interface IDisplayPageProps extends React.ClassAttributes<any> {
classes: any;
......@@ -94,16 +95,16 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
return (
<PageLayout classes={ {root: classes.pageLayout} }>
<ContentHeaderWithButton title={ t('vocabulary.admin.p.display.title') }
buttons={ <BackButton defaultTarget="/vocabulary"/> }/>
<PageTitle title={ !stillLoading ? `${vocabulary.title}#${vocabulary.versionTag}` : t('common:label.loading', { what: t('vocabulary.admin.p.display.title') }) }/>
<ContentHeaderWithButton
title={ !stillLoading ? `${vocabulary.title}#${vocabulary.versionTag}` : t('common:label.loading', { what: t('vocabulary.admin.p.display.title') }) }
buttons={ <BackButton defaultTarget="/vocabulary"/> }
/>
{ stillLoading ? <Loading/> :
<Grid container className={ classes.contentContainer }>
<Grid item xs={ 12 }>
<Card className={ classes.card } square>
<CardHeader className={ classes.cardHeader } title={ (
<span>{ vocabulary.title }
<small>{ vocabulary.versionTag }</small></span>
) }/>
<CardHeader className={ classes.cardHeader } title={ t('vocabulary.admin.p.display.title') }/>
<CardContent className={ classes.cardContent }>
{ vocabulary.description && <Markdown source={ vocabulary.description }/> }
......
......@@ -16,6 +16,8 @@ import Vocabulary from 'model/vocabulary/Vocabulary';
import Partner from 'model/genesys/Partner';
import VocabularyForm from './c/VocabularyForm';
import ContentHeader from 'ui/common/heading/ContentHeader';
import PageTitle from 'ui/common/PageTitle';
interface IVocabularyEditPageProps extends React.ClassAttributes<any> {
classes: any;
......@@ -93,7 +95,7 @@ class VocabularyEditPage extends React.Component<IVocabularyEditPageProps, any>
}
public render() {
const { uuid, myPartners } = this.props;
const { uuid, myPartners, t } = this.props;
let { vocabulary } = this.props;
......@@ -108,6 +110,8 @@ class VocabularyEditPage extends React.Component<IVocabularyEditPageProps, any>
return vocabulary && (
<div>
<PageTitle title={ uuid && vocabulary ? t('vocabulary.admin.p.edit.title', {code: vocabulary.title}) : t('vocabulary.admin.p.edit.titleCreate') }/>
<ContentHeader title={ uuid && vocabulary ? t('vocabulary.admin.p.edit.title', {code: vocabulary.title}) : t('vocabulary.admin.p.edit.titleCreate') }/>
<Grid item xs={ 12 }>
<VocabularyForm initialValues={ vocabulary } partners={ myPartners } onSubmit={ this.onSave } onDelete={ this.onDelete }/>
</Grid>
......
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