Merged in release/2022-08-05 (pull request #558)

Release/2022 08 05
This commit is contained in:
Patrick Fic
2022-08-04 15:28:08 +00:00
5 changed files with 68 additions and 27 deletions

View File

@@ -15,7 +15,7 @@
"@stripe/react-stripe-js": "^1.9.0",
"@stripe/stripe-js": "^1.32.0",
"@tanem/react-nprogress": "^5.0.8",
"antd": "^4.21.7",
"antd": "^4.22.3",
"apollo-link-logger": "^2.0.0",
"axios": "^0.27.2",
"craco-less": "^1.20.0",

View File

@@ -1,4 +1,4 @@
import { SyncOutlined } from "@ant-design/icons";
import { SyncOutlined, FileExcelFilled } from "@ant-design/icons";
import { Button, Card, Space } from "antd";
import React, { useEffect } from "react";
import Gallery from "react-grid-gallery";
@@ -58,6 +58,24 @@ export function JobsDocumentsLocalGallery({
}
}, [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 (
<div>
<Space wrap>
@@ -90,7 +108,7 @@ export function JobsDocumentsLocalGallery({
</Card>
<Card title={t("jobs.labels.documents-images")}>
<Gallery
images={(allMedia && allMedia[job.id]) || []}
images={jobMedia.images}
backdropClosesModal={true}
onSelectImage={(index, image) => {
toggleMediaSelected({ jobid: job.id, filename: image.filename });
@@ -104,6 +122,31 @@ export function JobsDocumentsLocalGallery({
}}
/>
</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>
);
}

View File

@@ -12,24 +12,24 @@ export default connect(mapStateToProps, mapDispatchToProps)(OwnerNameDisplay);
export function OwnerNameDisplay({ bodyshop, ownerObject }) {
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() === "")
return "N/A";
if (bodyshop.last_name_first)
return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${
ownerObject.ownr_co_nm || ""
return `${ownerObject?.ownr_ln || ""}, ${ownerObject?.ownr_fn || ""} ${
ownerObject?.ownr_co_nm || ""
}`.trim();
return `${ownerObject.ownr_fn || ""} ${ownerObject.ownr_ln || ""} ${
return `${ownerObject?.ownr_fn || ""} ${ownerObject?.ownr_ln || ""} ${
ownerObject.ownr_co_nm || ""
}`.trim();
}
export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) {
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() === "")
return "N/A";
@@ -37,11 +37,11 @@ export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) {
const rdxStore = store.getState();
if (rdxStore.user.bodyshop.last_name_first && !forceFirstLast)
return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${
ownerObject.ownr_co_nm || ""
return `${ownerObject?.ownr_ln || ""}, ${ownerObject?.ownr_fn || ""} ${
ownerObject?.ownr_co_nm || ""
}`.trim();
return `${ownerObject.ownr_fn || ""} ${ownerObject.ownr_ln || ""} ${
ownerObject.ownr_co_nm || ""
return `${ownerObject?.ownr_fn || ""} ${ownerObject?.ownr_ln || ""} ${
ownerObject?.ownr_co_nm || ""
}`.trim();
}

View File

@@ -238,10 +238,8 @@ export function ProductionListTable({
sticky
pagination={false}
size="small"
className="production-list-table"
onRow={
Production_List_Status_Colors.treatment === "on" &&
((record, index) => {
{...(Production_List_Status_Colors.treatment === "on" && {
onRow: (record, index) => {
if (!bodyshop.md_ro_statuses.production_colors) return null;
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})`,
},
};
})
}
},
})}
components={{
header: {
cell: ResizeableTitle,

View File

@@ -3228,10 +3228,10 @@ ansi-styles@^5.0.0:
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==
antd@^4.21.7:
version "4.22.0"
resolved "https://registry.yarnpkg.com/antd/-/antd-4.22.0.tgz#fef6aa2de347718bca4820b73c22e1cac843dd66"
integrity sha512-ZKEfRF+wT21PVWrd1NKG7CQNUtiGOt35OV+ZKumazvubLUXHyFnJvueaN7vgcbcBmexFXC6TZvIL+TXWxa0zzg==
antd@^4.22.3:
version "4.22.3"
resolved "https://registry.yarnpkg.com/antd/-/antd-4.22.3.tgz#c6d4ced17e9c21b55c6234595d962c5f9d6768db"
integrity sha512-Nay1tO+G5Z9szmshK9TinOWclJnxOtSe7cr15EX64NGkZZyRoHX2xXOFQoYtBt4qfVfFvLf97m9on7fwgy1Svg==
dependencies:
"@ant-design/colors" "^6.0.0"
"@ant-design/icons" "^4.7.0"
@@ -3247,7 +3247,7 @@ antd@^4.21.7:
rc-checkbox "~2.3.0"
rc-collapse "~3.3.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-field-form "~1.27.0"
rc-image "~5.7.0"
@@ -11420,10 +11420,10 @@ rc-dialog@~8.9.0:
rc-motion "^2.3.0"
rc-util "^5.21.0"
rc-drawer@~5.0.0-alpha.7:
version "5.0.0-alpha.7"
resolved "https://registry.yarnpkg.com/rc-drawer/-/rc-drawer-5.0.0-alpha.7.tgz#c0491780559a77f64df3c687caf56a7b6a180f6f"
integrity sha512-3AXWO7VTCz//Ys66iF+b9FsKfvcmdKaR0wFwNHNL3Vw+YeMji5WfC3wE4snEAqCqUrR2Cw2wsihK+gPt4qbpZA==
rc-drawer@~5.1.0-alpha.1:
version "5.1.0-alpha.3"
resolved "https://registry.yarnpkg.com/rc-drawer/-/rc-drawer-5.1.0-alpha.3.tgz#a516131bd36f36b886c00ece027837050cbd3c68"
integrity sha512-8SR6VD3ms0KhfwGa0KIhCUr/3p8iIuxIqo8cqizZzQKUjSGU0IcB/fteDV3IVRGMqVHhSSQp4hzvYfZsOI+kOA==
dependencies:
"@babel/runtime" "^7.10.1"
classnames "^2.2.6"