diff --git a/src/layouts/DefaultLayout/components/AppSidebar/index.js b/src/layouts/DefaultLayout/components/AppSidebar/index.js index 2fbbdbb..840e734 100644 --- a/src/layouts/DefaultLayout/components/AppSidebar/index.js +++ b/src/layouts/DefaultLayout/components/AppSidebar/index.js @@ -32,21 +32,21 @@ const AppSidebar = () => { icon: 'pi pi-file', href: '/imieibandi', id: 3, - enable: intersection(permissions, ['APPLY_CALLS']).length + enable: intersection(permissions, ['APPLY_CALLS', 'APPLY_CONFIDI_CALLS']).length }, { label: __('Bandi disponibili', 'gepafin'), icon: 'pi pi-bookmark', href: '/bandi', id: 4, - enable: intersection(permissions, ['VIEW_CALLS']).length + enable: intersection(permissions, ['VIEW_CALLS', 'VIEW_CONFIDI_CALLS']).length }, { label: __('Bandi osservati', 'gepafin'), icon: 'pi pi-star', href: '/bandi-osservati', id: 5, - enable: intersection(permissions, ['VIEW_CALLS']).length + enable: intersection(permissions, ['VIEW_CALLS', 'VIEW_CONFIDI_CALLS']).length }, { label: __('Gestione domande', 'gepafin'), @@ -81,7 +81,7 @@ const AppSidebar = () => { icon: 'pi pi-briefcase', href: '/domande', id: 10, - enable: intersection(permissions, ['APPLY_CALLS']).length + enable: intersection(permissions, ['APPLY_CALLS', 'APPLY_CONFIDI_CALLS']).length }, { label: __('Archivio domande', 'gepafin'), @@ -136,14 +136,14 @@ const AppSidebar = () => { icon: 'pi pi-chart-bar', href: '/stats', id: 15, - enable: intersection(permissions, ['APPLY_CALLS']).length + enable: intersection(permissions, ['APPLY_CALLS', 'APPLY_CONFIDI_CALLS']).length }, { label: __('Documenti', 'gepafin'), icon: 'pi pi-folder-open', href: '/documenti', id: 16, - enable: intersection(permissions, ['APPLY_CALLS']).length + enable: intersection(permissions, ['APPLY_CALLS', 'APPLY_CONFIDI_CALLS']).length }, { label: __('Log di Sistema', 'gepafin'), diff --git a/src/pages/BandoApplication/index.js b/src/pages/BandoApplication/index.js index 187325e..557ecae 100644 --- a/src/pages/BandoApplication/index.js +++ b/src/pages/BandoApplication/index.js @@ -14,6 +14,7 @@ import { storeSet, storeGet, useStore } from '../../store'; // api import ApplicationService from '../../service/application-service'; +import CompanyDocumentsService from '../../service/company-documents-service'; // tools import { @@ -33,6 +34,7 @@ import renderWithDataVars from '../../helpers/renderWithDataVars'; import getTokens from '../../helpers/getTokens'; import formatDateString from '../../helpers/formatDateString'; import isDateTimeInPast from '../../helpers/isDateTimeInPast'; +import parseCommaDecimal from '../../helpers/parseCommaDecimal'; // components import { Skeleton } from 'primereact/skeleton'; @@ -46,8 +48,8 @@ import { Dialog } from 'primereact/dialog'; import FileuploadApplicationSignedPdf from '../../components/FileuploadApplicationSignedPdf'; import { defaultMaxFileSize } from '../../configData'; -import parseCommaDecimal from '../../helpers/parseCommaDecimal'; -import CompanyDocumentsService from '../../service/company-documents-service'; + +const APP_HUB_ID = process.env.REACT_APP_HUB_ID; const BandoApplication = () => { const chosenCompanyId = useStore().main.chosenCompanyId(); @@ -652,12 +654,6 @@ const BandoApplication = () => { ['companyId', chosenCompanyId] ]); CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, getDocsCallback, errDocsGetCallbacks); - /*CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, (resp) => getDocsCallback(resp, 'COMPANY_DOCUMENT'), errDocsGetCallbacks, [ - ['documentType', 'COMPANY_DOCUMENT'] - ]); - CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, (resp) => getDocsCallback(resp, 'PERSONAL_DOCUMENT'), errDocsGetCallbacks, [ - ['documentType', 'PERSONAL_DOCUMENT'] - ]);*/ } }, [id, chosenCompanyId]); @@ -690,7 +686,10 @@ const BandoApplication = () => { setVisibleConfirmation(false); }}>

- {__('Grazie, la tua domanda è stata inviata correttamente. Entro 24 ore riceverai una pec con data, ora e numero di protocollo.', 'gepafin')} + {APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE' + ? __('Grazie, la tua domanda è stata inviata correttamente. Entro 24 ore riceverai una email con data, ora e numero di protocollo.', 'gepafin') + : __('Grazie, la tua domanda è stata inviata correttamente. Entro 24 ore riceverai una pec con data, ora e numero di protocollo.', 'gepafin') + }

@@ -750,9 +749,9 @@ const BandoApplication = () => { return acc; }, {}); - if (o.name === 'fileselect') { + /*if (o.name === 'fileselect') { console.log('options::', options) - } + }*/ return ['paragraph'].includes(o.name) && text ?
diff --git a/src/pages/Login/index.js b/src/pages/Login/index.js index c7047cf..3ee1205 100644 --- a/src/pages/Login/index.js +++ b/src/pages/Login/index.js @@ -118,9 +118,12 @@ const Login = () => { /*if ('t7jh5wfg9QXylNaTZkPoE' === APP_HUB_ID) { setIsMaintenance(true); }*/ - hotkeys('command+x,ctrl+x', function(event, handler){ + hotkeys('command+x,ctrl+x', function(){ window.location.replace('/loginadmin') }); + hotkeys('command+shift+x,ctrl+shift+x', function(){ + window.location.replace('/confidi') + }); }, []); return ( diff --git a/src/pages/LoginAdmin/index.js b/src/pages/LoginAdmin/index.js index 0fb1e3d..96d6466 100644 --- a/src/pages/LoginAdmin/index.js +++ b/src/pages/LoginAdmin/index.js @@ -16,6 +16,7 @@ import FormField from '../../components/FormField'; import LogoIcon from '../../icons/LogoIcon'; import { Button } from 'primereact/button'; import { Messages } from 'primereact/messages'; +import hotkeys from 'hotkeys-js'; const APP_HUB_ID = process.env.REACT_APP_HUB_ID; @@ -31,7 +32,7 @@ const LoginAdmin = () => { } = useForm({ mode: 'onChange' }); const gotToResetPassword = () => { - navigate('/reset-password'); + navigate('/reset-password-admin'); } const onSubmit = (formData) => { @@ -78,12 +79,18 @@ const LoginAdmin = () => { } }, [token]); + useEffect(() => { + hotkeys('command+shift+x,ctrl+shift+x', function(){ + window.location.replace('/confidi') + }); + }, []); + return (
-

{__('Accedi o Registrati', 'gepafin')}

+

{__('Accedi', 'gepafin')}

diff --git a/src/pages/LoginConfidi/index.js b/src/pages/LoginConfidi/index.js new file mode 100644 index 0000000..4042d7d --- /dev/null +++ b/src/pages/LoginConfidi/index.js @@ -0,0 +1,133 @@ +import React, { useRef, useState, useEffect } from 'react'; +import { __, sprintf } from '@wordpress/i18n'; +import { useForm } from 'react-hook-form'; +import { classNames } from 'primereact/utils'; +import { isEmpty } from 'ramda'; +import { useNavigate } from 'react-router-dom'; + +// tools +import AuthenticationService from '../../service/authentication-service'; + +// store +import { storeSet, useStore } from '../../store'; + +// components +import FormField from '../../components/FormField'; +import LogoIcon from '../../icons/LogoIcon'; +import { Button } from 'primereact/button'; +import { Messages } from 'primereact/messages'; +import hotkeys from 'hotkeys-js'; + +const APP_HUB_ID = process.env.REACT_APP_HUB_ID; + +const LoginConfidi = () => { + const navigate = useNavigate(); + const token = useStore().main.token(); + const [loading, setLoading] = useState(false); + const errorMsgs = useRef(null); + const { + control, + handleSubmit, + formState: { errors }, + } = useForm({ mode: 'onChange' }); + + const gotToResetPassword = () => { + navigate('/reset-password'); + } + + const onSubmit = (formData) => { + errorMsgs.current.clear(); + setLoading(true); + const request = { + ...formData, + hubUuid: APP_HUB_ID, + rememberMe: true + } + + AuthenticationService.login(request, loginCallback, loginError); + }; + + const loginCallback = (data) => { + if (data.status === 'SUCCESS') { + storeSet.main.setAuthData({ + token: data.data.token, + userData: data.data.user + }); + } else { + errorMsgs.current.show([ + { sticky: true, severity: 'error', summary: '', + detail: data.message, + closable: true } + ]); + } + setLoading(false); + } + + const loginError = (err) => { + errorMsgs.current.show([ + { sticky: true, severity: 'error', summary: '', + detail: sprintf(__('%s', 'gepafin'), err.message), + closable: true } + ]); + setLoading(false); + } + + useEffect(() => { + if (!isEmpty(token)) { + setLoading(true); + window.location.replace('/') + } + }, [token]); + + useEffect(() => { + hotkeys('command+x,ctrl+x', function(){ + window.location.replace('/loginadmin') + }); + }, []); + + return ( +
+
+ + +

{__('Accedi', 'gepafin')}

+ + + +
+ +
+ + + + +
+
+ ) +} + +export default LoginConfidi; \ No newline at end of file diff --git a/src/pages/ResetPassword/index.js b/src/pages/ResetPassword/index.js index 6f3364d..dbe20eb 100644 --- a/src/pages/ResetPassword/index.js +++ b/src/pages/ResetPassword/index.js @@ -36,8 +36,8 @@ const ResetPassword = () => { setValue } = useForm({ mode: 'onChange' }); - const gotToLoginAdmin = () => { - navigate('/loginadmin'); + const gotToLogin = () => { + navigate('/confidi'); } const onSubmit = (formData) => { @@ -110,7 +110,6 @@ const ResetPassword = () => { }, [token]); useEffect(() => { - console.log(resetPassToken, resetPassEmail); reset(); setValue('token', resetPassToken); setValue('email', resetPassEmail); @@ -191,7 +190,7 @@ const ResetPassword = () => {
diff --git a/src/pages/ResetPasswordAdmin/index.js b/src/pages/ResetPasswordAdmin/index.js new file mode 100644 index 0000000..df9f7d7 --- /dev/null +++ b/src/pages/ResetPasswordAdmin/index.js @@ -0,0 +1,200 @@ +import React, { useRef, useState, useEffect } from 'react'; +import { __, sprintf } from '@wordpress/i18n'; +import { useForm } from 'react-hook-form'; +import { classNames } from 'primereact/utils'; +import { isEmpty } from 'ramda'; +import { useNavigate, useSearchParams } from 'react-router-dom'; + +// tools +import AuthenticationService from '../../service/authentication-service'; + +// store +import { useStore } from '../../store'; + +// components +import FormField from '../../components/FormField'; +import LogoIcon from '../../icons/LogoIcon'; +import { Button } from 'primereact/button'; +import { Messages } from 'primereact/messages'; + +const APP_HUB_ID = process.env.REACT_APP_HUB_ID; + +const ResetPasswordAdmin = () => { + const navigate = useNavigate(); + const token = useStore().main.token(); + const [loading, setLoading] = useState(false); + const [resetPassToken, setResetPassToken] = useState(''); + const [resetPassEmail, setResetPassEmail] = useState(''); + const errorMsgs = useRef(null); + let [searchParams] = useSearchParams(); + const { + control, + handleSubmit, + formState: { errors }, + reset, + register, + setValue + } = useForm({ mode: 'onChange' }); + + const gotToLogin = () => { + navigate('/loginadmin'); + } + + const onSubmit = (formData) => { + errorMsgs.current.clear(); + setLoading(true); + const request = { + ...formData, + hubUuid: APP_HUB_ID + } + + if (request.token && !isEmpty(request.token)) { + AuthenticationService.resetPassword(request, getCallbackReset, errCallback); + } else { + AuthenticationService.forgotPassword(request, getCallback, errCallback); + } + }; + + const getCallbackReset = (data) => { + if (data.status === 'SUCCESS') { + errorMsgs.current.show([ + { + sticky: true, severity: 'success', summary: '', + detail: data.message, + closable: true + } + ]); + } else { + errorMsgs.current.show([ + { + sticky: true, severity: 'error', summary: '', + detail: data.message, + closable: true + } + ]); + } + setLoading(false); + } + + const getCallback = (data) => { + if (data.status === 'SUCCESS') { + setResetPassToken(data.data) + } else { + errorMsgs.current.show([ + { + sticky: true, severity: 'error', summary: '', + detail: data.message, + closable: true + } + ]); + } + setLoading(false); + } + + const errCallback = (err) => { + errorMsgs.current.show([ + { + sticky: true, severity: 'error', summary: '', + detail: sprintf(__('%s', 'gepafin'), err.message), + closable: true + } + ]); + setLoading(false); + } + + useEffect(() => { + if (!isEmpty(token)) { + setLoading(true); + window.location.replace('/') + } + }, [token]); + + useEffect(() => { + reset(); + setValue('token', resetPassToken); + setValue('email', resetPassEmail); + }, [resetPassToken, resetPassEmail]); + + useEffect(() => { + const token = searchParams.get('token'); + const email = searchParams.get('email'); + setResetPassToken(token); + setResetPassEmail(email); + }, [searchParams]); + + return ( +
+
+ + +

{__('Password dimenticata', 'gepafin')}

+ + + +
+ +
+ + + {resetPassToken && !isEmpty(resetPassToken) + ? : null} + + {resetPassToken && !isEmpty(resetPassToken) + ? values.confirmPassword === value + } + }} + /> : null} + + {resetPassToken && !isEmpty(resetPassToken) + ? values.newPassword === value + } + }} + /> : null} + +
+
+ ) +} + +export default ResetPasswordAdmin; \ No newline at end of file diff --git a/src/pages/Users/components/AllUsersTable/index.js b/src/pages/Users/components/AllUsersTable/index.js index 26f2556..8d3ff72 100644 --- a/src/pages/Users/components/AllUsersTable/index.js +++ b/src/pages/Users/components/AllUsersTable/index.js @@ -54,7 +54,9 @@ const AllUsersTable = () => { const getFormattedData = (data) => { return data - .filter(o => ['ROLE_SUPER_ADMIN', 'ROLE_PRE_INSTRUCTOR', 'ROLE_INSTRUCTOR_MANAGER'].includes(o.role.roleType)); + .filter(o => [ + 'ROLE_SUPER_ADMIN', 'ROLE_PRE_INSTRUCTOR', 'ROLE_INSTRUCTOR_MANAGER', 'ROLE_CONFIDI' + ].includes(o.role.roleType)); }; const clearFilter = () => { diff --git a/src/pages/Users/index.js b/src/pages/Users/index.js index a34b17f..44a66ce 100644 --- a/src/pages/Users/index.js +++ b/src/pages/Users/index.js @@ -1,6 +1,6 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect, useRef, useCallback } from 'react'; import { __ } from '@wordpress/i18n'; -import { isEmpty, isNil } from 'ramda'; +import { head, isEmpty, isNil } from 'ramda'; import { klona } from 'klona'; // store @@ -11,7 +11,7 @@ import UserService from '../../service/user-service'; // tools import set404FromErrorResponse from '../../helpers/set404FromErrorResponse'; -import { isEmail } from '../../helpers/validators'; +import { isCodiceFiscale, isEmail, isPIVA } from '../../helpers/validators'; // components import AllUsersTable from './components/AllUsersTable'; @@ -34,7 +34,8 @@ const Users = () => { phoneNumber: '', password: '', confPassword: '', - roleId: 0 + roleId: 0, + codiceFiscale: '' }); const [roles, setRoles] = useState([]); const toast = useRef(null); @@ -56,18 +57,27 @@ const Users = () => { phoneNumber: '', password: '', confPassword: '', - roleId: 0 + roleId: 0, + codiceFiscale: '' }); } const saveEditDialog = () => { - const emptyValues = Object.values(newUserData).filter(v => isEmpty(v)); + const isConfidi = isConfidiRoleChosen(); + const emptyValues = Object.keys(newUserData) + .filter(v => v !== 'phoneNumber') + .filter(v => isConfidi ? v : v !== 'codiceFiscale') + .filter(v => isInvalidField(newUserData, v)); if (isEmpty(emptyValues) && newUserData.password === newUserData.confPassword && !loading) { setLoading(true); - const body = { + let body = klona({ ...newUserData, hubUuid: APP_HUB_ID + }); + + if (!isConfidi) { + delete body.codiceFiscale; } UserService.createUser(body, createUserCallback, errCreateUserCallback); @@ -108,23 +118,33 @@ const Users = () => { setNewUserData(userData); } - const footerEditDialog = () => { + const footerEditDialog = useCallback(() => { + const isConfidi = isConfidiRoleChosen(); + const errorValues = Object.keys(newUserData) + .filter(v => v !== 'phoneNumber') + .filter(v => isConfidi ? v : v !== 'codiceFiscale') + .filter(v => isInvalidField(newUserData, v)); + return
- } + }, [newUserData]); const getRolesCallback = (data) => { if (data.status === 'SUCCESS') { const roles = data.data - .filter(o => ['ROLE_SUPER_ADMIN', 'ROLE_PRE_INSTRUCTOR', 'ROLE_INSTRUCTOR_MANAGER'].includes(o.roleType)) + .filter(o => [ + 'ROLE_SUPER_ADMIN', 'ROLE_PRE_INSTRUCTOR', 'ROLE_INSTRUCTOR_MANAGER', 'ROLE_CONFIDI' + ].includes(o.roleType)) .map(o => ({ name: o.roleName, - value: o.id + value: o.id, + id: o.id, + roleType: o.roleType })); setRoles(roles); } @@ -136,7 +156,14 @@ const Users = () => { storeSet.main.unsetAsyncRequest(); } - const isInvalidField = (data, key) => isEmpty(data[key]) || isNil(data[key]) + const isInvalidField = (data, key) => key === 'codiceFiscale' + ? !isCodiceFiscale(data[key]) && !isPIVA(data[key]) + : isEmpty(data[key]) || isNil(data[key]); + + const isConfidiRoleChosen = useCallback(() => { + const chosen = head(roles.filter(o => o.id === newUserData.roleId)); + return chosen ? chosen.roleType === 'ROLE_CONFIDI' : false; + }, [roles, newUserData]) useEffect(() => { if (isVisibleEditDialog) { @@ -151,7 +178,7 @@ const Users = () => {
- +
@@ -201,13 +228,11 @@ const Users = () => { onChange={(e) => onChangeEditItem(e.target.value, 'email')}/>
-
@@ -244,6 +269,16 @@ const Users = () => { optionLabel="name" optionValue="value"/> + {isConfidiRoleChosen() + ?
+ + onChangeEditItem(e.target.value, 'codiceFiscale')}/> +
: null}
diff --git a/src/routes.js b/src/routes.js index 75a1caa..62867b6 100644 --- a/src/routes.js +++ b/src/routes.js @@ -52,6 +52,8 @@ import SoccorsoIstruttorioInstructorManager from './pages/SoccorsoIstruttorioIns import SoccorsoIstruttorioMioInstructorManager from './pages/SoccorsoIstruttorioMioInstructorManager'; import StatsBeneficiary from './pages/StatsBeneficiary'; import DocumentsBeneficiary from './pages/DocumentsBeneficiary'; +import LoginConfidi from './pages/LoginConfidi'; +import ResetPasswordAdmin from './pages/ResetPasswordAdmin'; const routes = ({ role, chosenCompanyId }) => { @@ -61,199 +63,233 @@ const routes = ({ role, chosenCompanyId }) => { {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role && chosenCompanyId > 0 ? : } + {'ROLE_CONFIDI' === role && chosenCompanyId > 0 ? : } {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} + {'ROLE_CONFIDI' === role ? : null} {'ROLE_PRE_INSTRUCTOR' === role ? : null} {'ROLE_INSTRUCTOR_MANAGER' === role ? : null} }/> }/> + }/> }/> - }/> + }/> + }/> }/> }/> ) diff --git a/src/service/network-service.js b/src/service/network-service.js index 5e7d5cc..acacaa4 100644 --- a/src/service/network-service.js +++ b/src/service/network-service.js @@ -9,7 +9,7 @@ export class NetworkService { } else if (status === 403) { storeSet.main.token(''); const { pathname } = window.location; - if (!['/login', '/loginadmin', '/reset-password', '/registration'].includes(pathname)) { + if (!['/login', '/registration', '/loginadmin', '/reset-password-admin', '/confidi', '/reset-password'].includes(pathname)) { window.location.replace('/login'); } }