Merge remote-tracking branch 'origin/release/2026-06-05' into feature/IO-3701-Harness-Replacement
This commit is contained in:
@@ -24,16 +24,28 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
)
|
||||
});
|
||||
|
||||
export function EsignatureCustomDocument({ bodyshop, jobId, setEsignatureContext }) {
|
||||
export function EsignatureCustomDocument({
|
||||
bodyshop,
|
||||
disabled = false,
|
||||
jobId,
|
||||
setEsignatureContext,
|
||||
showUnavailable = false
|
||||
}) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const notification = useNotification();
|
||||
const { t } = useTranslation();
|
||||
const esignatureEnabled = hasDocumensoApiKey(bodyshop);
|
||||
const isDisabled = disabled || !esignatureEnabled;
|
||||
|
||||
if (!hasDocumensoApiKey(bodyshop)) {
|
||||
if (!esignatureEnabled && !showUnavailable) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const uploadCustomDocument = async ({ file, onError, onSuccess }) => {
|
||||
if (isDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("document", file);
|
||||
formData.append("jobid", jobId);
|
||||
@@ -78,11 +90,12 @@ export function EsignatureCustomDocument({ bodyshop, jobId, setEsignatureContext
|
||||
return Upload.LIST_IGNORE;
|
||||
}}
|
||||
customRequest={uploadCustomDocument}
|
||||
disabled={isDisabled}
|
||||
maxCount={1}
|
||||
showUploadList={false}
|
||||
multiple={false}
|
||||
>
|
||||
<Button icon={<UploadOutlined />} loading={loading}>
|
||||
<Button disabled={isDisabled} icon={<UploadOutlined />} loading={loading}>
|
||||
{t("esignature.actions.upload_document")}
|
||||
</Button>
|
||||
</Upload>
|
||||
|
||||
@@ -14,7 +14,7 @@ const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
|
||||
const LockWrapper = ({ featureName, bodyshop, children, disabled = true, bypass }) => {
|
||||
const LockWrapper = ({ featureName, bodyshop, children, disabled = true, bypass, locked }) => {
|
||||
let renderedChildren = children;
|
||||
|
||||
//Mark the child prop as disabled.
|
||||
@@ -36,11 +36,13 @@ const LockWrapper = ({ featureName, bodyshop, children, disabled = true, bypass
|
||||
return <span>{children}</span>;
|
||||
}
|
||||
|
||||
return HasFeatureAccess({ featureName: featureName, bodyshop }) ? (
|
||||
const hasAccess = typeof locked === "boolean" ? !locked : HasFeatureAccess({ featureName: featureName, bodyshop });
|
||||
|
||||
return hasAccess ? (
|
||||
children
|
||||
) : (
|
||||
<Space>
|
||||
{!HasFeatureAccess({ featureName: featureName, bodyshop }) && <LockOutlined style={{ color: "tomato" }} />}
|
||||
<LockOutlined style={{ color: "tomato" }} />
|
||||
{renderedChildren}
|
||||
</Space>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useTreatmentsWithConfig } from "../../feature-flags/splitio-react-replacement";
|
||||
import { Card, Col, Input, Row, Space, Typography } from "antd";
|
||||
import { Card, Col, Input, Row, Space, Typography, Tooltip } from "antd";
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -10,6 +10,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import Jobd3RdPartyModal from "../job-3rd-party-modal/job-3rd-party-modal.component";
|
||||
import EsignatureCustomDocument from "../esignature-custom-document/esignature-custom-document.component";
|
||||
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component";
|
||||
import PrintCenterItem from "../print-center-item/print-center-item.component";
|
||||
import PrintCenterJobsLabels from "../print-center-jobs-labels/print-center-jobs-labels.component";
|
||||
import PrintCenterSpeedPrint from "../print-center-speed-print/print-center-speed-print.component";
|
||||
@@ -50,7 +51,7 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop, technicia
|
||||
.filter(
|
||||
(temp) =>
|
||||
(!temp.regions ||
|
||||
(temp.regions && temp.regions[bodyshop.region_config]) ||
|
||||
temp.regions?.[bodyshop.region_config] ||
|
||||
(temp.regions && bodyshop.region_config.includes(Object.keys(temp.regions)) === true)) &&
|
||||
(!temp.dms || temp.dms === false)
|
||||
)
|
||||
@@ -62,7 +63,7 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop, technicia
|
||||
.filter(
|
||||
(temp) =>
|
||||
!temp.regions ||
|
||||
(temp.regions && temp.regions[bodyshop.region_config]) ||
|
||||
temp.regions?.[bodyshop.region_config] ||
|
||||
(temp.regions && bodyshop.region_config.includes(Object.keys(temp.regions)) === true)
|
||||
)
|
||||
.filter((temp) => !isReynoldsMode || !temp.excludedDmsModes?.includes(dmsMode))
|
||||
@@ -100,7 +101,13 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop, technicia
|
||||
extra={
|
||||
<Space wrap>
|
||||
<PrintCenterJobsLabels jobId={jobId} />
|
||||
{esignatureEnabled && <EsignatureCustomDocument jobId={jobId} />}
|
||||
<Tooltip title={!esignatureEnabled ? t("esignature.tooltips.contact_sales") : null}>
|
||||
<span>
|
||||
<LockWrapperComponent locked={!esignatureEnabled} bodyshop={bodyshop}>
|
||||
<EsignatureCustomDocument jobId={jobId} showUnavailable />
|
||||
</LockWrapperComponent>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Jobd3RdPartyModal jobId={jobId} job={job} />
|
||||
<Input.Search onChange={(e) => setSearch(e.target.value)} value={search} enterButton />
|
||||
</Space>
|
||||
|
||||
@@ -1366,6 +1366,9 @@
|
||||
"pdf_only": "Only PDF documents can be uploaded for e-signature.",
|
||||
"upload_title": "Unable to prepare document for e-signature"
|
||||
},
|
||||
"tooltips": {
|
||||
"contact_sales": "E-signatures are not enabled for this shop. Contact sales to add this feature."
|
||||
},
|
||||
"fields": {
|
||||
"completed": "Completed?",
|
||||
"completed_at": "Completed At",
|
||||
|
||||
@@ -1366,6 +1366,9 @@
|
||||
"pdf_only": "Only PDF documents can be uploaded for e-signature.",
|
||||
"upload_title": "Unable to prepare document for e-signature"
|
||||
},
|
||||
"tooltips": {
|
||||
"contact_sales": "Las firmas electronicas no estan habilitadas para este taller. Contacte a ventas para agregar esta funcion."
|
||||
},
|
||||
"fields": {
|
||||
"completed": "",
|
||||
"completed_at": "",
|
||||
|
||||
@@ -1366,6 +1366,9 @@
|
||||
"pdf_only": "Only PDF documents can be uploaded for e-signature.",
|
||||
"upload_title": "Unable to prepare document for e-signature"
|
||||
},
|
||||
"tooltips": {
|
||||
"contact_sales": "Les signatures electroniques ne sont pas activees pour cet atelier. Contactez les ventes pour ajouter cette fonctionnalite."
|
||||
},
|
||||
"fields": {
|
||||
"completed": "",
|
||||
"completed_at": "",
|
||||
|
||||
Reference in New Issue
Block a user