- fixed login with spid fe issue;
- improved 'add user' form; - added new field 'paragraph';
This commit is contained in:
@@ -11,6 +11,7 @@ import BandoService from '../../service/bando-service';
|
||||
|
||||
// tools
|
||||
import getBandoLabel from '../../helpers/getBandoLabel';
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
|
||||
// components
|
||||
import { Button } from 'primereact/button';
|
||||
@@ -20,7 +21,6 @@ import BandoEditFormStep1 from './components/BandoEditFormStep1';
|
||||
import BandoEditFormStep2 from './components/BandoEditFormStep2';
|
||||
import { Messages } from 'primereact/messages';
|
||||
import FormsService from '../../service/forms-service';
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||
|
||||
const BandoEdit = () => {
|
||||
@@ -30,8 +30,6 @@ const BandoEdit = () => {
|
||||
const [activeStep, setActiveStep] = useState(null)
|
||||
const [data, setData] = useState({});
|
||||
const [forms, setForms] = useState([]);
|
||||
//const [selectedTemplate, setSelectedTemplate] = useState(null);
|
||||
//const [templates, setTemplate] = useState(null);
|
||||
const formRef = useRef(null);
|
||||
const bandoMsgs = useRef(null);
|
||||
|
||||
@@ -43,23 +41,7 @@ const BandoEdit = () => {
|
||||
return false
|
||||
}
|
||||
bandoMsgs.current.clear();
|
||||
const isFormValid = formRef.current.isFormValid();
|
||||
//const values = formRef.current.getValues();
|
||||
//const diffData = equal(values, data);
|
||||
// TODO warn about unsaved data
|
||||
goToStep(0);
|
||||
/*if (isFormValid) {
|
||||
goToStep(0)
|
||||
} else {
|
||||
bandoMsgs.current.show([
|
||||
{
|
||||
id: '98',
|
||||
sticky: true, severity: 'error', summary: '',
|
||||
detail: __('Potrai andare su altro step dopo risolvere errori della forma', 'gepafin'),
|
||||
closable: true
|
||||
}
|
||||
]);
|
||||
}*/
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -68,25 +50,8 @@ const BandoEdit = () => {
|
||||
if (activeStep === 1) {
|
||||
return false
|
||||
}
|
||||
console.log('11');
|
||||
bandoMsgs.current.clear();
|
||||
const isFormValid = formRef.current.isFormValid();
|
||||
//const values = formRef.current.getValues();
|
||||
//const diffData = equal(values, data);
|
||||
// TODO warn about unsaved data
|
||||
goToStep(1);
|
||||
/*if (isFormValid) {
|
||||
goToStep(1);
|
||||
} else {
|
||||
bandoMsgs.current.show([
|
||||
{
|
||||
id: '98',
|
||||
sticky: true, severity: 'error', summary: '',
|
||||
detail: __('Potrai andare su altro step dopo risolvere errori della forma', 'gepafin'),
|
||||
closable: true
|
||||
}
|
||||
]);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -271,26 +236,6 @@ const BandoEdit = () => {
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
|
||||
{/*!isLoading
|
||||
? <div className="pageBando__templateSelection">
|
||||
<div className="appForm__field">
|
||||
<label htmlFor="template">
|
||||
{__('Usa Template Salvato', 'gepafin')}
|
||||
</label>
|
||||
<Dropdown
|
||||
id="template"
|
||||
value={selectedTemplate}
|
||||
onChange={(e) => setSelectedTemplate(e.value)}
|
||||
options={templates}
|
||||
optionLabel="name"
|
||||
placeholder={__('Seleziona template', 'gepafin')}/>
|
||||
</div>
|
||||
<Button
|
||||
onClick={() => console.log('use template')}
|
||||
label={__('Applica', 'gepafin')}
|
||||
icon="pi pi-check"
|
||||
iconPos="right"/>
|
||||
</div> : null*/}
|
||||
{!isEmpty(data)
|
||||
? <Steps
|
||||
model={stepItems}
|
||||
|
||||
@@ -11,7 +11,7 @@ const BuilderElementProperLabel = ({ id, defaultLabel }) => {
|
||||
useEffect(() => {
|
||||
const element = head(elements.filter(o => o.id === id));
|
||||
const setting = head(element.settings.filter(o => o.name === 'label'));
|
||||
if (setting.value) {
|
||||
if (setting) {
|
||||
setLabel(setting.value);
|
||||
} else {
|
||||
setLabel(defaultLabel);
|
||||
|
||||
@@ -16,6 +16,7 @@ const ElementSetting = ({ setting, changeFn, updateDataFn }) => {
|
||||
step: __('Precisione decimale', 'gepafin'),
|
||||
options: __('Opzioni', 'gepafin'),
|
||||
mime: __('Tipo di file', 'gepafin'),
|
||||
text: __('Testo formattato', 'gepafin')
|
||||
}
|
||||
|
||||
return <div className="formElementSettings__field" key={setting.name}>
|
||||
|
||||
@@ -23,14 +23,14 @@ const BuilderElementSettings = ({ closeSettings }) => {
|
||||
const [validators, setValidators] = useState({});
|
||||
const textBasedValidatorFields = ['min', 'max', 'minLength', 'maxLength', 'pattern'];
|
||||
const customValidationOptions = [
|
||||
{value: 'isPIVA', label: 'isPIVA'},
|
||||
{value: 'isCodiceFiscale', label: 'isCodiceFiscale'},
|
||||
{value: 'isCAP', label: 'isCAP'},
|
||||
{value: 'isIBAN', label: 'isIBAN'},
|
||||
{value: 'isEmail', label: 'isEmail'},
|
||||
{value: 'isEmailPEC', label: 'isEmailPEC'},
|
||||
{value: 'isUrl', label: 'isUrl'},
|
||||
{value: 'isMarcaDaBollo', label: 'isMarcaDaBollo'}
|
||||
{ value: 'isPIVA', label: 'isPIVA' },
|
||||
{ value: 'isCodiceFiscale', label: 'isCodiceFiscale' },
|
||||
{ value: 'isCAP', label: 'isCAP' },
|
||||
{ value: 'isIBAN', label: 'isIBAN' },
|
||||
{ value: 'isEmail', label: 'isEmail' },
|
||||
{ value: 'isEmailPEC', label: 'isEmailPEC' },
|
||||
{ value: 'isUrl', label: 'isUrl' },
|
||||
{ value: 'isMarcaDaBollo', label: 'isMarcaDaBollo' }
|
||||
]
|
||||
|
||||
const onChange = (value, name) => {
|
||||
@@ -116,7 +116,8 @@ const BuilderElementSettings = ({ closeSettings }) => {
|
||||
updateDataFn={onUpdateOptions}/>)
|
||||
: null}
|
||||
</TabPanel>
|
||||
<TabPanel header={__('Validation', 'gepafin')}>
|
||||
{!isEmpty(validators)
|
||||
? <TabPanel header={__('Validation', 'gepafin')}>
|
||||
{validators
|
||||
? Object.keys(validators).map((k) => <div
|
||||
className="formElementSettings__field" key={k}>
|
||||
@@ -157,7 +158,7 @@ const BuilderElementSettings = ({ closeSettings }) => {
|
||||
onChange={(e) => onChangeValidator(e.target.value, k)}/>
|
||||
</div> : null}
|
||||
</div>) : null}
|
||||
</TabPanel>
|
||||
</TabPanel> : null}
|
||||
</TabView>
|
||||
|
||||
<Button label={__('Salva', 'gepafin')} onClick={saveSettings}/>
|
||||
|
||||
@@ -22,7 +22,7 @@ const Login = () => {
|
||||
|
||||
const loginWithSpid = () => {
|
||||
if (!loading) {
|
||||
//window.location.replace(`${API_BASE_URL}/saml2/authenticate/loginumbria`);
|
||||
window.location.replace(`${API_BASE_URL}/saml2/authenticate/loginumbria`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { isEmpty } from 'ramda';
|
||||
import { isEmpty, isNil } from 'ramda';
|
||||
|
||||
// components
|
||||
import AllUsersTable from './components/AllUsersTable';
|
||||
@@ -12,6 +12,7 @@ import UserService from '../../service/user-service';
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
import { storeSet } from '../../store';
|
||||
import { klona } from 'klona';
|
||||
import { classNames } from 'primereact/utils';
|
||||
|
||||
const Users = () => {
|
||||
const [isVisibleEditDialog, setIsVisibleEditDialog] = useState(false);
|
||||
@@ -112,32 +113,37 @@ const Users = () => {
|
||||
<div className="appPage__spacer"></div>
|
||||
<div className="appForm__cols">
|
||||
<div className="appForm__field">
|
||||
<label>{__('Nome', 'gepafin')}*</label>
|
||||
<label className={classNames({ 'p-error': isEmpty(newUserData.firstName) || isNil(newUserData.firstName) })}>{__('Nome', 'gepafin')}*</label>
|
||||
<InputText value={newUserData.firstName}
|
||||
invalid={isEmpty(newUserData.firstName) || isNil(newUserData.firstName)}
|
||||
onChange={(e) => onChangeEditItem(e.target.value, 'firstName')}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label>{__('Cognome', 'gepafin')}*</label>
|
||||
<label className={classNames({ 'p-error': isEmpty(newUserData.lastName) || isNil(newUserData.lastName) })}>{__('Cognome', 'gepafin')}*</label>
|
||||
<InputText value={newUserData.lastName}
|
||||
invalid={isEmpty(newUserData.lastName) || isNil(newUserData.lastName)}
|
||||
onChange={(e) => onChangeEditItem(e.target.value, 'lastName')}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="appForm__cols">
|
||||
<div className="appForm__field">
|
||||
<label>{__('Email', 'gepafin')}*</label>
|
||||
<label className={classNames({ 'p-error': isEmpty(newUserData.email) || isNil(newUserData.email) })}>{__('Email', 'gepafin')}*</label>
|
||||
<InputText value={newUserData.email}
|
||||
invalid={isEmpty(newUserData.email) || isNil(newUserData.email)}
|
||||
onChange={(e) => onChangeEditItem(e.target.value, 'email')}/>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label>{__('Telefono', 'gepafin')}</label>
|
||||
<label className={classNames({ 'p-error': isEmpty(newUserData.phoneNumber) || isNil(newUserData.phoneNumber) })}>{__('Telefono', 'gepafin')}</label>
|
||||
<InputText value={newUserData.phoneNumber}
|
||||
invalid={isEmpty(newUserData.phoneNumber) || isNil(newUserData.phoneNumber)}
|
||||
onChange={(e) => onChangeEditItem(e.target.value, 'phoneNumber')}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="appForm__field">
|
||||
<label>{__('Ruolo', 'gepafin')}</label>
|
||||
<label className={classNames({ 'p-error': isEmpty(newUserData.role) || isNil(newUserData.role) })}>{__('Ruolo', 'gepafin')}</label>
|
||||
<Dropdown
|
||||
value={newUserData.role}
|
||||
invalid={isEmpty(newUserData.role) || isNil(newUserData.role)}
|
||||
onChange={(e) => onChangeEditItem(e.value, 'role')}
|
||||
options={roles}
|
||||
optionLabel="name"
|
||||
|
||||
@@ -719,5 +719,19 @@ export const elementItems = [
|
||||
isRequired: false,
|
||||
custom: 'isMarcaDaBollo'
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 19,
|
||||
sortOrder: 19,
|
||||
name: 'paragraph',
|
||||
label: 'Paragrafo',
|
||||
description: 'Semplice testo formattato',
|
||||
settings: [
|
||||
{
|
||||
name: "text",
|
||||
value: "Testo formattato"
|
||||
}
|
||||
],
|
||||
validators: {}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user