feature/IO-3291-Tasks-Notifications: Checkpoint
This commit is contained in:
@@ -7,6 +7,7 @@ import { connect } from "react-redux";
|
||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component.jsx";
|
||||
import JobSearchSelectComponent from "../job-search-select/job-search-select.component.jsx";
|
||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component.jsx";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -41,7 +42,7 @@ export function TaskUpsertModalComponent({
|
||||
];
|
||||
|
||||
const generatePresets = (job) => {
|
||||
if (!job || !selectedJobDetails) return datePickerPresets; // return default presets if no job selected
|
||||
if (!job || !selectedJobDetails) return datePickerPresets;
|
||||
const relativePresets = [];
|
||||
|
||||
if (selectedJobDetails?.scheduled_completion) {
|
||||
@@ -96,13 +97,8 @@ export function TaskUpsertModalComponent({
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Change the selected job id
|
||||
* @param jobId
|
||||
*/
|
||||
const changeJobId = (jobId) => {
|
||||
setSelectedJobId(jobId || null);
|
||||
// Reset the form fields when selectedJobId changes
|
||||
clearRelations();
|
||||
};
|
||||
|
||||
@@ -162,6 +158,13 @@ export function TaskUpsertModalComponent({
|
||||
required: true
|
||||
}
|
||||
]}
|
||||
extra={
|
||||
existingTask && selectedJobId ? (
|
||||
<div style={{ textAlign: "right" }}>
|
||||
<Link to={`/manage/jobs/${selectedJobId}`}>{t("tasks.labels.go_to_job")}</Link>
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
>
|
||||
<JobSearchSelectComponent
|
||||
placeholder={t("tasks.placeholders.jobid")}
|
||||
@@ -202,7 +205,18 @@ export function TaskUpsertModalComponent({
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label={t("tasks.fields.billid")} name="billid">
|
||||
<Form.Item
|
||||
label={t("tasks.fields.billid")}
|
||||
name="billid"
|
||||
extra={
|
||||
form.getFieldValue("billid") ? (
|
||||
<Link to={`/manage/bills?billid=${form.getFieldValue("billid")}`}>
|
||||
{t("tasks.links.go_to_bill")} (
|
||||
{selectedJobDetails?.bills?.find((bill) => bill.id === form.getFieldValue("billid"))?.invoice_number})
|
||||
</Link>
|
||||
) : null
|
||||
}
|
||||
>
|
||||
<Select
|
||||
allowClear
|
||||
placeholder={t("tasks.placeholders.billid")}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMutation, useQuery } from "@apollo/client";
|
||||
import { Form, Modal } from "antd";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
|
||||
Reference in New Issue
Block a user