Added RBAC for Time Ticket Edit IO-428
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user