- Progress

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-04-16 15:36:27 -04:00
parent 34d773bcd8
commit bb205af019
8 changed files with 323 additions and 105 deletions

View File

@@ -266,6 +266,9 @@ export function TaskUpsertModalComponent({
</Form.Item>
</Col>
<Col span={8}>
<Form.Item name="remind_at_sent" hidden>
<Input />
</Form.Item>
<Form.Item
label={t("tasks.fields.remind_at")}
name="remind_at"

View File

@@ -168,30 +168,6 @@ export function TaskUpsertModalContainer({ bodyshop, currentUser, taskUpsert, to
});
}
// if (isAssignedToDirty) {
// // TODO This is being moved serverside
// axios
// .post("/sendemail", {
// from: {
// name: bodyshop.shopname,
// address: bodyshop.email
// },
// ReplyTo: {
// Email: "noreply@imex.online"
// },
// to: values.assigned_to,
// subject: `A Task has been re-assigned to you on ${bodyshop.shopname} - ${values.title}`,
// templateStrings: {
// header: values.title,
// subHeader: `Assigned by ${currentUser.email} ${values.due_at ? `| Due on ${dayjs(values.due_at).format("MM/DD/YYYY")}` : ""}`,
// body: `<a href="${window.location.protocol}//${window.location.host}/manage/tasks/alltasks?taskid=${existingTask.id}">Please sign in to your account to view the task details.</a>`
// }
// })
// .catch((e) =>
// console.error(`Something went wrong sending email to Assigned party on Task creation. ${e.message || ""}`)
// );
// }
notification["success"]({
message: t("tasks.successes.updated")
});
@@ -233,30 +209,6 @@ export function TaskUpsertModalContainer({ bodyshop, currentUser, taskUpsert, to
form.resetFields();
toggleModalVisible();
// send notification to the assigned user
// TODO: This is being moved serverside
// axios
// .post("/sendemail", {
// from: {
// name: bodyshop.shopname,
// address: bodyshop.email
// },
// replyTo: {
// Email: "noreply@imex.online"
// },
// to: values.assigned_to,
// subject: `A new Task has been assigned to you on ${bodyshop.shopname} - ${values.title}`,
// templateName: "taskAssigned",
// templateStrings: {
// header: values.title,
// subHeader: `Assigned by ${currentUser.email} ${values.due_at ? `| Due on ${dayjs(values.due_at).format("MM/DD/YYYY")}` : ""}`,
// body: `<a href="${window.location.protocol}//${window.location.host}/manage/tasks/alltasks?taskid=${newTaskID}">Please sign to your account to view the task details.</a>`
// }
// })
// .catch((e) =>
// console.error(`Something went wrong sending email to Assigned party on Task edit. ${e.message || ""}`)
// );
notification["success"]({
message: t("tasks.successes.created")
});
@@ -276,6 +228,7 @@ export function TaskUpsertModalContainer({ bodyshop, currentUser, taskUpsert, to
}
return acc;
}, {});
console.dir(dirtyValues?.remind_at_sent);
try {
await handleExistingTask(taskSource.id, taskSource.jobid, dirtyValues);
} catch (e) {

View File

@@ -15,6 +15,7 @@ export const PARTIAL_TASK_FIELDS = gql`
completed
completed_at
remind_at
remind_at_sent
priority
job {
id
@@ -63,10 +64,6 @@ export const PARTIAL_TASK_FIELDS = gql`
}
`;
export const PARTIAL_TASK_FIELDS_WRAPPER = gql`
${PARTIAL_TASK_FIELDS}
`;
export const QUERY_GET_TASK_BY_ID = gql`
${PARTIAL_TASK_FIELDS}
query QUERY_GET_TASK_BY_ID($id: uuid!) {