- added v1 of admin page;
This commit is contained in:
@@ -145,6 +145,22 @@ const AppSidebar = () => {
|
|||||||
id: 16,
|
id: 16,
|
||||||
enable: intersection(permissions, ['APPLY_CALLS', 'APPLY_CONFIDI_CALLS']).length
|
enable: intersection(permissions, ['APPLY_CALLS', 'APPLY_CONFIDI_CALLS']).length
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: __('Admin', 'gepafin'),
|
||||||
|
icon: 'pi pi-shield',
|
||||||
|
href: '/admin',
|
||||||
|
id: 20,
|
||||||
|
enable: intersection(permissions, [
|
||||||
|
'ROOT_MANAGE_NDG',
|
||||||
|
'ROOT_MANAGE_APPL_STATUS',
|
||||||
|
'ROOT_MANAGE_AMENDMENT_REOPEN',
|
||||||
|
'ROOT_MANAGE_AMENDMENT_EXTEND',
|
||||||
|
'ROOT_MANAGE_APPL_VIEW_DELETED',
|
||||||
|
'ROOT_MANAGE_APPL_DELETE_CONFIRM',
|
||||||
|
'ROOT_MANAGE_APPL_DELETE',
|
||||||
|
'ROOT_MANAGE_PEC_SEND'
|
||||||
|
]).length
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: __('Log di Sistema', 'gepafin'),
|
label: __('Log di Sistema', 'gepafin'),
|
||||||
icon: 'pi pi-receipt',
|
icon: 'pi pi-receipt',
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
const ManageAmendmentExtendSection = () => {
|
||||||
|
return <div className="appPageSection">
|
||||||
|
<h2>{__('Estensione soccorso istruttorio', 'gepafin')}</h2>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ManageAmendmentExtendSection;
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
const ManageAmendmentReopenSection = () => {
|
||||||
|
return <div className="appPageSection">
|
||||||
|
<h2>{__('Riapertura soccorso istruttorio', 'gepafin')}</h2>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ManageAmendmentReopenSection;
|
||||||
10
src/pages/Admin/components/ManageApplDeleteSection/index.js
Normal file
10
src/pages/Admin/components/ManageApplDeleteSection/index.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
const ManageApplDeleteSection = ({ canViewDeleted, canDeleteConfirm, canDelete }) => {
|
||||||
|
return <div className="appPageSection">
|
||||||
|
<h2>{__('Gestione domande eliminate', 'gepafin')}</h2>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ManageApplDeleteSection;
|
||||||
10
src/pages/Admin/components/ManageApplStatusSection/index.js
Normal file
10
src/pages/Admin/components/ManageApplStatusSection/index.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
const ManageApplStatusSection = () => {
|
||||||
|
return <div className="appPageSection">
|
||||||
|
<h2>{__('Gestione stato domande', 'gepafin')}</h2>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ManageApplStatusSection;
|
||||||
10
src/pages/Admin/components/ManageNdgSection/index.js
Normal file
10
src/pages/Admin/components/ManageNdgSection/index.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
|
||||||
|
const ManageNdgSection = () => {
|
||||||
|
return <div className="appPageSection">
|
||||||
|
<h2>{__('Gestione NDG', 'gepafin')}</h2>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ManageNdgSection;
|
||||||
47
src/pages/Admin/index.js
Normal file
47
src/pages/Admin/index.js
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { intersection } from 'ramda';
|
||||||
|
|
||||||
|
// store
|
||||||
|
import { useStoreValue } from '../../store';
|
||||||
|
|
||||||
|
// components
|
||||||
|
import ManageNdgSection from './components/ManageNdgSection';
|
||||||
|
import ManageApplStatusSection from './components/ManageApplStatusSection';
|
||||||
|
import ManageAmendmentReopenSection from './components/ManageAmendmentReopenSection';
|
||||||
|
import ManageAmendmentExtendSection from './components/ManageAmendmentExtendSection';
|
||||||
|
import ManageApplDeleteSection from './components/ManageApplDeleteSection';
|
||||||
|
|
||||||
|
const Admin = () => {
|
||||||
|
const permissions = useStoreValue('getPermissions');
|
||||||
|
|
||||||
|
const hasNdg = intersection(permissions, ['ROOT_MANAGE_NDG']).length > 0;
|
||||||
|
const hasApplStatus = intersection(permissions, ['ROOT_MANAGE_APPL_STATUS']).length > 0;
|
||||||
|
const hasAmendmentReopen = intersection(permissions, ['ROOT_MANAGE_AMENDMENT_REOPEN']).length > 0;
|
||||||
|
const hasAmendmentExtend = intersection(permissions, ['ROOT_MANAGE_AMENDMENT_EXTEND']).length > 0;
|
||||||
|
const hasApplDelete = intersection(permissions, [
|
||||||
|
'ROOT_MANAGE_APPL_VIEW_DELETED',
|
||||||
|
'ROOT_MANAGE_APPL_DELETE_CONFIRM',
|
||||||
|
'ROOT_MANAGE_APPL_DELETE'
|
||||||
|
]).length > 0;
|
||||||
|
|
||||||
|
const canViewDeleted = intersection(permissions, ['ROOT_MANAGE_APPL_VIEW_DELETED']).length > 0;
|
||||||
|
const canDeleteConfirm = intersection(permissions, ['ROOT_MANAGE_APPL_DELETE_CONFIRM']).length > 0;
|
||||||
|
const canDelete = intersection(permissions, ['ROOT_MANAGE_APPL_DELETE']).length > 0;
|
||||||
|
|
||||||
|
return <div className="appPage">
|
||||||
|
<div className="appPage__pageHeader"><h1>{__('Admin', 'gepafin')}</h1></div>
|
||||||
|
<div className="appPage__spacer"></div>
|
||||||
|
{hasNdg && <><ManageNdgSection/><div className="appPage__spacer"></div></>}
|
||||||
|
{hasApplStatus && <><ManageApplStatusSection/><div className="appPage__spacer"></div></>}
|
||||||
|
{hasAmendmentReopen && <><ManageAmendmentReopenSection/><div className="appPage__spacer"></div></>}
|
||||||
|
{hasAmendmentExtend && <><ManageAmendmentExtendSection/><div className="appPage__spacer"></div></>}
|
||||||
|
{hasApplDelete && <><ManageApplDeleteSection
|
||||||
|
canViewDeleted={canViewDeleted}
|
||||||
|
canDeleteConfirm={canDeleteConfirm}
|
||||||
|
canDelete={canDelete}
|
||||||
|
/><div className="appPage__spacer"></div></>}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Admin;
|
||||||
@@ -56,6 +56,7 @@ import LoginConfidi from './pages/LoginConfidi';
|
|||||||
import ResetPasswordAdmin from './pages/ResetPasswordAdmin';
|
import ResetPasswordAdmin from './pages/ResetPasswordAdmin';
|
||||||
import DashboardBeneficiarioConfidi from './pages/DashboardBeneficiarioConfidi';
|
import DashboardBeneficiarioConfidi from './pages/DashboardBeneficiarioConfidi';
|
||||||
import DashboardDirector from './pages/DashboardDirector';
|
import DashboardDirector from './pages/DashboardDirector';
|
||||||
|
import Admin from './pages/Admin';
|
||||||
|
|
||||||
const routes = ({ role, chosenCompanyId }) => {
|
const routes = ({ role, chosenCompanyId }) => {
|
||||||
|
|
||||||
@@ -287,6 +288,9 @@ const routes = ({ role, chosenCompanyId }) => {
|
|||||||
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
{'ROLE_PRE_INSTRUCTOR' === role ? <PageNotFound/> : null}
|
||||||
{'ROLE_INSTRUCTOR_MANAGER' === role ? <PageNotFound/> : null}
|
{'ROLE_INSTRUCTOR_MANAGER' === role ? <PageNotFound/> : null}
|
||||||
</DefaultLayout>}/>
|
</DefaultLayout>}/>
|
||||||
|
<Route path="/admin" element={<DefaultLayout>
|
||||||
|
<Admin/>
|
||||||
|
</DefaultLayout>}/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route exact path="/reset-password" element={<ResetPassword/>}/>
|
<Route exact path="/reset-password" element={<ResetPassword/>}/>
|
||||||
<Route exact path="/reset-password-admin" element={<ResetPasswordAdmin/>}/>
|
<Route exact path="/reset-password-admin" element={<ResetPasswordAdmin/>}/>
|
||||||
|
|||||||
Reference in New Issue
Block a user