Added basic RBAC component BOD-232
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import React, { useEffect } from "react";
|
||||
import CourtesyCarsPageComponent from "./courtesy-cars.page.component";
|
||||
import { useQuery } from "@apollo/react-hooks";
|
||||
import React, { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||
import { QUERY_ALL_CC } from "../../graphql/courtesy-car.queries";
|
||||
import { setBreadcrumbs } from "../../redux/application/application.actions";
|
||||
import { connect } from "react-redux";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CourtesyCarsPageComponent from "./courtesy-cars.page.component";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||
@@ -21,13 +22,15 @@ export function CourtesyCarsPageContainer({ setBreadcrumbs }) {
|
||||
{ link: "/manage/courtesycars", label: t("titles.bc.courtesycars") },
|
||||
]);
|
||||
}, [setBreadcrumbs, t]);
|
||||
if (error) return <AlertComponent message={error.message} type='error' />;
|
||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||
return (
|
||||
<CourtesyCarsPageComponent
|
||||
loading={loading}
|
||||
data={(data && data.courtesycars) || []}
|
||||
refetch={refetch}
|
||||
/>
|
||||
<RbacWrapper action="courtesycar:list">
|
||||
<CourtesyCarsPageComponent
|
||||
loading={loading}
|
||||
data={(data && data.courtesycars) || []}
|
||||
refetch={refetch}
|
||||
/>
|
||||
</RbacWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user