feature/IO-3103-Ant5-Notifications
This commit is contained in:
@@ -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
|
||||
);
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user