- added v1 of admin page;
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user