LFFE-9 Merge branch 'feature/LFFE-9_Layout_app' into 'develop'
This commit is contained in:
@@ -1,17 +1,14 @@
|
||||
import CenterLayout from "@/layouts/CenterLayout";
|
||||
import {Container} from "@mui/material";
|
||||
import ChangePasswordForm from "@/components/dashboard/change-password/change-password-form";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
const DashboardChangePasswordComponent = () => {
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<CenterLayout>
|
||||
<Container maxWidth="sm">
|
||||
<ChangePasswordForm/>
|
||||
</Container>
|
||||
</CenterLayout>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
};
|
||||
export default DashboardChangePasswordComponent;
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardCommercialChiefComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -126,7 +125,6 @@ function DashboardCommercialChiefComponent() {
|
||||
);
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_COMMERCIAL_CHIEF}
|
||||
@@ -149,7 +147,6 @@ function DashboardCommercialChiefComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardDevelopmentAssistantComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -127,7 +126,6 @@ function DashboardDevelopmentAssistantComponent() {
|
||||
);
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_DEVELOPMENT_ASSISTANT}
|
||||
@@ -150,7 +148,6 @@ function DashboardDevelopmentAssistantComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import {UPDATE_AVATAR} from "@/core/data/apiRoutes";
|
||||
import useDirection from "@/lib/app/hooks/useDirection";
|
||||
import Notifications from "@/core/components/notifications";
|
||||
import ImageResizer from "@/core/components/ImageConvertor";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
const DashboardEditProfile = () => {
|
||||
const t = useTranslations();
|
||||
@@ -54,7 +53,6 @@ const DashboardEditProfile = () => {
|
||||
const validationSchema = Yup.object().shape({});
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<CenterLayout>
|
||||
<Container maxWidth="sm">
|
||||
<Formik
|
||||
@@ -216,7 +214,6 @@ const DashboardEditProfile = () => {
|
||||
</Formik>
|
||||
</Container>
|
||||
</CenterLayout>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import DataTable from "@/core/components/DataTable";
|
||||
import TableToolbar from "@/components/dashboard/expert-management/TableToolbar";
|
||||
import moment from "jalali-moment";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardExpertManagementComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -140,7 +139,6 @@ function DashboardExpertManagementComponent() {
|
||||
);
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_EXPERT_MANAGEMENT}
|
||||
@@ -164,7 +162,6 @@ function DashboardExpertManagementComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
|
||||
const DashboardFirstComponent = () => {
|
||||
return <DashboardLayouts></DashboardLayouts>
|
||||
return <></>
|
||||
};
|
||||
|
||||
export default DashboardFirstComponent;
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardInspectorExpertComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -126,7 +125,6 @@ function DashboardInspectorExpertComponent() {
|
||||
);
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_INSPECTOR_EXPERT}
|
||||
@@ -149,7 +147,6 @@ function DashboardInspectorExpertComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardMachinaryOfficeComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -156,7 +155,6 @@ function DashboardMachinaryOfficeComponent() {
|
||||
[]
|
||||
);
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_MACHINARY_OFFICE}
|
||||
@@ -179,7 +177,6 @@ function DashboardMachinaryOfficeComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import moment from "jalali-moment";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardNavganLoanManagementComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -136,7 +135,6 @@ function DashboardNavganLoanManagementComponent() {
|
||||
);
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_LOAN_MANAGEMENT_NAVGAN}
|
||||
@@ -159,7 +157,6 @@ function DashboardNavganLoanManagementComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardNavganProvinceManagerComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -158,7 +157,6 @@ function DashboardNavganProvinceManagerComponent() {
|
||||
);
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_NAVGAN_PROVINCE_MANAGER}
|
||||
@@ -181,7 +179,6 @@ function DashboardNavganProvinceManagerComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardPassengerOfficeComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -157,7 +156,6 @@ function DashboardPassengerOfficeComponent() {
|
||||
[]
|
||||
);
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_PASSENGER_BOSS}
|
||||
@@ -180,7 +178,6 @@ function DashboardPassengerOfficeComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardPassengerOfficeComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -157,7 +156,6 @@ function DashboardPassengerOfficeComponent() {
|
||||
[]
|
||||
);
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_PASSENGER_OFFICE}
|
||||
@@ -180,7 +178,6 @@ function DashboardPassengerOfficeComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import TableRowActions from "./TableRowActions"
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardProvinceHeadExpertComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -126,7 +125,6 @@ function DashboardProvinceHeadExpertComponent() {
|
||||
[]
|
||||
);
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_PROVINCE_HEAD_EXPERT}
|
||||
@@ -149,7 +147,6 @@ function DashboardProvinceHeadExpertComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import moment from "jalali-moment";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardRefahiLoanManagementComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -136,7 +135,6 @@ function DashboardRefahiLoanManagementComponent() {
|
||||
);
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_LOAN_MANAGEMENT_REFAHI}
|
||||
@@ -159,7 +157,6 @@ function DashboardRefahiLoanManagementComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardRefahiProvinceManagerComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -127,7 +126,6 @@ function DashboardRefahiProvinceManagerComponent() {
|
||||
);
|
||||
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_REFAHI_PROVINCE_MANAGER}
|
||||
@@ -150,7 +148,6 @@ function DashboardRefahiProvinceManagerComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import moment from "jalali-moment";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import TableToolbar from "@/components/dashboard/role-management/TableToolbar";
|
||||
import TableRowActions from "./TableRowActions"
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardRoleManagementComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -66,7 +65,7 @@ function DashboardRoleManagementComponent() {
|
||||
datatype: "numeric",
|
||||
Cell: ({renderedCellValue}) => (<Typography variant="body2">{renderedCellValue}</Typography>),
|
||||
}], []);
|
||||
return (<DashboardLayouts>
|
||||
return (
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_ROLE_MANAGEMENT}
|
||||
@@ -90,7 +89,7 @@ function DashboardRoleManagementComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>);
|
||||
);
|
||||
}
|
||||
|
||||
export default DashboardRoleManagementComponent;
|
||||
|
||||
@@ -6,7 +6,6 @@ import TableRowActions from "./TableRowActions";
|
||||
import moment from "jalali-moment";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardTransportationAssistanceComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -157,7 +156,6 @@ function DashboardTransportationAssistanceComponent() {
|
||||
[]
|
||||
);
|
||||
return (
|
||||
<DashboardLayouts>
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_TRANSPORTATION_ASSISTANCE}
|
||||
@@ -180,7 +178,6 @@ function DashboardTransportationAssistanceComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import TableToolbar from "@/components/dashboard/user-management/TableToolbar";
|
||||
import TableRowActions from "./TableRowActions"
|
||||
import ClearIcon from "@mui/icons-material/Clear";
|
||||
import DashboardLayouts from "@/components/layouts/Dashboard";
|
||||
|
||||
function DashboardUserManagementComponent() {
|
||||
const t = useTranslations();
|
||||
@@ -113,7 +112,7 @@ function DashboardUserManagementComponent() {
|
||||
</Stack>)
|
||||
}
|
||||
},], []);
|
||||
return (<DashboardLayouts>
|
||||
return (
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
tableUrl={GET_USER_MANAGEMENT}
|
||||
@@ -137,7 +136,7 @@ function DashboardUserManagementComponent() {
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
</Box>
|
||||
</DashboardLayouts>);
|
||||
);
|
||||
}
|
||||
|
||||
export default DashboardUserManagementComponent;
|
||||
|
||||
@@ -4,6 +4,7 @@ import Sidebar from "./sidebar";
|
||||
import {Toolbar} from "@mui/material";
|
||||
import BreadCrumbs from "./breadcrumbs";
|
||||
import FullPageLayout from "@/layouts/FullPageLayout";
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
|
||||
const drawerWidth = 240;
|
||||
|
||||
@@ -34,8 +35,10 @@ const DashboardLayouts = (props) => {
|
||||
>
|
||||
<Toolbar/>
|
||||
<FullPageLayout sx={{mt: 3}}>
|
||||
<RolePermissionMiddleware requiredPermissions={props.permissions}>
|
||||
<BreadCrumbs isVisible={true}/>
|
||||
{props.children}
|
||||
</RolePermissionMiddleware>
|
||||
</FullPageLayout>
|
||||
</FullPageLayout>
|
||||
</FullPageLayout>
|
||||
|
||||
20
src/layouts/index.jsx
Normal file
20
src/layouts/index.jsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import DashboardLayout from "@/layouts/DashboardLayout";
|
||||
import {Fragment} from "react";
|
||||
|
||||
const layoutList = {
|
||||
DashboardLayout
|
||||
}
|
||||
|
||||
const Layout = ({layout = {}, children}) => {
|
||||
|
||||
const Component = layoutList[layout?.name] || Fragment
|
||||
const props = layout.props || {}
|
||||
|
||||
return (
|
||||
<Component {...props}>
|
||||
{children}
|
||||
</Component>
|
||||
)
|
||||
}
|
||||
|
||||
export default Layout
|
||||
@@ -1,10 +1,10 @@
|
||||
import useUser from "@/lib/app/hooks/useUser";
|
||||
import RolePermissionComponent from "@/core/components/Middleware/RolePermissionComponent";
|
||||
|
||||
const RolePermissionMiddleware = ({children, requiredPermissions}) => {
|
||||
const RolePermissionMiddleware = ({children, requiredPermissions = []}) => {
|
||||
const {user} = useUser();
|
||||
|
||||
const hasPermission = requiredPermissions.some((permission) =>
|
||||
const hasPermission = requiredPermissions.length === 0 ? true : requiredPermissions.some((permission) =>
|
||||
user?.permissions?.includes(permission)
|
||||
);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import {UserProvider} from "@/lib/app/contexts/user";
|
||||
import "moment/locale/fa";
|
||||
import {NextIntlProvider} from "next-intl";
|
||||
import TitlePage from "@/core/components/TitlePage";
|
||||
import Layout from "@/layouts";
|
||||
|
||||
const App = ({Component, pageProps}) => {
|
||||
|
||||
@@ -19,7 +20,9 @@ const App = ({Component, pageProps}) => {
|
||||
{pageProps.messages ? <TitlePage text={pageProps.title}/> : ''}
|
||||
<LoadingProvider>
|
||||
<AppLayout isBot={pageProps.isBot}>
|
||||
<Layout layout={pageProps.layout}>
|
||||
<Component {...pageProps} />
|
||||
</Layout>
|
||||
</AppLayout>
|
||||
</LoadingProvider>
|
||||
</MuiLayout>
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import DashboardChangePasswordComponent from "@/components/dashboard/change-password";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
|
||||
export default function LoanFollowUp() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<DashboardChangePasswordComponent/>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.change_password",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout'}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardCommercialChiefComponent from "@/components/dashboard/commercial-chief";
|
||||
|
||||
const requiredPermissions = ["manage_commercial_refahi"];
|
||||
export default function CommercialChief() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardCommercialChiefComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.commercial_chief_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_commercial_refahi"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardDevelopmentAssistantComponent from "@/components/dashboard/development-assistant";
|
||||
|
||||
const requiredPermissions = ["manage_development_refahi"];
|
||||
export default function DevelopmentAssistant() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardDevelopmentAssistantComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.development_assistant_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_development_refahi"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import DashboardEditProfile from "@/components/dashboard/edit-profile";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
|
||||
export default function LoanFollowUp() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<DashboardEditProfile/>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.edit_profile",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout'}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardExpertManagementComponent from "@/components/dashboard/expert-management";
|
||||
|
||||
const requiredPermissions = ["manage_transportation_navgan"];
|
||||
export default function ExpertManagement() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardExpertManagementComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.expert_management",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_transportation_navgan"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import DashboardFirstComponent from "@/components/dashboard/first";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
|
||||
export default function Dashboard() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<DashboardFirstComponent/>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.dashboard_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout'}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardInspectorExpertComponent from "@/components/dashboard/inspector-expert";
|
||||
|
||||
const requiredPermissions = ["manage_inspector_refahi"];
|
||||
export default function InspectorExpert() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardInspectorExpertComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.inspector_expert_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_inspector_refahi"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import DashboardMachineryOfficeComponent from "@/components/dashboard/machinary-office";
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
|
||||
const requiredPermissions = ["manage_machinery_navgan"];
|
||||
export default function PassengerOffice() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardMachineryOfficeComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.machinary_office_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_machinery_navgan"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardNavganLoanManagementComponent from "@/components/dashboard/navgan-loan-management";
|
||||
|
||||
const requiredPermissions = ["manage_navgan_loan"];
|
||||
export default function NavganLoanManagement() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardNavganLoanManagementComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.loan_management_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_navgan_loan"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import DashboardNavganProvinceManagerComponent from "src/components/dashboard/navgan-province-manager";
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
|
||||
const requiredPermissions = ["manage_province_affairs_navgan"];
|
||||
export default function PassengerOffice() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardNavganProvinceManagerComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.province_manager_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_province_affairs_navgan"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import DashboardPassengerBossComponent from "@/components/dashboard/passenger-boss";
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
|
||||
const requiredPermissions = ["manage_province_working_group_navgan"];
|
||||
export default function PassengerBoss() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardPassengerBossComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.passenger_boss_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_province_working_group_navgan"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import DashboardPassengerOfficeComponent from "@/components/dashboard/passenger-office";
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
|
||||
const requiredPermissions = ["manage_passenger_office_navgan"];
|
||||
export default function PassengerOffice() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardPassengerOfficeComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.passenger_office_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_passenger_office_navgan"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardProvinceHeadExpertComponent from "@/components/dashboard/province-head-expert";
|
||||
|
||||
const requiredPermissions = ["manage_province_headquarter_refahi"];
|
||||
export default function ProvinceHeadExpertOffice() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardProvinceHeadExpertComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.province_head_expert",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_province_headquarter_refahi"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardRefahiLoanManagementComponent from "@/components/dashboard/refahi-loan-management";
|
||||
|
||||
const requiredPermissions = ["manage_refahi_loan"];
|
||||
export default function RefahiLoanManagement() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardRefahiLoanManagementComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.loan_management_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_refahi_loan"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardRefahiProvinceManagerComponent from "@/components/dashboard/refahi-province-manager";
|
||||
|
||||
const requiredPermissions = ["manage_province_affairs_refahi"];
|
||||
export default function RefahiProvinceManager() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardRefahiProvinceManagerComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.province_manager_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_province_affairs_refahi"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardRoleManagementComponent from "@/components/dashboard/role-management";
|
||||
|
||||
const requiredPermissions = ["manage_roles"];
|
||||
export default function RoleManagement() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardRoleManagementComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.role_management_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_roles"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import DashboardTransportationAssistanceComponent from "@/components/dashboard/transportation-assistance";
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
|
||||
const requiredPermissions = ["manage_transportation_navgan"];
|
||||
export default function TransportationAssistance() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardTransportationAssistanceComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.transportation_assistance",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_transportation_navgan"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import RolePermissionMiddleware from "@/middlewares/RolePermission";
|
||||
import WithAuthMiddleware from "@/middlewares/WithAuth";
|
||||
import {parse} from "next-useragent";
|
||||
import DashboardUserManagementComponent from "@/components/dashboard/user-management";
|
||||
|
||||
const requiredPermissions = ["manage_users"];
|
||||
export default function UserManagement() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
<DashboardUserManagementComponent/>
|
||||
</RolePermissionMiddleware>
|
||||
</WithAuthMiddleware>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +14,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.user_management_page",
|
||||
isBot,
|
||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_users"]}}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user