From 16861c5b41fb5cd0f94d1d57fe1b74a486a66105 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 22 Jan 2020 15:12:04 -0800 Subject: [PATCH] Added hash history to job detail page. --- .../job-detail-cards.notes.component.jsx | 5 ++++- .../components/jobs-list/jobs-list.component.jsx | 5 ++++- .../jobs-detail/jobs-detail.page.container.jsx | 12 +++++++++--- client/src/pages/jobs-detail/jobs-detail.page.jsx | 13 +++++++++---- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/client/src/components/job-detail-cards/job-detail-cards.notes.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.notes.component.jsx index 20b761ba7..e9a6f79c6 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.notes.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.notes.component.jsx @@ -13,7 +13,10 @@ export default function JobDetailCardsNotesComponent({ loading, data }) { const { t } = useTranslation(); return ( - + {data ? ( ) : ( - t("jobs.errors.noowner") + // t("jobs.errors.noowner") + + {record.ownr_fn} {record.ownr_ln} + ); } }, diff --git a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx index 644dc97f2..0754213a4 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx @@ -1,5 +1,5 @@ import { useQuery } from "@apollo/react-hooks"; -import React, { useEffect } from "react"; +import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import AlertComponent from "../../components/alert/alert.component"; import SpinComponent from "../../components/loading-spinner/loading-spinner.component"; @@ -25,7 +25,13 @@ function JobsDetailPageContainer({ match, location }) { if (loading) return ; if (error) return ; - - return ; + return ( + + ); } export default JobsDetailPageContainer; diff --git a/client/src/pages/jobs-detail/jobs-detail.page.jsx b/client/src/pages/jobs-detail/jobs-detail.page.jsx index 0b655d048..942b98f2b 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.jsx @@ -1,5 +1,6 @@ import { Icon, Row, Tabs } from "antd"; import React from "react"; +import { withRouter } from "react-router-dom"; import { useTranslation } from "react-i18next"; import JobLinesContainer from "../../components/job-lines/job-lines.container.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 JobNotesContainer from "../../components/jobs-notes/jobs-notes.container"; -function JobsDetailPage({ jobId, hash, data, match }) { +function JobsDetailPage({ jobId, hash, data, match, history }) { const { t } = useTranslation(); return ( @@ -16,7 +17,11 @@ function JobsDetailPage({ jobId, hash, data, match }) { - + { + history.push(p); + }}> @@ -65,11 +70,11 @@ function JobsDetailPage({ jobId, hash, data, match }) { } key='#notes'> - + ); } -export default JobsDetailPage; +export default withRouter(JobsDetailPage);