WIP for not found error pages BOD-119
This commit is contained in:
@@ -7561,6 +7561,48 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>notfoundsub</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>notfoundtitle</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>rbacunauth</name>
|
<name>rbacunauth</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ export default function Test() {
|
|||||||
console.log("handleQbSignIn -> result", result.data);
|
console.log("handleQbSignIn -> result", result.data);
|
||||||
// window.open(result.data, "_blank", "toolbar=0,location=0,menubar=0");
|
// window.open(result.data, "_blank", "toolbar=0,location=0,menubar=0");
|
||||||
|
|
||||||
var win;
|
|
||||||
var checkConnect;
|
|
||||||
var parameters = "location=1,width=800,height=650";
|
var parameters = "location=1,width=800,height=650";
|
||||||
parameters +=
|
parameters +=
|
||||||
",left=" +
|
",left=" +
|
||||||
@@ -16,7 +14,7 @@ export default function Test() {
|
|||||||
(window.screen.height - 650) / 2;
|
(window.screen.height - 650) / 2;
|
||||||
|
|
||||||
// Launch Popup
|
// Launch Popup
|
||||||
win = window.open(result.data, "connectPopup", parameters);
|
window.open(result.data, "connectPopup", parameters);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
16
client/src/components/not-found/not-found.component.jsx
Normal file
16
client/src/components/not-found/not-found.component.jsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { Result } from "antd";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
export default function NotFound() {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Result
|
||||||
|
status="404"
|
||||||
|
title={t("general.messages.notfoundtitle")}
|
||||||
|
subTitle={t("general.messages.notfoundsub")}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import { CreateRecentItem } from "../../utils/create-recent-item";
|
import { CreateRecentItem } from "../../utils/create-recent-item";
|
||||||
import ContractDetailPageComponent from "./contract-detail.page.component";
|
import ContractDetailPageComponent from "./contract-detail.page.component";
|
||||||
|
import NotFound from "../../components/not-found/not-found.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -41,7 +42,11 @@ export function ContractDetailPageContainer({ setBreadcrumbs, addRecentItem }) {
|
|||||||
: error
|
: error
|
||||||
? t("titles.app")
|
? t("titles.app")
|
||||||
: t("titles.contracts-detail", {
|
: t("titles.contracts-detail", {
|
||||||
id: (data && data.cccontracts_by_pk.agreementnumber) || "",
|
id:
|
||||||
|
(data &&
|
||||||
|
data.cccontracts_by_pk &&
|
||||||
|
data.cccontracts_by_pk.agreementnumber) ||
|
||||||
|
"",
|
||||||
});
|
});
|
||||||
|
|
||||||
setBreadcrumbs([
|
setBreadcrumbs([
|
||||||
@@ -53,12 +58,16 @@ export function ContractDetailPageContainer({ setBreadcrumbs, addRecentItem }) {
|
|||||||
{
|
{
|
||||||
link: "/manage/courtesycars/contracts/new",
|
link: "/manage/courtesycars/contracts/new",
|
||||||
label: t("titles.bc.contracts-detail", {
|
label: t("titles.bc.contracts-detail", {
|
||||||
number: (data && data.cccontracts_by_pk.agreementnumber) || "",
|
number:
|
||||||
|
(data &&
|
||||||
|
data.cccontracts_by_pk &&
|
||||||
|
data.cccontracts_by_pk.agreementnumber) ||
|
||||||
|
"",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (data)
|
if (data && data.cccontracts_by_pk)
|
||||||
addRecentItem(
|
addRecentItem(
|
||||||
CreateRecentItem(
|
CreateRecentItem(
|
||||||
contractId,
|
contractId,
|
||||||
@@ -88,12 +97,19 @@ export function ContractDetailPageContainer({ setBreadcrumbs, addRecentItem }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data) form.resetFields();
|
if (data && data.cccontracts_by_pk) form.resetFields();
|
||||||
}, [data, form]);
|
}, [data, form]);
|
||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
if (loading) return <LoadingSpinner />;
|
if (loading) return <LoadingSpinner />;
|
||||||
|
|
||||||
|
if (!!!data.cccontracts_by_pk) return <NotFound />;
|
||||||
|
console.log(
|
||||||
|
"data.cccontracts_by_pk",
|
||||||
|
!!!data.cccontracts_by_pk,
|
||||||
|
data.cccontracts_by_pk
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="contracts:detail">
|
<RbacWrapper action="contracts:detail">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import {
|
|||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import { CreateRecentItem } from "../../utils/create-recent-item";
|
import { CreateRecentItem } from "../../utils/create-recent-item";
|
||||||
import CourtesyCarDetailPageComponent from "./courtesy-car-detail.page.component";
|
import CourtesyCarDetailPageComponent from "./courtesy-car-detail.page.component";
|
||||||
|
import NotFound from "../../components/not-found/not-found.component";
|
||||||
|
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -38,21 +40,29 @@ export function CourtesyCarDetailPageContainer({
|
|||||||
: error
|
: error
|
||||||
? t("titles.app")
|
? t("titles.app")
|
||||||
: t("titles.courtesycars-detail", {
|
: t("titles.courtesycars-detail", {
|
||||||
id: (data && data.courtesycars_by_pk.fleet_number) || "",
|
id:
|
||||||
|
(data &&
|
||||||
|
data.courtesycars_by_pk &&
|
||||||
|
data.courtesycars_by_pk.fleet_number) ||
|
||||||
|
"",
|
||||||
});
|
});
|
||||||
setBreadcrumbs([
|
setBreadcrumbs([
|
||||||
{ link: "/manage/courtesycars", label: t("titles.bc.courtesycars") },
|
{ link: "/manage/courtesycars", label: t("titles.bc.courtesycars") },
|
||||||
{
|
{
|
||||||
link: `/manage/courtesycars/${
|
link: `/manage/courtesycars/${
|
||||||
(data && data.courtesycars_by_pk.id) || ""
|
(data && data.courtesycars_by_pk && data.courtesycars_by_pk.id) || ""
|
||||||
}`,
|
}`,
|
||||||
label: t("titles.bc.courtesycars-detail", {
|
label: t("titles.bc.courtesycars-detail", {
|
||||||
number: (data && data.courtesycars_by_pk.fleetnumber) || "",
|
number:
|
||||||
|
(data &&
|
||||||
|
data.courtesycars_by_pk &&
|
||||||
|
data.courtesycars_by_pk.fleetnumber) ||
|
||||||
|
"",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (data)
|
if (data && data.courtesycars_by_pk)
|
||||||
addRecentItem(
|
addRecentItem(
|
||||||
CreateRecentItem(
|
CreateRecentItem(
|
||||||
ccId,
|
ccId,
|
||||||
@@ -84,10 +94,14 @@ export function CourtesyCarDetailPageContainer({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data) form.resetFields();
|
if (data && data.courtesycars_by_pk) form.resetFields();
|
||||||
}, [data, form]);
|
}, [data, form]);
|
||||||
|
|
||||||
|
if (loading) return <LoadingSpinner />;
|
||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
|
||||||
|
if (!!!data.courtesycars_by_pk) return <NotFound />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="courtesycar:detail">
|
<RbacWrapper action="courtesycar:detail">
|
||||||
<Form
|
<Form
|
||||||
|
|||||||
@@ -3,24 +3,19 @@ import React, { useEffect } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
|
||||||
import AlertComponent from "../../components/alert/alert.component";
|
import AlertComponent from "../../components/alert/alert.component";
|
||||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||||
|
import NotFound from "../../components/not-found/not-found.component";
|
||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import { QUERY_JOB_CLOSE_DETAILS } from "../../graphql/jobs.queries";
|
import { QUERY_JOB_CLOSE_DETAILS } from "../../graphql/jobs.queries";
|
||||||
import { setBreadcrumbs } from "../../redux/application/application.actions";
|
import { setBreadcrumbs } from "../../redux/application/application.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import JobsCloseComponent from "./jobs-close.component";
|
import JobsCloseComponent from "./jobs-close.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
|
||||||
bodyshop: selectBodyshop,
|
|
||||||
});
|
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function JobsCloseContainer({ setBreadcrumbs, bodyshop }) {
|
export function JobsCloseContainer({ setBreadcrumbs }) {
|
||||||
const { jobId } = useParams();
|
const { jobId } = useParams();
|
||||||
const { loading, error, data } = useQuery(QUERY_JOB_CLOSE_DETAILS, {
|
const { loading, error, data } = useQuery(QUERY_JOB_CLOSE_DETAILS, {
|
||||||
variables: { id: jobId },
|
variables: { id: jobId },
|
||||||
@@ -28,7 +23,7 @@ export function JobsCloseContainer({ setBreadcrumbs, bodyshop }) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.title = t("titles.jobs-close", {
|
document.title = t("titles.jobs-close", {
|
||||||
number: data ? data.jobs_by_pk.ro_number : null,
|
number: data ? data.jobs_by_pk && data.jobs_by_pk.ro_number : null,
|
||||||
});
|
});
|
||||||
|
|
||||||
setBreadcrumbs([
|
setBreadcrumbs([
|
||||||
@@ -39,7 +34,7 @@ export function JobsCloseContainer({ setBreadcrumbs, bodyshop }) {
|
|||||||
{
|
{
|
||||||
link: `/manage/jobs/${jobId}/`,
|
link: `/manage/jobs/${jobId}/`,
|
||||||
label: t("titles.bc.jobs-detail", {
|
label: t("titles.bc.jobs-detail", {
|
||||||
number: data ? data.jobs_by_pk.ro_number : null,
|
number: data ? data.jobs_by_pk && data.jobs_by_pk.ro_number : null,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -51,6 +46,7 @@ export function JobsCloseContainer({ setBreadcrumbs, bodyshop }) {
|
|||||||
|
|
||||||
if (loading) return <LoadingSpinner />;
|
if (loading) return <LoadingSpinner />;
|
||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
if (!!!data.jobs_by_pk) return <NotFound />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="jobs:close">
|
<RbacWrapper action="jobs:close">
|
||||||
@@ -63,4 +59,4 @@ export function JobsCloseContainer({ setBreadcrumbs, bodyshop }) {
|
|||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(JobsCloseContainer);
|
export default connect(null, mapDispatchToProps)(JobsCloseContainer);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import { CreateRecentItem } from "../../utils/create-recent-item";
|
import { CreateRecentItem } from "../../utils/create-recent-item";
|
||||||
import JobsDetailPage from "./jobs-detail.page.component";
|
import JobsDetailPage from "./jobs-detail.page.component";
|
||||||
|
import NotFound from "../../components/not-found/not-found.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -53,9 +54,10 @@ function JobsDetailPageContainer({ match, setBreadcrumbs, addRecentItem }) {
|
|||||||
: error
|
: error
|
||||||
? t("titles.app")
|
? t("titles.app")
|
||||||
: t("titles.jobsdetail", {
|
: t("titles.jobsdetail", {
|
||||||
ro_number: data.jobs_by_pk.converted
|
ro_number:
|
||||||
? data.jobs_by_pk.ro_number
|
data.jobs_by_pk && data.jobs_by_pk.converted
|
||||||
: `EST ${data.jobs_by_pk.est_number}`,
|
? data.jobs_by_pk && data.jobs_by_pk.ro_number
|
||||||
|
: `EST ${data.jobs_by_pk && data.jobs_by_pk.est_number}`,
|
||||||
});
|
});
|
||||||
setBreadcrumbs([
|
setBreadcrumbs([
|
||||||
{ link: "/manage/jobs", label: t("titles.bc.jobs") },
|
{ link: "/manage/jobs", label: t("titles.bc.jobs") },
|
||||||
@@ -64,15 +66,16 @@ function JobsDetailPageContainer({ match, setBreadcrumbs, addRecentItem }) {
|
|||||||
label: t("titles.bc.jobs-detail", {
|
label: t("titles.bc.jobs-detail", {
|
||||||
number:
|
number:
|
||||||
(data &&
|
(data &&
|
||||||
(data.jobs_by_pk.converted
|
data.jobs_by_pk &&
|
||||||
? data && data.jobs_by_pk.ro_number
|
(data.jobs_by_pk && data.jobs_by_pk.converted
|
||||||
: `EST ${data.jobs_by_pk.est_number}`)) ||
|
? data && data.jobs_by_pk && data.jobs_by_pk.ro_number
|
||||||
|
: `EST ${data.jobs_by_pk && data.jobs_by_pk.est_number}`)) ||
|
||||||
"",
|
"",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (data)
|
if (data && data.jobs_by_pk)
|
||||||
addRecentItem(
|
addRecentItem(
|
||||||
CreateRecentItem(
|
CreateRecentItem(
|
||||||
jobId,
|
jobId,
|
||||||
@@ -87,6 +90,7 @@ function JobsDetailPageContainer({ match, setBreadcrumbs, addRecentItem }) {
|
|||||||
|
|
||||||
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" />;
|
||||||
|
if (!!!data.jobs_by_pk) return <NotFound />;
|
||||||
|
|
||||||
return data.jobs_by_pk ? (
|
return data.jobs_by_pk ? (
|
||||||
<RbacWrapper action="jobs:detail">
|
<RbacWrapper action="jobs:detail">
|
||||||
|
|||||||
@@ -64,8 +64,6 @@ export function* isUserAuthenticated() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(yield auth.currentUser.getIdToken(true));
|
|
||||||
|
|
||||||
LogRocket.identify(user.email);
|
LogRocket.identify(user.email);
|
||||||
yield put(
|
yield put(
|
||||||
signInSuccess({
|
signInSuccess({
|
||||||
|
|||||||
@@ -486,6 +486,8 @@
|
|||||||
"exception": "$t(titles.app) has encountered an error. Please try again. If the problem persists, please submit a support ticket or contact us.",
|
"exception": "$t(titles.app) has encountered an error. Please try again. If the problem persists, please submit a support ticket or contact us.",
|
||||||
"newversionmessage": "Click refresh below to update to the latest available version of ImEX Online.",
|
"newversionmessage": "Click refresh below to update to the latest available version of ImEX Online.",
|
||||||
"newversiontitle": "New version of ImEX Online Available",
|
"newversiontitle": "New version of ImEX Online Available",
|
||||||
|
"notfoundsub": "Please make sure that you have access to the data or that the link is correct.",
|
||||||
|
"notfoundtitle": "We couldn't find what you're looking for...",
|
||||||
"rbacunauth": "You are not authorized to view this content. Please reach out to your shop manager to change your access level.",
|
"rbacunauth": "You are not authorized to view this content. Please reach out to your shop manager to change your access level.",
|
||||||
"unsavedchanges": "You have unsaved changes.",
|
"unsavedchanges": "You have unsaved changes.",
|
||||||
"unsavedchangespopup": "You have unsaved changes. Are you sure you want to leave?"
|
"unsavedchangespopup": "You have unsaved changes. Are you sure you want to leave?"
|
||||||
|
|||||||
@@ -486,6 +486,8 @@
|
|||||||
"exception": "",
|
"exception": "",
|
||||||
"newversionmessage": "",
|
"newversionmessage": "",
|
||||||
"newversiontitle": "",
|
"newversiontitle": "",
|
||||||
|
"notfoundsub": "",
|
||||||
|
"notfoundtitle": "",
|
||||||
"rbacunauth": "",
|
"rbacunauth": "",
|
||||||
"unsavedchanges": "Usted tiene cambios no guardados.",
|
"unsavedchanges": "Usted tiene cambios no guardados.",
|
||||||
"unsavedchangespopup": ""
|
"unsavedchangespopup": ""
|
||||||
|
|||||||
@@ -486,6 +486,8 @@
|
|||||||
"exception": "",
|
"exception": "",
|
||||||
"newversionmessage": "",
|
"newversionmessage": "",
|
||||||
"newversiontitle": "",
|
"newversiontitle": "",
|
||||||
|
"notfoundsub": "",
|
||||||
|
"notfoundtitle": "",
|
||||||
"rbacunauth": "",
|
"rbacunauth": "",
|
||||||
"unsavedchanges": "Vous avez des changements non enregistrés.",
|
"unsavedchanges": "Vous avez des changements non enregistrés.",
|
||||||
"unsavedchangespopup": ""
|
"unsavedchangespopup": ""
|
||||||
|
|||||||
Reference in New Issue
Block a user