Added basic RBAC component BOD-232

This commit is contained in:
Patrick Fic
2020-08-10 16:07:30 -07:00
parent 0df61a2701
commit 83c83ac06e
52 changed files with 670 additions and 288 deletions

View File

@@ -7,6 +7,7 @@ import { useLocation } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import AlertComponent from "../../components/alert/alert.component";
import PaymentsListPaginated from "../../components/payments-list-paginated/payment-list-paginated.component";
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
import { QUERY_ALL_PAYMENTS_PAGINATED } from "../../graphql/payments.queries";
import { setBreadcrumbs } from "../../redux/application/application.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
@@ -53,15 +54,17 @@ export function AllJobs({ bodyshop, setBreadcrumbs }) {
if (error) return <AlertComponent message={error.message} type="error" />;
return (
<div>
<PaymentsListPaginated
refetch={refetch}
loading={loading}
searchParams={searchParams}
total={data ? data.search_payments_aggregate.aggregate.count : 0}
payments={data ? data.search_payments : []}
/>
</div>
<RbacWrapper action="payments:list">
<div>
<PaymentsListPaginated
refetch={refetch}
loading={loading}
searchParams={searchParams}
total={data ? data.search_payments_aggregate.aggregate.count : 0}
payments={data ? data.search_payments : []}
/>
</div>
</RbacWrapper>
);
}