feature/IO-3103-Ant5-Notifications
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, Card, Form, Input, notification, Switch } from "antd";
|
||||
import { Button, Card, Form, Input, Switch } from "antd";
|
||||
import queryString from "query-string";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -16,6 +16,7 @@ import AuditTrailMapping from "../../../../utils/AuditTrailMappings";
|
||||
import dayjs from "../../../../utils/day";
|
||||
import ConfigFormComponents from "../../../config-form-components/config-form-components.component";
|
||||
import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component";
|
||||
import { useNotification } from "../../../../contexts/Notifications/notificationContext.jsx";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -32,6 +33,7 @@ export function JobChecklistForm({ insertAuditTrail, formItems, bodyshop, curren
|
||||
const [markAptArrived] = useMutation(MARK_APPOINTMENT_ARRIVED);
|
||||
const [markLatestAptArrived] = useMutation(MARK_LATEST_APPOINTMENT_ARRIVED);
|
||||
const [updateOwner] = useMutation(UPDATE_OWNER);
|
||||
const notification = useNotification();
|
||||
|
||||
const { jobId } = useParams();
|
||||
const history = useNavigate();
|
||||
|
||||
@@ -6,12 +6,14 @@ import { useParams } from "react-router-dom";
|
||||
import { logImEXEvent } from "../../../../firebase/firebase.utils";
|
||||
import { GenerateDocument, GenerateDocuments } from "../../../../utils/RenderTemplate";
|
||||
import { TemplateList } from "../../../../utils/TemplateConstants";
|
||||
import { useNotification } from "../../../../contexts/Notifications/notificationContext.jsx";
|
||||
const TemplateListGenerated = TemplateList();
|
||||
|
||||
export default function JobIntakeTemplateList({ templates }) {
|
||||
const { jobId } = useParams();
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const notification = useNotification();
|
||||
|
||||
const renderTemplate = async (templateKey) => {
|
||||
setLoading(true);
|
||||
@@ -23,7 +25,9 @@ export default function JobIntakeTemplateList({ templates }) {
|
||||
variables: { id: jobId }
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
"p",
|
||||
null,
|
||||
notification
|
||||
);
|
||||
setLoading(false);
|
||||
};
|
||||
@@ -35,7 +39,8 @@ export default function JobIntakeTemplateList({ templates }) {
|
||||
await GenerateDocuments(
|
||||
templates.map((key) => {
|
||||
return { name: key, variables: { id: jobId } };
|
||||
})
|
||||
}),
|
||||
notification
|
||||
);
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user