feature/IO-3103-Ant5-Notifications

This commit is contained in:
Dave Richer
2025-01-21 17:20:46 -08:00
parent 0e218abbf4
commit 85d25862eb
161 changed files with 759 additions and 354 deletions

View File

@@ -9,7 +9,8 @@ import { selectTechnician } from "../../redux/tech/tech.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { GenerateDocument } from "../../utils/RenderTemplate";
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component";
import { HasFeatureAccess } from './../feature-wrapper/feature-wrapper.component';
import { HasFeatureAccess } from "./../feature-wrapper/feature-wrapper.component";
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
const mapStateToProps = createStructuredSelector({
printCenterModal: selectPrintCenter,
@@ -31,6 +32,8 @@ export function PrintCenterItemComponent({
}) {
const [loading, setLoading] = useState(false);
const { context } = printCenterModal;
const notification = useNotification();
const renderToNewWindow = async () => {
setLoading(true);
await GenerateDocument(
@@ -39,12 +42,17 @@ export function PrintCenterItemComponent({
variables: { id: id }
},
{},
"p"
"p",
null,
notification
);
setLoading(false);
};
if (disabled || (item.featureNameRestricted && !HasFeatureAccess({"featureName": item.featureNameRestricted, bodyshop})))
if (
disabled ||
(item.featureNameRestricted && !HasFeatureAccess({ featureName: item.featureNameRestricted, bodyshop }))
)
return (
<li className="print-center-item">
<LockWrapperComponent featureName={item.featureNameRestricted} bodyshop={bodyshop}>
@@ -70,7 +78,8 @@ export function PrintCenterItemComponent({
subject: item.subject
},
"e",
id
id,
notification
);
}}
/>