Time Ticket Task Improvmenets.
This commit is contained in:
@@ -9,13 +9,16 @@ import { createStructuredSelector } from "reselect";
|
||||
import { INSERT_TIME_TICKET_AND_APPROVE } from "../../graphql/timetickets.queries";
|
||||
import { QUERY_TT_APPROVALS_BY_IDS } from "../../graphql/tt-approvals.queries";
|
||||
import {
|
||||
selectAuthLevel,
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
} from "../../redux/user/user.selectors";
|
||||
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
currentUser: selectCurrentUser,
|
||||
authLevel: selectAuthLevel,
|
||||
});
|
||||
|
||||
export function TtApproveButton({
|
||||
@@ -23,6 +26,7 @@ export function TtApproveButton({
|
||||
currentUser,
|
||||
selectedTickets,
|
||||
disabled,
|
||||
authLevel,
|
||||
loadingCallback,
|
||||
completedCallback,
|
||||
refetch,
|
||||
@@ -83,7 +87,14 @@ export function TtApproveButton({
|
||||
};
|
||||
|
||||
return (
|
||||
<Button onClick={handleQbxml} loading={loading} disabled={disabled}>
|
||||
<Button
|
||||
onClick={handleQbxml}
|
||||
loading={loading}
|
||||
disabled={
|
||||
disabled ||
|
||||
!HasRbacAccess({ bodyshop, authLevel, action: "ttapprovals:approve" })
|
||||
}
|
||||
>
|
||||
{t("tt_approvals.actions.approveselected")}
|
||||
</Button>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user