Added status state machine BOD-251
This commit is contained in:
@@ -84,7 +84,6 @@ export function JobsDetailPage({
|
||||
mutationUpdateJob,
|
||||
handleSubmit,
|
||||
refetch,
|
||||
updateJobStatus,
|
||||
bodyshop,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
@@ -155,7 +154,6 @@ export function JobsDetailPage({
|
||||
job={job}
|
||||
refetch={refetch}
|
||||
handleSubmit={handleSubmit}
|
||||
updateJobStatus={updateJobStatus}
|
||||
loading={loading}
|
||||
/>
|
||||
<Tabs
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
import { useMutation, useQuery } from "@apollo/react-hooks";
|
||||
import { notification } from "antd";
|
||||
import React, { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
import SpinComponent from "../../components/loading-spinner/loading-spinner.component";
|
||||
import NotFound from "../../components/not-found/not-found.component";
|
||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||
import {
|
||||
GET_JOB_BY_PK,
|
||||
UPDATE_JOB,
|
||||
UPDATE_JOB_STATUS,
|
||||
} from "../../graphql/jobs.queries";
|
||||
import { GET_JOB_BY_PK, UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import {
|
||||
addRecentItem,
|
||||
setBreadcrumbs,
|
||||
} from "../../redux/application/application.actions";
|
||||
import { CreateRecentItem } from "../../utils/create-recent-item";
|
||||
import JobsDetailPage from "./jobs-detail.page.component";
|
||||
import NotFound from "../../components/not-found/not-found.component";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||
@@ -33,20 +28,6 @@ function JobsDetailPageContainer({ match, setBreadcrumbs, addRecentItem }) {
|
||||
fetchPolicy: "network-only",
|
||||
});
|
||||
const [mutationUpdateJob] = useMutation(UPDATE_JOB);
|
||||
const [mutationUpdateJobstatus] = useMutation(UPDATE_JOB_STATUS);
|
||||
|
||||
const updateJobStatus = (status) => {
|
||||
mutationUpdateJobstatus({
|
||||
variables: { jobId: jobId, status: status },
|
||||
})
|
||||
.then((r) => {
|
||||
notification["success"]({ message: t("jobs.successes.save") });
|
||||
refetch();
|
||||
})
|
||||
.catch((error) => {
|
||||
notification[error]({ message: t("jobs.errors.saving") });
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
document.title = loading
|
||||
@@ -98,7 +79,6 @@ function JobsDetailPageContainer({ match, setBreadcrumbs, addRecentItem }) {
|
||||
job={data.jobs_by_pk}
|
||||
mutationUpdateJob={mutationUpdateJob}
|
||||
refetch={refetch}
|
||||
updateJobStatus={updateJobStatus}
|
||||
/>
|
||||
</RbacWrapper>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user