diff --git a/src/assets/scss/components/appForm.scss b/src/assets/scss/components/appForm.scss index 8051ea1..caa1f36 100644 --- a/src/assets/scss/components/appForm.scss +++ b/src/assets/scss/components/appForm.scss @@ -42,7 +42,7 @@ } } - input[disabled], div.p-disabled { + input[disabled], div.p-disabled:not(.p-inputswitch) { background-color: #e3e3e3; } } diff --git a/src/components/FormField/components/Fileupload/index.js b/src/components/FormField/components/Fileupload/index.js index 3032638..400cb63 100644 --- a/src/components/FormField/components/Fileupload/index.js +++ b/src/components/FormField/components/Fileupload/index.js @@ -19,13 +19,14 @@ const Fileupload = ({ infoText = null, accept = 'image/*', doctype = 'images', - maxSize = 1000000, + maxSize = 100000000, emptyText = __('Trascina qui il tuo file', 'gepafin'), chooseLabel = __('Aggiungi file', 'gepafin'), multiple = false, sourceId = 0, source = 'application', - disabled = false + disabled = false, + maxFileSize = 100000000 }) => { const [stateFieldData, setStateFieldData] = useState([]); const [acceptFormats, setAcceptFormats] = useState(''); diff --git a/src/components/FormField/components/FileuploadAsync/index.js b/src/components/FormField/components/FileuploadAsync/index.js index d4d2ed9..8fb0a01 100644 --- a/src/components/FormField/components/FileuploadAsync/index.js +++ b/src/components/FormField/components/FileuploadAsync/index.js @@ -19,6 +19,7 @@ const FileuploadAsync = ({ infoText = null, accept = 'image/*', doctype = 'images', + maxSize = 100000000, emptyText = __('Trascina qui il tuo file', 'gepafin'), chooseLabel = __('Aggiungi immagine', 'gepafin'), multiple = false, @@ -152,7 +153,7 @@ const FileuploadAsync = ({ url={'/document/uploadFile'} multiple={multiple} accept={accept} - maxFileSize={1000000} + maxFileSize={maxSize} emptyTemplate={

{emptyText}

} chooseLabel={chooseLabel} cancelLabel={__('Cancella', 'gepafin')} diff --git a/src/pages/BandoEdit/components/BandoEditFormStep1/index.js b/src/pages/BandoEdit/components/BandoEditFormStep1/index.js index af806e1..8da5b5c 100644 --- a/src/pages/BandoEdit/components/BandoEditFormStep1/index.js +++ b/src/pages/BandoEdit/components/BandoEditFormStep1/index.js @@ -19,11 +19,10 @@ import BandoService from '../../../../service/bando-service'; import LookupdataService from '../../../../service/lookupdata-service'; // store -import { storeSet, useStore } from '../../../../store'; +import { storeSet } from '../../../../store'; const BandoEditFormStep1 = forwardRef(function ({ initialData, getFormErrors, status }, ref) { const navigate = useNavigate(); - const isAsyncRequest = useStore().main.isAsyncRequest(); const [aimedToOptions, setAimedToOptions] = useState([]); const [faqOptions, setFaqOptions] = useState([]); const [formInitialData, setFormInitialData] = useState(initialData); @@ -244,7 +243,7 @@ const BandoEditFormStep1 = forwardRef(function ({ initialData, getFormErrors, st /> {
diff --git a/src/pages/BandoFormsEdit/components/FormBuilder/index.js b/src/pages/BandoFormsEdit/components/FormBuilder/index.js index 6e90093..cacf84e 100644 --- a/src/pages/BandoFormsEdit/components/FormBuilder/index.js +++ b/src/pages/BandoFormsEdit/components/FormBuilder/index.js @@ -61,7 +61,7 @@ const FormBuilder = () => {
-

{__('Trascina qui gli elementi del Form', 'gepafin')}

+

{__('Trascina qui gli elementi del Form', 'gepafin')}*

{!isEmpty(elements) ? elements.map((field, i) => renderField(field, i)) diff --git a/src/pages/BandoFormsEdit/index.js b/src/pages/BandoFormsEdit/index.js index 3ece0a4..1fbfe9c 100644 --- a/src/pages/BandoFormsEdit/index.js +++ b/src/pages/BandoFormsEdit/index.js @@ -278,7 +278,7 @@ const BandoFormsEdit = () => { style={{ maxWidth: '500px' }} />
- + { +const AllUsersTable = () => { const [items, setItems] = useState(null); const [filters, setFilters] = useState(null); const [loading, setLoading] = useState(false); @@ -37,10 +37,29 @@ const AllBandiTable = () => { useEffect(() => { storeSet.main.setAsyncRequest(); - BandoService.getBandi(getCallback, errGetCallbacks); + const sample = [ + { + id: 11, + name: 'Mario Rossi', + email: 'mario.rossi@example.com', + role: 'Beneficiario', + status: 'active', + last_access: '2024-08-01 10:30' + }, + { + id: 12, + name: 'Mario Rossi2', + email: 'mario.rossi@example.com', + role: 'Beneficiario', + status: 'active', + last_access: '2024-08-01 10:30' + } + ]; + setItems(sample); + //BandoService.getBandi(getCallback, errGetCallbacks); }, []); - const getCallback = (data) => { + /*const getCallback = (data) => { if (data.status === 'SUCCESS') { setItems(getFormattedBandiData(data.data)); setStatuses(uniq(data.data.map(o => o.status))) @@ -52,11 +71,11 @@ const AllBandiTable = () => { const errGetCallbacks = (data) => { console.log('errGetCallbacks', data) storeSet.main.unsetAsyncRequest(); - } + }*/ - const getFormattedBandiData = (data) => { + const getFormattedData = (data) => { return data.map((d) => { - d.dates = d.dates.map(v => is(String, v) ? new Date(v) : (v ? v : '')); + d.last_access = is(String, d.last_access) ? new Date(d.last_access) : (d.last_access ? d.last_access : ''); return d; }); }; @@ -79,8 +98,7 @@ const AllBandiTable = () => { setFilters({ global: { value: null, matchMode: FilterMatchMode.CONTAINS }, name: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] }, - start_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] }, - end_date: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] }, + last_access: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] }, status: { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] }, }); setGlobalFilterValue(''); @@ -98,12 +116,8 @@ const AllBandiTable = () => { ); }; - const dateStartBodyTemplate = (rowData) => { - return getDateFromISOstring(rowData.dates[0]); - }; - - const dateEndBodyTemplate = (rowData) => { - return getDateFromISOstring(rowData.dates[1]); + const dateLastAccessBodyTemplate = (rowData) => { + return getDateFromISOstring(rowData.last_access); }; const dateFilterTemplate = (options) => { @@ -123,7 +137,7 @@ const AllBandiTable = () => { }; const actionsBodyTemplate = (rowData) => { - return + return
+ } + + return( +
+
+

{__('Gestione utenti', 'gepafin')}

+
+ +
+ +
+
+
+ + + + +
+
+ + onChangeEditItem(e.target.value, 'firstName')}/> +
+
+ + onChangeEditItem(e.target.value, 'lastName')}/> +
+
+ + onChangeEditItem(e.target.value, 'response')} + rows={5} + cols={30}/> +
+
+
+
+
+ ) +} + +export default Users; \ No newline at end of file diff --git a/src/pages/Utenti/index.js b/src/pages/Utenti/index.js deleted file mode 100644 index 1c56926..0000000 --- a/src/pages/Utenti/index.js +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import { __ } from '@wordpress/i18n'; -import { useNavigate } from 'react-router-dom'; - -// components -import AllBandiTable from './components/AllBandiTable'; -import { Button } from 'primereact/button'; - -const Utenti = () => { - const navigate = useNavigate(); - - const onCreateNewUser = () => { - navigate('/utenti/new'); - } - - return( -
-
-

{__('Gestione utenti', 'gepafin')}

-
- -
- -
-
-
- - -
-
- ) -} - -export default Utenti; \ No newline at end of file diff --git a/src/routes.js b/src/routes.js index a8b6bef..1e6db3c 100644 --- a/src/routes.js +++ b/src/routes.js @@ -22,7 +22,7 @@ import BandiBeneficiario from './pages/BandiBeneficiario'; import LoginAdmin from './pages/LoginAdmin'; import Profile from './pages/Profile'; import ProfileCompany from './pages/ProfileCompany'; -import Utenti from './pages/Utenti'; +import Users from './pages/Users'; const routes = ({ role }) => { return ( @@ -81,7 +81,7 @@ const routes = ({ role }) => { {'ROLE_BENEFICIARY' === role ? : null} }/> - {'ROLE_SUPER_ADMIN' === role ? : null} + {'ROLE_SUPER_ADMIN' === role ? : null} {'ROLE_BENEFICIARY' === role ? : null} }/>