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

@@ -12,7 +12,7 @@ import CsiResponseListPaginated from "../../components/csi-response-list-paginat
import { QUERY_CSI_RESPONSE_PAGINATED } from "../../graphql/csi.queries";
import { setBreadcrumbs } from "../../redux/application/application.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
@@ -61,19 +61,26 @@ export function ShopCsiContainer({ bodyshop, setBreadcrumbs }) {
if (error) return <AlertComponent message={error.message} type="error" />;
return (
<Row>
<Col span={10}>
<CsiResponseListPaginated
refetch={refetch}
loading={loading}
responses={data ? data.csi : []}
total={data ? data.csi_aggregate.aggregate.count : 0}
/>
</Col>
<Col span={13} offset={1}>
<CsiResponseFormContainer />
</Col>
</Row>
<RbacWrapper
action="csi:page"
// noauth={
// <AlertComponent message="You don't have acess to see this screen." />
// }
>
<Row>
<Col span={10}>
<CsiResponseListPaginated
refetch={refetch}
loading={loading}
responses={data ? data.csi : []}
total={data ? data.csi_aggregate.aggregate.count : 0}
/>
</Col>
<Col span={13} offset={1}>
<CsiResponseFormContainer />
</Col>
</Row>
</RbacWrapper>
);
}
export default connect(mapStateToProps, mapDispatchToProps)(ShopCsiContainer);