Added hash history to job detail page.
This commit is contained in:
@@ -13,7 +13,10 @@ export default function JobDetailCardsNotesComponent({ loading, data }) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CardTemplate loading={loading} title={t("jobs.labels.cards.notes")}>
|
<CardTemplate
|
||||||
|
loading={loading}
|
||||||
|
title={t("jobs.labels.cards.notes")}
|
||||||
|
extraLink={`/manage/jobs/${data.id}#notes`}>
|
||||||
{data ? (
|
{data ? (
|
||||||
<Container>
|
<Container>
|
||||||
<List
|
<List
|
||||||
|
|||||||
@@ -53,7 +53,10 @@ export default withRouter(function JobsList({
|
|||||||
{record.ownr_fn} {record.ownr_ln}
|
{record.ownr_fn} {record.ownr_ln}
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
t("jobs.errors.noowner")
|
// t("jobs.errors.noowner")
|
||||||
|
<span>
|
||||||
|
{record.ownr_fn} {record.ownr_ln}
|
||||||
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useQuery } from "@apollo/react-hooks";
|
import { useQuery } from "@apollo/react-hooks";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import AlertComponent from "../../components/alert/alert.component";
|
import AlertComponent from "../../components/alert/alert.component";
|
||||||
import SpinComponent from "../../components/loading-spinner/loading-spinner.component";
|
import SpinComponent from "../../components/loading-spinner/loading-spinner.component";
|
||||||
@@ -25,7 +25,13 @@ function JobsDetailPageContainer({ match, location }) {
|
|||||||
|
|
||||||
if (loading) return <SpinComponent />;
|
if (loading) return <SpinComponent />;
|
||||||
if (error) return <AlertComponent message={error.message} type='error' />;
|
if (error) return <AlertComponent message={error.message} type='error' />;
|
||||||
|
return (
|
||||||
return <JobsDetailPage hash={hash} data={data} jobId={jobId} match={match} />;
|
<JobsDetailPage
|
||||||
|
hash={hash ? hash.substring(1) : "#lines"}
|
||||||
|
data={data}
|
||||||
|
jobId={jobId}
|
||||||
|
match={match}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
export default JobsDetailPageContainer;
|
export default JobsDetailPageContainer;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Icon, Row, Tabs } from "antd";
|
import { Icon, Row, Tabs } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { withRouter } from "react-router-dom";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import JobLinesContainer from "../../components/job-lines/job-lines.container.component";
|
import JobLinesContainer from "../../components/job-lines/job-lines.container.component";
|
||||||
import JobTombstone from "../../components/job-tombstone/job-tombstone.component";
|
import JobTombstone from "../../components/job-tombstone/job-tombstone.component";
|
||||||
@@ -7,7 +8,7 @@ import JobsDocumentsContainer from "../../components/jobs-documents/jobs-documen
|
|||||||
import { FaRegStickyNote } from "react-icons/fa";
|
import { FaRegStickyNote } from "react-icons/fa";
|
||||||
import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container";
|
import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container";
|
||||||
|
|
||||||
function JobsDetailPage({ jobId, hash, data, match }) {
|
function JobsDetailPage({ jobId, hash, data, match, history }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -16,7 +17,11 @@ function JobsDetailPage({ jobId, hash, data, match }) {
|
|||||||
<JobTombstone job={data.jobs_by_pk} />
|
<JobTombstone job={data.jobs_by_pk} />
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Tabs defaultActiveKey={hash ? hash : "#lines"}>
|
<Tabs
|
||||||
|
defaultActiveKey={hash}
|
||||||
|
onChange={p => {
|
||||||
|
history.push(p);
|
||||||
|
}}>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
tab={
|
tab={
|
||||||
<span>
|
<span>
|
||||||
@@ -65,11 +70,11 @@ function JobsDetailPage({ jobId, hash, data, match }) {
|
|||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key='#notes'>
|
key='#notes'>
|
||||||
<JobNotesContainer jobId={jobId} />
|
<JobNotesContainer jobId={jobId} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default JobsDetailPage;
|
export default withRouter(JobsDetailPage);
|
||||||
|
|||||||
Reference in New Issue
Block a user