Skip to content

Commit 4c01f2d

Browse files
committed
add(tab titles): added unique tab titles for each page in backoffice
1 parent 24ad286 commit 4c01f2d

36 files changed

Lines changed: 948 additions & 693 deletions

File tree

src/lib/pages/backoffice/Acquisition/Order/OrderDetails/OrderDetails.js

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { OrderStatistics } from './OrderStatistics';
3535
import { PaymentInformation } from '@components/backoffice/PaymentInformation';
3636
import { OrderSteps } from './OrderSteps';
3737
import Overridable from 'react-overridable';
38+
import { Helmet } from 'react-helmet-async';
3839

3940
class OrderHeader extends React.Component {
4041
renderStatus(status) {
@@ -207,45 +208,51 @@ export default class OrderDetails extends React.Component {
207208
}
208209

209210
render() {
210-
const { isLoading, error, data } = this.props;
211+
const { isLoading, error, data, match } = this.props;
212+
const orderPid = match.params.orderPid;
211213
const metadata = data.metadata || {};
212214
return (
213-
<div ref={this.headerRef}>
214-
<Container fluid>
215-
<Loader isLoading={isLoading}>
216-
<Error error={error}>
217-
<Sticky context={this.headerRef} className="solid-background">
218-
<Container fluid className="spaced">
219-
<OrderHeader data={data} />
220-
</Container>
221-
<Divider />
222-
</Sticky>
215+
<>
216+
<Helmet>
217+
<title>{`Order - ${orderPid ?? ''}`}</title>
218+
</Helmet>
219+
<div ref={this.headerRef}>
220+
<Container fluid>
221+
<Loader isLoading={isLoading}>
222+
<Error error={error}>
223+
<Sticky context={this.headerRef} className="solid-background">
224+
<Container fluid className="spaced">
225+
<OrderHeader data={data} />
226+
</Container>
227+
<Divider />
228+
</Sticky>
223229

224-
<Container fluid>
225-
<Ref innerRef={this.menuRef}>
226-
<Grid columns={2}>
227-
<Grid.Column width={13}>
228-
<Container className="spaced">
230+
<Container fluid>
231+
<Ref innerRef={this.menuRef}>
232+
<Grid columns={2}>
233+
<Grid.Column width={13}>
229234
<Container className="spaced">
230-
<OrderStatistics order={metadata} />
231-
<br />
232-
<OrderSteps order={metadata} />
235+
<Container className="spaced">
236+
<OrderStatistics order={metadata} />
237+
<br />
238+
<OrderSteps order={metadata} />
239+
</Container>
240+
<OrderPanels data={data} />
233241
</Container>
234-
<OrderPanels data={data} />
235-
</Container>
236-
</Grid.Column>
237-
<Grid.Column width={3}>
238-
<Sticky context={this.menuRef} offset={150}>
239-
<ActionMenu data={metadata} offset={-150} />
240-
</Sticky>
241-
</Grid.Column>
242-
</Grid>
243-
</Ref>
244-
</Container>
245-
</Error>
246-
</Loader>
247-
</Container>
248-
</div>
242+
</Grid.Column>
243+
<Grid.Column width={3}>
244+
<Sticky context={this.menuRef} offset={150}>
245+
<ActionMenu data={metadata} offset={-150} />
246+
</Sticky>
247+
</Grid.Column>
248+
</Grid>
249+
</Ref>
250+
</Container>
251+
</Error>
252+
</Loader>
253+
</Container>
254+
</div>
255+
</>
249256
);
250257
}
251258
}

src/lib/pages/backoffice/Acquisition/Order/OrderEditor/OrderEditor.js

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import PropTypes from 'prop-types';
1717
import React, { Component } from 'react';
1818
import { schema } from './schema';
1919
import { uiSchema } from './uiSchema';
20+
import { Helmet } from 'react-helmet-async';
2021

2122
export class OrderEditor extends Component {
2223
constructor(props) {
@@ -126,31 +127,41 @@ export class OrderEditor extends Component {
126127
if (isEditing) {
127128
const formTitle = `Acquisition order - Edit #${orderPid}`;
128129
return (
129-
<Loader isLoading={isLoading}>
130-
<Error error={error}>
131-
<RJSForm
132-
schema={schema()}
133-
uiSchema={uiSchema(formTitle)}
134-
formData={data.metadata}
135-
submitAction={this.submitAction}
136-
successCallback={this.successCallback}
137-
successMessage="The acquisition order was successfully updated."
138-
/>
139-
</Error>
140-
</Loader>
130+
<>
131+
<Helmet>
132+
<title>{`Edit order - ${orderPid ?? ''}`}</title>
133+
</Helmet>
134+
<Loader isLoading={isLoading}>
135+
<Error error={error}>
136+
<RJSForm
137+
schema={schema()}
138+
uiSchema={uiSchema(formTitle)}
139+
formData={data.metadata}
140+
submitAction={this.submitAction}
141+
successCallback={this.successCallback}
142+
successMessage="The acquisition order was successfully updated."
143+
/>
144+
</Error>
145+
</Loader>
146+
</>
141147
);
142148
} else {
143149
const formTitle = 'Acquisition order - Create';
144150
const prefilledFormData = _get(this.props, 'location.state.formData', {});
145151
return (
146-
<RJSForm
147-
schema={schema()}
148-
uiSchema={uiSchema(formTitle)}
149-
formData={prefilledFormData}
150-
submitAction={this.submitAction}
151-
successCallback={this.successCallback}
152-
successMessage="The acquisition order was successfully created."
153-
/>
152+
<>
153+
<Helmet>
154+
<title>{`Edit order - ${orderPid ?? ''}`}</title>
155+
</Helmet>
156+
<RJSForm
157+
schema={schema()}
158+
uiSchema={uiSchema(formTitle)}
159+
formData={prefilledFormData}
160+
submitAction={this.submitAction}
161+
successCallback={this.successCallback}
162+
successMessage="The acquisition order was successfully created."
163+
/>
164+
</>
154165
);
155166
}
156167
}

src/lib/pages/backoffice/Acquisition/Order/OrderSearch/OrderSearch.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
SearchBar,
3434
} from 'react-searchkit';
3535
import { Container, Grid, Header } from 'semantic-ui-react';
36+
import { Helmet } from 'react-helmet-async';
3637

3738
class OrderResponseSerializer {
3839
serialize(results) {
@@ -85,6 +86,9 @@ export class OrderSearch extends Component {
8586
const urlHandler = setReactSearchKitUrlHandler(this.modelName);
8687
return (
8788
<>
89+
<Helmet>
90+
<title>Purchase orders</title>
91+
</Helmet>
8892
<Header as="h2">Purchase Orders</Header>
8993
<OverridableContext.Provider
9094
value={{

src/lib/pages/backoffice/Actions/CheckIn/CheckIn.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ import React, { Component } from 'react';
77
import { Header } from 'semantic-ui-react';
88
import { ItemsSearch } from './ItemsSearch';
99
import { CheckedInItems } from './CheckedInItems';
10+
import { Helmet } from 'react-helmet-async';
1011

1112
export default class CheckIn extends Component {
1213
render() {
1314
return (
1415
<>
16+
<Helmet>
17+
<title>Check-in</title>
18+
</Helmet>
1519
<Header as="h2">Check-in physical copies</Header>
1620
<ItemsSearch />
1721
<CheckedInItems />

src/lib/pages/backoffice/Actions/CheckOut/CheckOut.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ import React, { Component } from 'react';
77
import { CheckOutSearch } from './CheckOutSearch';
88
import { CheckOutResults } from './CheckOutResults';
99
import { Header } from 'semantic-ui-react';
10+
import { Helmet } from 'react-helmet-async';
1011

1112
export class CheckOut extends Component {
1213
render() {
1314
return (
1415
<>
16+
<Helmet>
17+
<title>Check-out</title>
18+
</Helmet>
1519
<Header as="h2">Check-out physical copies</Header>
1620
<CheckOutSearch />
1721
<CheckOutResults />

src/lib/pages/backoffice/Document/DocumentDetails/DocumentDetails.js

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { DocumentMetadata } from './DocumentMetadata';
1313
import { DocumentSummary } from './DocumentSummary';
1414
import { DocumentContent } from './DocumentContent';
1515
import { DocumentHeader } from './DocumentHeader';
16+
import { Helmet } from 'react-helmet-async';
1617

1718
export default class DocumentDetails extends Component {
1819
constructor(props) {
@@ -57,48 +58,53 @@ export default class DocumentDetails extends Component {
5758
render() {
5859
const { isLoading, error, data } = this.props;
5960
return (
60-
<div ref={this.headerRef}>
61-
<Container fluid>
62-
<Loader isLoading={isLoading}>
63-
<Error error={error}>
64-
<Sticky context={this.headerRef} className="solid-background">
65-
<Container fluid className="spaced">
66-
<DocumentHeader data={data} />
67-
</Container>
68-
<Divider />
69-
</Sticky>
70-
<Container fluid>
71-
<Ref innerRef={this.menuRef}>
72-
<Grid columns={2}>
73-
<Grid.Column width={13}>
74-
<Container className="spaced">
61+
<>
62+
<Helmet>
63+
<title>{`Document - ${data.metadata?.title ?? ''}`}</title>
64+
</Helmet>
65+
<div ref={this.headerRef}>
66+
<Container fluid>
67+
<Loader isLoading={isLoading}>
68+
<Error error={error}>
69+
<Sticky context={this.headerRef} className="solid-background">
70+
<Container fluid className="spaced">
71+
<DocumentHeader data={data} />
72+
</Container>
73+
<Divider />
74+
</Sticky>
75+
<Container fluid>
76+
<Ref innerRef={this.menuRef}>
77+
<Grid columns={2}>
78+
<Grid.Column width={13}>
7579
<Container className="spaced">
76-
<div
77-
ref={this.anchors.summaryRef}
78-
id="document-summary"
79-
>
80-
<DocumentSummary
81-
anchors={this.anchors}
82-
document={data}
83-
/>
84-
</div>
80+
<Container className="spaced">
81+
<div
82+
ref={this.anchors.summaryRef}
83+
id="document-summary"
84+
>
85+
<DocumentSummary
86+
anchors={this.anchors}
87+
document={data}
88+
/>
89+
</div>
90+
</Container>
91+
<DocumentMetadata anchors={this.anchors} />
92+
<DocumentContent anchors={this.anchors} data={data} />
8593
</Container>
86-
<DocumentMetadata anchors={this.anchors} />
87-
<DocumentContent anchors={this.anchors} data={data} />
88-
</Container>
89-
</Grid.Column>
90-
<Grid.Column width={3}>
91-
<Sticky context={this.menuRef} offset={200}>
92-
<DocumentActionMenu offset={-250} />
93-
</Sticky>
94-
</Grid.Column>
95-
</Grid>
96-
</Ref>
97-
</Container>
98-
</Error>
99-
</Loader>
100-
</Container>
101-
</div>
94+
</Grid.Column>
95+
<Grid.Column width={3}>
96+
<Sticky context={this.menuRef} offset={200}>
97+
<DocumentActionMenu offset={-250} />
98+
</Sticky>
99+
</Grid.Column>
100+
</Grid>
101+
</Ref>
102+
</Container>
103+
</Error>
104+
</Loader>
105+
</Container>
106+
</div>
107+
</>
102108
);
103109
}
104110
}

src/lib/pages/backoffice/Document/DocumentEditor/DocumentEditor.js

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import PropTypes from 'prop-types';
1717
import React, { Component } from 'react';
1818
import { schema } from './schema';
1919
import { uiSchema } from './uiSchema';
20+
import { Helmet } from 'react-helmet-async';
2021

2122
export class DocumentEditor extends Component {
2223
constructor(props) {
@@ -140,31 +141,43 @@ export class DocumentEditor extends Component {
140141
}
141142

142143
return (
143-
<Loader isLoading={isLoading}>
144-
<Error error={error}>
145-
<RJSForm
146-
schema={schema()}
147-
uiSchema={uiSchema(formTitle, { tooManyAuthors: tooManyAuthors })}
148-
formData={data.metadata}
149-
submitAction={this.submitAction}
150-
successCallback={this.successCallback}
151-
successMessage="The document was successfully updated."
152-
/>
153-
</Error>
154-
</Loader>
144+
<>
145+
<Helmet>
146+
<title>{`Edit document - ${documentPid ?? ''}`}</title>
147+
</Helmet>
148+
<Loader isLoading={isLoading}>
149+
<Error error={error}>
150+
<RJSForm
151+
schema={schema()}
152+
uiSchema={uiSchema(formTitle, {
153+
tooManyAuthors: tooManyAuthors,
154+
})}
155+
formData={data.metadata}
156+
submitAction={this.submitAction}
157+
successCallback={this.successCallback}
158+
successMessage="The document was successfully updated."
159+
/>
160+
</Error>
161+
</Loader>
162+
</>
155163
);
156164
} else {
157165
const formTitle = 'Document - Create';
158166
const prefilledFormData = _get(this.props, 'location.state.formData', {});
159167
return (
160-
<RJSForm
161-
schema={schema()}
162-
uiSchema={uiSchema(formTitle)}
163-
formData={prefilledFormData}
164-
submitAction={this.submitAction}
165-
successCallback={this.successCallback}
166-
successMessage="The document was successfully created."
167-
/>
168+
<>
169+
<Helmet>
170+
<title>{`Edit location - ${data.metadata?.title ?? ''}`}</title>
171+
</Helmet>
172+
<RJSForm
173+
schema={schema()}
174+
uiSchema={uiSchema(formTitle)}
175+
formData={prefilledFormData}
176+
submitAction={this.submitAction}
177+
successCallback={this.successCallback}
178+
successMessage="The document was successfully created."
179+
/>
180+
</>
168181
);
169182
}
170183
}

0 commit comments

Comments
 (0)