Merge remote-tracking branch 'origin/release/2025-12-19' into feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration
This commit is contained in:
@@ -7,7 +7,6 @@ import { connect } from "react-redux";
|
|||||||
import { Route, Routes, useNavigate } from "react-router-dom";
|
import { Route, Routes, useNavigate } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import DocumentEditorContainer from "../components/document-editor/document-editor.container";
|
import DocumentEditorContainer from "../components/document-editor/document-editor.container";
|
||||||
import DocumentEditorLocalContainer from "../components/document-editor/document-editor-local.container";
|
|
||||||
import ErrorBoundary from "../components/error-boundary/error-boundary.component";
|
import ErrorBoundary from "../components/error-boundary/error-boundary.component";
|
||||||
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
|
||||||
import DisclaimerPage from "../pages/disclaimer/disclaimer.page";
|
import DisclaimerPage from "../pages/disclaimer/disclaimer.page";
|
||||||
@@ -242,9 +241,6 @@ export function App({
|
|||||||
<Route path="/edit/*" element={<PrivateRoute isAuthorized={currentUser.authorized} />}>
|
<Route path="/edit/*" element={<PrivateRoute isAuthorized={currentUser.authorized} />}>
|
||||||
<Route path="*" element={<DocumentEditorContainer />} />
|
<Route path="*" element={<DocumentEditorContainer />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/edit-local/*" element={<PrivateRoute isAuthorized={currentUser.authorized} />}>
|
|
||||||
<Route path="*" element={<DocumentEditorLocalContainer />} />
|
|
||||||
</Route>
|
|
||||||
</Routes>
|
</Routes>
|
||||||
</SoundWrapper>
|
</SoundWrapper>
|
||||||
</NotificationProvider>
|
</NotificationProvider>
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
import { useQuery } from "@apollo/client";
|
|
||||||
import queryString from "query-string";
|
|
||||||
import { useEffect } from "react";
|
|
||||||
import { connect } from "react-redux";
|
|
||||||
import { useLocation } from "react-router-dom";
|
|
||||||
import { QUERY_BODYSHOP } from "../../graphql/bodyshop.queries";
|
|
||||||
import { setBodyshop } from "../../redux/user/user.actions";
|
|
||||||
import DocumentEditorLocalComponent from "./document-editor-local.component";
|
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
|
||||||
setBodyshop: (bs) => dispatch(setBodyshop(bs))
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(null, mapDispatchToProps)(DocumentEditorLocalContainer);
|
|
||||||
|
|
||||||
export function DocumentEditorLocalContainer({ setBodyshop }) {
|
|
||||||
// Get the imageUrl, filename, jobid from the search string.
|
|
||||||
const { imageUrl, filename, jobid } = queryString.parse(useLocation().search);
|
|
||||||
|
|
||||||
const { data: dataShop } = useQuery(QUERY_BODYSHOP, {
|
|
||||||
fetchPolicy: "network-only",
|
|
||||||
nextFetchPolicy: "network-only"
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (dataShop) setBodyshop(dataShop.bodyshops[0]);
|
|
||||||
}, [dataShop, setBodyshop]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<DocumentEditorLocalComponent imageUrl={imageUrl} filename={filename} jobid={jobid} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -11,6 +11,7 @@ import { setBodyshop } from "../../redux/user/user.actions";
|
|||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
import DocumentEditor from "./document-editor.component";
|
import DocumentEditor from "./document-editor.component";
|
||||||
|
import { DocumentEditorLocalComponent } from "./document-editor-local.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBodyshop: (bs) => dispatch(setBodyshop(bs))
|
setBodyshop: (bs) => dispatch(setBodyshop(bs))
|
||||||
@@ -21,7 +22,7 @@ export default connect(null, mapDispatchToProps)(DocumentEditorContainer);
|
|||||||
export function DocumentEditorContainer({ setBodyshop }) {
|
export function DocumentEditorContainer({ setBodyshop }) {
|
||||||
//Get the image details for the image to be saved.
|
//Get the image details for the image to be saved.
|
||||||
//Get the document id from the search string.
|
//Get the document id from the search string.
|
||||||
const { documentId } = queryString.parse(useLocation().search);
|
const { documentId, imageUrl, filename, jobid } = queryString.parse(useLocation().search);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const {
|
const {
|
||||||
loading: loadingShop,
|
loading: loadingShop,
|
||||||
@@ -36,6 +37,21 @@ export function DocumentEditorContainer({ setBodyshop }) {
|
|||||||
if (dataShop) setBodyshop(dataShop.bodyshops[0]);
|
if (dataShop) setBodyshop(dataShop.bodyshops[0]);
|
||||||
}, [dataShop, setBodyshop]);
|
}, [dataShop, setBodyshop]);
|
||||||
|
|
||||||
|
if (loadingShop) return <LoadingSpinner />;
|
||||||
|
if (errorShop) return <AlertComponent message={errorShop.message} type="error" />;
|
||||||
|
|
||||||
|
if (dataShop?.bodyshops[0]?.uselocalmediaserver) {
|
||||||
|
if (imageUrl && filename && jobid) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<DocumentEditorLocalComponent imageUrl={imageUrl} filename={filename} jobid={jobid} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return <Result status="404" title={t("general.errors.notfound")} />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const { loading, error, data } = useQuery(GET_DOCUMENT_BY_PK, {
|
const { loading, error, data } = useQuery(GET_DOCUMENT_BY_PK, {
|
||||||
variables: { documentId },
|
variables: { documentId },
|
||||||
skip: !documentId,
|
skip: !documentId,
|
||||||
@@ -43,8 +59,8 @@ export function DocumentEditorContainer({ setBodyshop }) {
|
|||||||
nextFetchPolicy: "network-only"
|
nextFetchPolicy: "network-only"
|
||||||
});
|
});
|
||||||
|
|
||||||
if (loading || loadingShop) return <LoadingSpinner />;
|
if (loading) return <LoadingSpinner />;
|
||||||
if (error || errorShop) return <AlertComponent message={error.message || errorShop.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
|
||||||
if (!data || !data.documents_by_pk) return <Result status="404" title={t("general.errors.notfound")} />;
|
if (!data || !data.documents_by_pk) return <Result status="404" title={t("general.errors.notfound")} />;
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
|
|||||||
|
|
||||||
//TODO: Find a way to filter out / blur on demand.
|
//TODO: Find a way to filter out / blur on demand.
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="report-center-modal">
|
||||||
<Form onFinish={handleFinish} autoComplete={"off"} layout="vertical" form={form}>
|
<Form onFinish={handleFinish} autoComplete={"off"} layout="vertical" form={form}>
|
||||||
<Input.Search onChange={(e) => setSearch(e.target.value)} value={search} />
|
<Input.Search onChange={(e) => setSearch(e.target.value)} value={search} />
|
||||||
<Form.Item name="defaultSorters" hidden />
|
<Form.Item name="defaultSorters" hidden />
|
||||||
@@ -163,13 +163,14 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
|
|||||||
{Object.keys(grouped)
|
{Object.keys(grouped)
|
||||||
//.filter((key) => !groupExcludeKeyFilter.includes(key))
|
//.filter((key) => !groupExcludeKeyFilter.includes(key))
|
||||||
.map((key) => (
|
.map((key) => (
|
||||||
<Col md={8} sm={12} key={key}>
|
<Col xs={24} sm={12} md={Object.keys(grouped).length === 1 ? 24 : 8} key={key}>
|
||||||
<Card.Grid
|
<Card.Grid
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
maxHeight: "33vh",
|
maxHeight: "33vh",
|
||||||
overflowY: "scroll"
|
overflowY: "scroll",
|
||||||
|
minWidth: "200px"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography.Title level={4}>{t(`reportcenter.labels.groups.${key}`)}</Typography.Title>
|
<Typography.Title level={4}>{t(`reportcenter.labels.groups.${key}`)}</Typography.Title>
|
||||||
@@ -177,7 +178,7 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
|
|||||||
<BlurWrapperComponent
|
<BlurWrapperComponent
|
||||||
featureName={groupExcludeKeyFilter.find((g) => g.key === key).featureName}
|
featureName={groupExcludeKeyFilter.find((g) => g.key === key).featureName}
|
||||||
>
|
>
|
||||||
<ul style={{ listStyleType: "none", columns: "2 auto" }}>
|
<ul style={{ listStyleType: "none", columns: grouped[key].length > 4 ? "2 auto" : "1", padding: 0, margin: 0 }}>
|
||||||
{grouped[key].map((item) => (
|
{grouped[key].map((item) => (
|
||||||
<li key={item.key}>
|
<li key={item.key}>
|
||||||
<Radio key={item.key} value={item.key}>
|
<Radio key={item.key} value={item.key}>
|
||||||
@@ -188,7 +189,7 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
|
|||||||
</ul>
|
</ul>
|
||||||
</BlurWrapperComponent>
|
</BlurWrapperComponent>
|
||||||
) : (
|
) : (
|
||||||
<ul style={{ listStyleType: "none", columns: "2 auto" }}>
|
<ul style={{ listStyleType: "none", columns: grouped[key].length > 4 ? "2 auto" : "1", padding: 0, margin: 0 }}>
|
||||||
{grouped[key].map((item) =>
|
{grouped[key].map((item) =>
|
||||||
item.featureNameRestricted ? (
|
item.featureNameRestricted ? (
|
||||||
<li key={item.key}>
|
<li key={item.key}>
|
||||||
|
|||||||
@@ -11,3 +11,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Report center modal fixes for column layout
|
||||||
|
.report-center-modal {
|
||||||
|
.ant-form-item .ant-radio-group {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.ant-card-grid {
|
||||||
|
padding: 16px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
break-inside: avoid;
|
||||||
|
page-break-inside: avoid;
|
||||||
|
|
||||||
|
.ant-radio-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
span:not(.ant-radio) {
|
||||||
|
word-break: break-word;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
hyphens: auto;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user