Add audit trail and resolve status update.
This commit is contained in:
@@ -64,7 +64,9 @@ export function TimeTicketTaskModalComponent({
|
||||
options={bodyshop.md_tasks_presets.presets.map((preset) => ({
|
||||
value: preset.name,
|
||||
label: preset.name,
|
||||
disabled: completedTasks.includes(preset.name),
|
||||
disabled: completedTasks
|
||||
.map((task) => task.name)
|
||||
.includes(preset.name),
|
||||
}))}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -7,15 +7,21 @@ import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||
import { selectTimeTicketTasks } from "../../redux/modals/modals.selectors";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import {
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
} from "../../redux/user/user.selectors";
|
||||
import TimeTicketTaskModalComponent from "./time-ticket-task-modal.component";
|
||||
import { useApolloClient } from "@apollo/client";
|
||||
import { QUERY_COMPLETED_TASKS } from "../../graphql/jobs.queries";
|
||||
import "./time-ticket-task-modal.styles.scss";
|
||||
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
timeTicketTasksModal: selectTimeTicketTasks,
|
||||
bodyshop: selectBodyshop,
|
||||
currentUser: selectCurrentUser,
|
||||
technician: selectTechnician,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
toggleModalVisible: () => dispatch(toggleModalVisible("timeTicketTask")),
|
||||
@@ -27,6 +33,8 @@ export default connect(
|
||||
|
||||
export function TimeTickeTaskModalContainer({
|
||||
bodyshop,
|
||||
currentUser,
|
||||
technician,
|
||||
timeTicketTasksModal,
|
||||
toggleModalVisible,
|
||||
}) {
|
||||
@@ -80,6 +88,12 @@ export function TimeTickeTaskModalContainer({
|
||||
jobid: values.jobid,
|
||||
task: values.task,
|
||||
calculateOnly: !handleFinish,
|
||||
employee: technician
|
||||
? {
|
||||
name: `${technician.first_name} ${technician.last_name}`.trim(),
|
||||
employeeid: technician.id,
|
||||
}
|
||||
: { name: currentUser.displayName, email: currentUser.email },
|
||||
});
|
||||
if (response.status === 200 && handleFinish) {
|
||||
//Close the modal
|
||||
|
||||
Reference in New Issue
Block a user