Compare commits

...

7 Commits

Author SHA1 Message Date
Patrick Fic
107265c2fc IO-223 Remove LA1 from ARMS. 2022-10-27 11:11:29 -07:00
Patrick Fic
c26cc9e908 Resolve PBS query error. 2022-10-27 08:13:57 -07:00
Patrick Fic
21d05553ff Add ARMS logging. 2022-10-26 09:26:39 -07:00
Patrick Fic
15bf1937d3 Remove logging statement. 2022-10-24 14:01:37 -07:00
Patrick Fic
41b32a25d7 IO-2086 LMS Optimized imges bugfix. 2022-10-24 13:49:57 -07:00
Patrick Fic
dc0d8526a3 IO-2086 Improved local media image display. 2022-10-24 12:50:52 -07:00
Patrick Fic
84fcca239a Merged in release/2022-10-21 (pull request #600)
Release/2022 10 21
2022-10-19 22:51:50 +00:00
9 changed files with 72 additions and 9 deletions

View File

@@ -13704,6 +13704,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>optimizedimage</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>reassign_limitexceeded</name>
<definition_loaded>false</definition_loaded>

View File

@@ -60,6 +60,11 @@ export const handleUpload = async ({ ev, context }) => {
...d,
selected: false,
src: normalizeUrl(`${bodyshop.localmediaserverhttp}/${d.src}`),
...(d.optimized && {
optimized: normalizeUrl(
`${bodyshop.localmediaserverhttp}/${d.optimized}`
),
}),
thumbnail: normalizeUrl(
`${bodyshop.localmediaserverhttp}/${d.thumbnail}`
),

View File

@@ -1,5 +1,5 @@
import { SyncOutlined, FileExcelFilled } from "@ant-design/icons";
import { Button, Card, Space } from "antd";
import { Alert, Button, Card, Space } from "antd";
import React, { useEffect } from "react";
import Gallery from "react-grid-gallery";
import { useTranslation } from "react-i18next";
@@ -58,7 +58,7 @@ export function JobsDocumentsLocalGallery({
}
}
}, [job, invoice_number, getJobMedia, getBillMedia]);
let optimized;
const jobMedia =
allMedia && allMedia[job.id]
? allMedia[job.id].reduce(
@@ -68,7 +68,11 @@ export function JobsDocumentsLocalGallery({
val.type.mime &&
val.type.mime.startsWith("image")
) {
acc.images.push(val);
acc.images.push({
...val,
...(val.optimized && { src: val.optimized, fullsize: val.src }),
});
if (val.optimized) optimized = true;
} else {
acc.other.push({
...val,
@@ -80,6 +84,7 @@ export function JobsDocumentsLocalGallery({
{ images: [], other: [] }
)
: { images: [], other: [] };
return (
<div>
<Space wrap>
@@ -119,9 +124,22 @@ export function JobsDocumentsLocalGallery({
onSelectImage={(index, image) => {
toggleMediaSelected({ jobid: job.id, filename: image.filename });
}}
{...(optimized && {
customControls: [
<Alert
style={{ margin: "4px" }}
message={t("documents.labels.optimizedimage")}
type="success"
/>,
],
})}
onClickImage={(props) => {
const media = allMedia[job.id].find(
(m) => m.optimized === props.target.src
);
window.open(
props.target.src,
media ? media.src : props.target.src,
"_blank",
"toolbar=0,location=0,menubar=0"
);

View File

@@ -39,6 +39,11 @@ export function* getJobMedia({ payload: jobid }) {
thumbnail: normalizeUrl(
`${localmediaserverhttp}/${d.thumbnail}`
),
...(d.optimized && {
optimized: normalizeUrl(
`${localmediaserverhttp}/${d.optimized}`
),
}),
isSelected: false,
key: idx,
};
@@ -50,6 +55,7 @@ export function* getJobMedia({ payload: jobid }) {
thumbnail: normalizeUrl(
`${localmediaserverhttp}/${d.thumbnail}`
),
isSelected: false,
key: idx,
};
@@ -91,6 +97,11 @@ export function* getBillMedia({ payload: { jobid, invoice_number } }) {
thumbnail: normalizeUrl(
`${localmediaserverhttp}/${d.thumbnail}`
),
...(d.optimized && {
optimized: normalizeUrl(
`${localmediaserverhttp}/${d.optimized}`
),
}),
isSelected: false,
key: idx,
};

View File

@@ -849,6 +849,7 @@
"doctype": "Document Type",
"newjobid": "Assign to Job",
"openinexplorer": "Open in Explorer",
"optimizedimage": "The below image is optimized. Click on the picture below to open in a new window and view it full size, or open it in explorer.",
"reassign_limitexceeded": "Reassigning all selected documents will exceed the job storage limit for your shop. ",
"reassign_limitexceeded_title": "Unable to reassign document(s)",
"storageexceeded": "You've exceeded your storage limit for this job. Please remove documents, or increase your storage plan.",

View File

@@ -849,6 +849,7 @@
"doctype": "",
"newjobid": "",
"openinexplorer": "",
"optimizedimage": "",
"reassign_limitexceeded": "",
"reassign_limitexceeded_title": "",
"storageexceeded": "",

View File

@@ -849,6 +849,7 @@
"doctype": "",
"newjobid": "",
"openinexplorer": "",
"optimizedimage": "",
"reassign_limitexceeded": "",
"reassign_limitexceeded_title": "",
"storageexceeded": "",

View File

@@ -515,11 +515,8 @@ exports.default = async (req, res) => {
{
TotalType: "LAB",
TotalTypeDesc: "Body Labor",
TotalHours:
job.job_totals.rates.lab.hours + job.job_totals.rates.la1.hours,
TotalAmt: Dinero(job.job_totals.rates.lab.total)
.add(Dinero(job.job_totals.rates.la1.total))
.toFormat("0.00"),
TotalHours: job.job_totals.rates.lab.hours,
TotalAmt: Dinero(job.job_totals.rates.lab.total).toFormat("0.00"),
},
{
TotalType: "LAF",
@@ -856,6 +853,13 @@ exports.default = async (req, res) => {
fs.writeFileSync(`./logs/arms-request.xml`, rawRequest);
fs.writeFileSync(`./logs/arms-response.xml`, rawResponse);
logger.log("arms-job-xml-request", "DEBUG", "api", job.id, {
xml: rawRequest,
});
logger.log("arms-job-xml-response", "DEBUG", "api", job.id, {
xml: rawResponse,
});
if (err) {
sendServerEmail({
subject: `ARMS Update Failed: ${bodyshop.shopname} - ${job.ro_number}`,

View File

@@ -332,6 +332,7 @@ query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) {
ownerid
ownr_ln
ownr_fn
ownr_co_nm
ownr_addr1
ownr_addr2
ownr_ph1