IO-2893 Editing Shift Tickets
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { EditFilled, SyncOutlined } from "@ant-design/icons";
|
import { EditFilled, SyncOutlined } from "@ant-design/icons";
|
||||||
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Button, Card, Checkbox, Space, Table } from "antd";
|
import { Button, Card, Checkbox, Space, Table } from "antd";
|
||||||
import dayjs from "../../utils/day";
|
|
||||||
import React, { useMemo, useState } from "react";
|
import React, { useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -10,10 +10,10 @@ import { setModalContext } from "../../redux/modals/modals.actions";
|
|||||||
import { selectAuthLevel, selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectAuthLevel, selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
import { onlyUnique } from "../../utils/arrayHelper";
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
|
import dayjs from "../../utils/day";
|
||||||
import { alphaSort, dateSort } from "../../utils/sorters";
|
import { alphaSort, dateSort } from "../../utils/sorters";
|
||||||
import RbacWrapper, { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper, { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
import TimeTicketEnterButton from "../time-ticket-enter-button/time-ticket-enter-button.component";
|
import TimeTicketEnterButton from "../time-ticket-enter-button/time-ticket-enter-button.component";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -206,8 +206,7 @@ export function TimeTicketList({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
title: t("timetickets.fields.created_by"),
|
title: t("timetickets.fields.created_by"),
|
||||||
@@ -255,7 +254,8 @@ export function TimeTicketList({
|
|||||||
timeticket: record
|
timeticket: record
|
||||||
}}
|
}}
|
||||||
disabled={
|
disabled={
|
||||||
HasRbacAccess({
|
record.committed_at
|
||||||
|
? HasRbacAccess({
|
||||||
bodyshop,
|
bodyshop,
|
||||||
authLevel: authLevel,
|
authLevel: authLevel,
|
||||||
action: "timetickets:editcommitted"
|
action: "timetickets:editcommitted"
|
||||||
@@ -265,6 +265,11 @@ export function TimeTicketList({
|
|||||||
authLevel: authLevel,
|
authLevel: authLevel,
|
||||||
action: "timetickets:shiftedit"
|
action: "timetickets:shiftedit"
|
||||||
})
|
})
|
||||||
|
: HasRbacAccess({
|
||||||
|
bodyshop,
|
||||||
|
authLevel: authLevel,
|
||||||
|
action: "timetickets:shiftedit"
|
||||||
|
})
|
||||||
? disabled
|
? disabled
|
||||||
: !record.jobid
|
: !record.jobid
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user