@@ -15,7 +15,7 @@
|
|||||||
"@stripe/react-stripe-js": "^1.9.0",
|
"@stripe/react-stripe-js": "^1.9.0",
|
||||||
"@stripe/stripe-js": "^1.32.0",
|
"@stripe/stripe-js": "^1.32.0",
|
||||||
"@tanem/react-nprogress": "^5.0.8",
|
"@tanem/react-nprogress": "^5.0.8",
|
||||||
"antd": "^4.21.7",
|
"antd": "^4.22.3",
|
||||||
"apollo-link-logger": "^2.0.0",
|
"apollo-link-logger": "^2.0.0",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"craco-less": "^1.20.0",
|
"craco-less": "^1.20.0",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { SyncOutlined, FileExcelFilled } from "@ant-design/icons";
|
||||||
import { Button, Card, Space } from "antd";
|
import { Button, Card, Space } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import Gallery from "react-grid-gallery";
|
import Gallery from "react-grid-gallery";
|
||||||
@@ -58,6 +58,24 @@ export function JobsDocumentsLocalGallery({
|
|||||||
}
|
}
|
||||||
}, [job, invoice_number, getJobMedia, getBillMedia]);
|
}, [job, invoice_number, getJobMedia, getBillMedia]);
|
||||||
|
|
||||||
|
const jobMedia =
|
||||||
|
allMedia && allMedia[job.id]
|
||||||
|
? allMedia[job.id].reduce(
|
||||||
|
(acc, val) => {
|
||||||
|
if (
|
||||||
|
val.type &&
|
||||||
|
val.type.mime &&
|
||||||
|
val.type.mime.startsWith("image")
|
||||||
|
) {
|
||||||
|
acc.images.push(val);
|
||||||
|
} else {
|
||||||
|
acc.other.push(val);
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
{ images: [], other: [] }
|
||||||
|
)
|
||||||
|
: { images: [], other: [] };
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
@@ -90,7 +108,7 @@ export function JobsDocumentsLocalGallery({
|
|||||||
</Card>
|
</Card>
|
||||||
<Card title={t("jobs.labels.documents-images")}>
|
<Card title={t("jobs.labels.documents-images")}>
|
||||||
<Gallery
|
<Gallery
|
||||||
images={(allMedia && allMedia[job.id]) || []}
|
images={jobMedia.images}
|
||||||
backdropClosesModal={true}
|
backdropClosesModal={true}
|
||||||
onSelectImage={(index, image) => {
|
onSelectImage={(index, image) => {
|
||||||
toggleMediaSelected({ jobid: job.id, filename: image.filename });
|
toggleMediaSelected({ jobid: job.id, filename: image.filename });
|
||||||
@@ -104,6 +122,31 @@ export function JobsDocumentsLocalGallery({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
|
<Card title={t("jobs.labels.documents-other")}>
|
||||||
|
<Gallery
|
||||||
|
images={jobMedia.other}
|
||||||
|
backdropClosesModal={true}
|
||||||
|
enableLightbox={false}
|
||||||
|
thumbnailStyle={() => {
|
||||||
|
return {
|
||||||
|
backgroundImage: <FileExcelFilled />,
|
||||||
|
height: "100%",
|
||||||
|
width: "100%",
|
||||||
|
cursor: "pointer",
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
onClickThumbnail={(index) => {
|
||||||
|
window.open(
|
||||||
|
jobMedia.other[index].src,
|
||||||
|
"_blank",
|
||||||
|
"toolbar=0,location=0,menubar=0"
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
onSelectImage={(index, image) => {
|
||||||
|
toggleMediaSelected({ jobid: job.id, filename: image.filename });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,24 +12,24 @@ export default connect(mapStateToProps, mapDispatchToProps)(OwnerNameDisplay);
|
|||||||
|
|
||||||
export function OwnerNameDisplay({ bodyshop, ownerObject }) {
|
export function OwnerNameDisplay({ bodyshop, ownerObject }) {
|
||||||
const emptyTest =
|
const emptyTest =
|
||||||
ownerObject.ownr_fn + ownerObject.ownr_ln + ownerObject.ownr_co_nm;
|
ownerObject?.ownr_fn + ownerObject?.ownr_ln + ownerObject?.ownr_co_nm;
|
||||||
|
|
||||||
if (!emptyTest || emptyTest === "null" || emptyTest.trim() === "")
|
if (!emptyTest || emptyTest === "null" || emptyTest.trim() === "")
|
||||||
return "N/A";
|
return "N/A";
|
||||||
|
|
||||||
if (bodyshop.last_name_first)
|
if (bodyshop.last_name_first)
|
||||||
return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${
|
return `${ownerObject?.ownr_ln || ""}, ${ownerObject?.ownr_fn || ""} ${
|
||||||
ownerObject.ownr_co_nm || ""
|
ownerObject?.ownr_co_nm || ""
|
||||||
}`.trim();
|
}`.trim();
|
||||||
|
|
||||||
return `${ownerObject.ownr_fn || ""} ${ownerObject.ownr_ln || ""} ${
|
return `${ownerObject?.ownr_fn || ""} ${ownerObject?.ownr_ln || ""} ${
|
||||||
ownerObject.ownr_co_nm || ""
|
ownerObject.ownr_co_nm || ""
|
||||||
}`.trim();
|
}`.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) {
|
export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) {
|
||||||
const emptyTest =
|
const emptyTest =
|
||||||
ownerObject.ownr_fn + ownerObject.ownr_ln + ownerObject.ownr_co_nm;
|
ownerObject?.ownr_fn + ownerObject?.ownr_ln + ownerObject?.ownr_co_nm;
|
||||||
|
|
||||||
if (!emptyTest || emptyTest === "null" || emptyTest.trim() === "")
|
if (!emptyTest || emptyTest === "null" || emptyTest.trim() === "")
|
||||||
return "N/A";
|
return "N/A";
|
||||||
@@ -37,11 +37,11 @@ export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) {
|
|||||||
const rdxStore = store.getState();
|
const rdxStore = store.getState();
|
||||||
|
|
||||||
if (rdxStore.user.bodyshop.last_name_first && !forceFirstLast)
|
if (rdxStore.user.bodyshop.last_name_first && !forceFirstLast)
|
||||||
return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${
|
return `${ownerObject?.ownr_ln || ""}, ${ownerObject?.ownr_fn || ""} ${
|
||||||
ownerObject.ownr_co_nm || ""
|
ownerObject?.ownr_co_nm || ""
|
||||||
}`.trim();
|
}`.trim();
|
||||||
|
|
||||||
return `${ownerObject.ownr_fn || ""} ${ownerObject.ownr_ln || ""} ${
|
return `${ownerObject?.ownr_fn || ""} ${ownerObject?.ownr_ln || ""} ${
|
||||||
ownerObject.ownr_co_nm || ""
|
ownerObject?.ownr_co_nm || ""
|
||||||
}`.trim();
|
}`.trim();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,10 +238,8 @@ export function ProductionListTable({
|
|||||||
sticky
|
sticky
|
||||||
pagination={false}
|
pagination={false}
|
||||||
size="small"
|
size="small"
|
||||||
className="production-list-table"
|
{...(Production_List_Status_Colors.treatment === "on" && {
|
||||||
onRow={
|
onRow: (record, index) => {
|
||||||
Production_List_Status_Colors.treatment === "on" &&
|
|
||||||
((record, index) => {
|
|
||||||
if (!bodyshop.md_ro_statuses.production_colors) return null;
|
if (!bodyshop.md_ro_statuses.production_colors) return null;
|
||||||
|
|
||||||
const color = bodyshop.md_ro_statuses.production_colors.find(
|
const color = bodyshop.md_ro_statuses.production_colors.find(
|
||||||
@@ -255,8 +253,8 @@ export function ProductionListTable({
|
|||||||
backgroundColor: `rgb(${color.color.r},${color.color.g},${color.color.b},${color.color.a})`,
|
backgroundColor: `rgb(${color.color.r},${color.color.g},${color.color.b},${color.color.a})`,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
})
|
},
|
||||||
}
|
})}
|
||||||
components={{
|
components={{
|
||||||
header: {
|
header: {
|
||||||
cell: ResizeableTitle,
|
cell: ResizeableTitle,
|
||||||
|
|||||||
@@ -3228,10 +3228,10 @@ ansi-styles@^5.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
|
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
|
||||||
integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==
|
integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==
|
||||||
|
|
||||||
antd@^4.21.7:
|
antd@^4.22.3:
|
||||||
version "4.22.0"
|
version "4.22.3"
|
||||||
resolved "https://registry.yarnpkg.com/antd/-/antd-4.22.0.tgz#fef6aa2de347718bca4820b73c22e1cac843dd66"
|
resolved "https://registry.yarnpkg.com/antd/-/antd-4.22.3.tgz#c6d4ced17e9c21b55c6234595d962c5f9d6768db"
|
||||||
integrity sha512-ZKEfRF+wT21PVWrd1NKG7CQNUtiGOt35OV+ZKumazvubLUXHyFnJvueaN7vgcbcBmexFXC6TZvIL+TXWxa0zzg==
|
integrity sha512-Nay1tO+G5Z9szmshK9TinOWclJnxOtSe7cr15EX64NGkZZyRoHX2xXOFQoYtBt4qfVfFvLf97m9on7fwgy1Svg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@ant-design/colors" "^6.0.0"
|
"@ant-design/colors" "^6.0.0"
|
||||||
"@ant-design/icons" "^4.7.0"
|
"@ant-design/icons" "^4.7.0"
|
||||||
@@ -3247,7 +3247,7 @@ antd@^4.21.7:
|
|||||||
rc-checkbox "~2.3.0"
|
rc-checkbox "~2.3.0"
|
||||||
rc-collapse "~3.3.0"
|
rc-collapse "~3.3.0"
|
||||||
rc-dialog "~8.9.0"
|
rc-dialog "~8.9.0"
|
||||||
rc-drawer "~5.0.0-alpha.7"
|
rc-drawer "~5.1.0-alpha.1"
|
||||||
rc-dropdown "~4.0.0"
|
rc-dropdown "~4.0.0"
|
||||||
rc-field-form "~1.27.0"
|
rc-field-form "~1.27.0"
|
||||||
rc-image "~5.7.0"
|
rc-image "~5.7.0"
|
||||||
@@ -11420,10 +11420,10 @@ rc-dialog@~8.9.0:
|
|||||||
rc-motion "^2.3.0"
|
rc-motion "^2.3.0"
|
||||||
rc-util "^5.21.0"
|
rc-util "^5.21.0"
|
||||||
|
|
||||||
rc-drawer@~5.0.0-alpha.7:
|
rc-drawer@~5.1.0-alpha.1:
|
||||||
version "5.0.0-alpha.7"
|
version "5.1.0-alpha.3"
|
||||||
resolved "https://registry.yarnpkg.com/rc-drawer/-/rc-drawer-5.0.0-alpha.7.tgz#c0491780559a77f64df3c687caf56a7b6a180f6f"
|
resolved "https://registry.yarnpkg.com/rc-drawer/-/rc-drawer-5.1.0-alpha.3.tgz#a516131bd36f36b886c00ece027837050cbd3c68"
|
||||||
integrity sha512-3AXWO7VTCz//Ys66iF+b9FsKfvcmdKaR0wFwNHNL3Vw+YeMji5WfC3wE4snEAqCqUrR2Cw2wsihK+gPt4qbpZA==
|
integrity sha512-8SR6VD3ms0KhfwGa0KIhCUr/3p8iIuxIqo8cqizZzQKUjSGU0IcB/fteDV3IVRGMqVHhSSQp4hzvYfZsOI+kOA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime" "^7.10.1"
|
"@babel/runtime" "^7.10.1"
|
||||||
classnames "^2.2.6"
|
classnames "^2.2.6"
|
||||||
|
|||||||
Reference in New Issue
Block a user