Added RBAC for Time Ticket Edit IO-428
This commit is contained in:
@@ -4024,6 +4024,27 @@
|
||||
<folder_node>
|
||||
<name>timetickets</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>edit</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>enter</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -405,6 +405,18 @@ export default function ShopInfoRbacComponent({ form }) {
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.rbac.timetickets.edit")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
name={["md_rbac", "timetickets:edit"]}
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.rbac.shop.vendors")}
|
||||
rules={[
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Table } from "antd";
|
||||
import moment from "moment";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import { DateFormatter } from "../../utils/DateFormatter";
|
||||
import TimeTicketEnterButton from "../time-ticket-enter-button/time-ticket-enter-button.component";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import moment from "moment";
|
||||
import { onlyUnique } from "../../utils/arrayHelper";
|
||||
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||
import TimeTicketEnterButton from "../time-ticket-enter-button/time-ticket-enter-button.component";
|
||||
|
||||
export default function TimeTicketList({
|
||||
disabled,
|
||||
@@ -128,12 +128,14 @@ export default function TimeTicketList({
|
||||
}
|
||||
},
|
||||
},
|
||||
!!techConsole
|
||||
? {
|
||||
title: t("general.labels.actions"),
|
||||
dataIndex: "actions",
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
|
||||
({
|
||||
title: t("general.labels.actions"),
|
||||
dataIndex: "actions",
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
{!!techConsole && (
|
||||
<TimeTicketEnterButton
|
||||
actions={{ refetch }}
|
||||
context={{ id: record.id, timeticket: record }}
|
||||
@@ -141,9 +143,29 @@ export default function TimeTicketList({
|
||||
>
|
||||
{t("general.actions.edit")}
|
||||
</TimeTicketEnterButton>
|
||||
),
|
||||
}
|
||||
: null,
|
||||
)}
|
||||
{!techConsole && (
|
||||
<RbacWrapper
|
||||
action="timetickets:edit"
|
||||
noauth={() => {
|
||||
return <div />;
|
||||
}}
|
||||
>
|
||||
<TimeTicketEnterButton
|
||||
actions={{ refetch }}
|
||||
context={{
|
||||
id: record.id,
|
||||
timeticket: record,
|
||||
}}
|
||||
disabled={!!!record.jobid || disabled}
|
||||
>
|
||||
{t("general.actions.edit")}
|
||||
</TimeTicketEnterButton>
|
||||
</RbacWrapper>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
}: null),
|
||||
];
|
||||
|
||||
const handleTableChange = (pagination, filters, sorter) => {
|
||||
|
||||
@@ -181,6 +181,7 @@ export function TimeTicketModalContainer({
|
||||
jobid:
|
||||
(timeTicketModal.context.timeticket.job &&
|
||||
timeTicketModal.context.timeticket.job.id) ||
|
||||
timeTicketModal.context.timeticket.jobid ||
|
||||
null,
|
||||
date: timeTicketModal.context.timeticket.date
|
||||
? moment(timeTicketModal.context.date)
|
||||
|
||||
@@ -36,6 +36,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE = gql`
|
||||
rate
|
||||
productivehrs
|
||||
memo
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
|
||||
@@ -277,6 +277,7 @@
|
||||
"vendors": "Shop -> Vendors"
|
||||
},
|
||||
"timetickets": {
|
||||
"edit": "Time Tickets -> Edit",
|
||||
"enter": "Time Tickets -> Enter",
|
||||
"list": "Time Tickets -> List"
|
||||
}
|
||||
|
||||
@@ -277,6 +277,7 @@
|
||||
"vendors": ""
|
||||
},
|
||||
"timetickets": {
|
||||
"edit": "",
|
||||
"enter": "",
|
||||
"list": ""
|
||||
}
|
||||
|
||||
@@ -277,6 +277,7 @@
|
||||
"vendors": ""
|
||||
},
|
||||
"timetickets": {
|
||||
"edit": "",
|
||||
"enter": "",
|
||||
"list": ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user