Add RBAC to employees page.

This commit is contained in:
Patrick Fic
2022-01-11 12:03:09 -08:00
parent 061212f915
commit e1d5558dac

View File

@@ -7,6 +7,8 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
import AlertComponent from "../alert/alert.component"; import AlertComponent from "../alert/alert.component";
import ShopEmployeesFormComponent from "./shop-employees-form.component"; import ShopEmployeesFormComponent from "./shop-employees-form.component";
import ShopEmployeesListComponent from "./shop-employees-list.component"; import ShopEmployeesListComponent from "./shop-employees-list.component";
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
const mapStateToProps = createStructuredSelector({ const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop, bodyshop: selectBodyshop,
}); });
@@ -21,11 +23,13 @@ function ShopEmployeesContainer({ bodyshop }) {
return ( return (
<div> <div>
<ShopEmployeesListComponent <RbacWrapper action="employees:page">
employees={data ? data.employees : []} <ShopEmployeesListComponent
loading={loading} employees={data ? data.employees : []}
/> loading={loading}
<ShopEmployeesFormComponent /> />
<ShopEmployeesFormComponent />
</RbacWrapper>
</div> </div>
); );
} }