- updated copies;
- test for spid login;
This commit is contained in:
53
package-lock.json
generated
53
package-lock.json
generated
@@ -12,6 +12,7 @@
|
|||||||
"@babel/preset-react": "7.24.7",
|
"@babel/preset-react": "7.24.7",
|
||||||
"@date-fns/tz": "1.1.2",
|
"@date-fns/tz": "1.1.2",
|
||||||
"@emotion/styled": "11.13.0",
|
"@emotion/styled": "11.13.0",
|
||||||
|
"@tanstack/react-table": "^8.20.5",
|
||||||
"@wordpress/i18n": "5.8.0",
|
"@wordpress/i18n": "5.8.0",
|
||||||
"@wordpress/react-i18n": "4.8.0",
|
"@wordpress/react-i18n": "4.8.0",
|
||||||
"@xyflow/react": "12.3.1",
|
"@xyflow/react": "12.3.1",
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
"jwt-decode": "4.0.0",
|
"jwt-decode": "4.0.0",
|
||||||
"klona": "2.0.6",
|
"klona": "2.0.6",
|
||||||
"luxon": "3.5.0",
|
"luxon": "3.5.0",
|
||||||
|
"object-path-immutable": "^4.1.2",
|
||||||
"primeicons": "7.0.0",
|
"primeicons": "7.0.0",
|
||||||
"primereact": "10.8.3",
|
"primereact": "10.8.3",
|
||||||
"quill": "2.0.2",
|
"quill": "2.0.2",
|
||||||
@@ -3869,6 +3871,37 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@tannin/postfix/-/postfix-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tannin/postfix/-/postfix-1.1.0.tgz",
|
||||||
"integrity": "sha512-oocsqY7g0cR+Gur5jRQLSrX2OtpMLMse1I10JQBm8CdGMrDkh1Mg2gjsiquMHRtBs4Qwu5wgEp5GgIYHk4SNPw=="
|
"integrity": "sha512-oocsqY7g0cR+Gur5jRQLSrX2OtpMLMse1I10JQBm8CdGMrDkh1Mg2gjsiquMHRtBs4Qwu5wgEp5GgIYHk4SNPw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/@tanstack/react-table": {
|
||||||
|
"version": "8.20.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.20.5.tgz",
|
||||||
|
"integrity": "sha512-WEHopKw3znbUZ61s9i0+i9g8drmDo6asTWbrQh8Us63DAk/M0FkmIqERew6P71HI75ksZ2Pxyuf4vvKh9rAkiA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@tanstack/table-core": "8.20.5"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/tannerlinsley"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16.8",
|
||||||
|
"react-dom": ">=16.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tanstack/table-core": {
|
||||||
|
"version": "8.20.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.20.5.tgz",
|
||||||
|
"integrity": "sha512-P9dF7XbibHph2PFRz8gfBKEXEY/HJPOhym8CHmjF8y3q5mWpKx9xtZapXQUWCgkqvsK0R46Azuz+VaxD4Xl+Tg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/tannerlinsley"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@tootallnate/once": {
|
"node_modules/@tootallnate/once": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
|
||||||
@@ -13174,6 +13207,26 @@
|
|||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/object-path": {
|
||||||
|
"version": "0.11.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.8.tgz",
|
||||||
|
"integrity": "sha512-YJjNZrlXJFM42wTBn6zgOJVar9KFJvzx6sTWDte8sWZF//cnjl0BxHNpfZx+ZffXX63A9q0b1zsFiBX4g4X5KA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10.12.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/object-path-immutable": {
|
||||||
|
"version": "4.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/object-path-immutable/-/object-path-immutable-4.1.2.tgz",
|
||||||
|
"integrity": "sha512-Bfrox46OegMkQXL872EzEjofMyBxk/2hgiy99NkCkYFegn6Dm9FvV2jY2Tnp9qLj2QL0TLii12CuPpzonkjJrA==",
|
||||||
|
"dependencies": {
|
||||||
|
"is-plain-object": "^5.0.0",
|
||||||
|
"object-path": "^0.11.8"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/object.assign": {
|
"node_modules/object.assign": {
|
||||||
"version": "4.1.5",
|
"version": "4.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"@babel/preset-react": "7.24.7",
|
"@babel/preset-react": "7.24.7",
|
||||||
"@date-fns/tz": "1.1.2",
|
"@date-fns/tz": "1.1.2",
|
||||||
"@emotion/styled": "11.13.0",
|
"@emotion/styled": "11.13.0",
|
||||||
|
"@tanstack/react-table": "^8.20.5",
|
||||||
"@wordpress/i18n": "5.8.0",
|
"@wordpress/i18n": "5.8.0",
|
||||||
"@wordpress/react-i18n": "4.8.0",
|
"@wordpress/react-i18n": "4.8.0",
|
||||||
"@xyflow/react": "12.3.1",
|
"@xyflow/react": "12.3.1",
|
||||||
@@ -18,6 +19,7 @@
|
|||||||
"jwt-decode": "4.0.0",
|
"jwt-decode": "4.0.0",
|
||||||
"klona": "2.0.6",
|
"klona": "2.0.6",
|
||||||
"luxon": "3.5.0",
|
"luxon": "3.5.0",
|
||||||
|
"object-path-immutable": "^4.1.2",
|
||||||
"primeicons": "7.0.0",
|
"primeicons": "7.0.0",
|
||||||
"primereact": "10.8.3",
|
"primereact": "10.8.3",
|
||||||
"quill": "2.0.2",
|
"quill": "2.0.2",
|
||||||
|
|||||||
@@ -20,11 +20,13 @@ function App() {
|
|||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
storeSet.main.userData(data.data);
|
storeSet.main.userData(data.data);
|
||||||
} else {
|
} else {
|
||||||
|
console.log('logout 1', data)
|
||||||
storeSet.main.doLogout();
|
storeSet.main.doLogout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const errCallback = (data) => {
|
const errCallback = (data) => {
|
||||||
|
console.log('logout 2', data)
|
||||||
storeSet.main.doLogout();
|
storeSet.main.doLogout();
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
@@ -37,6 +39,7 @@ function App() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const errCompanyCallback = (data) => {
|
const errCompanyCallback = (data) => {
|
||||||
|
console.log('logout 3', data)
|
||||||
storeSet.main.doLogout();
|
storeSet.main.doLogout();
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ import React, { useState, useCallback } from 'react';
|
|||||||
import { classNames } from 'primereact/utils';
|
import { classNames } from 'primereact/utils';
|
||||||
import { Controller } from 'react-hook-form';
|
import { Controller } from 'react-hook-form';
|
||||||
import { Checkbox } from 'primereact/checkbox';
|
import { Checkbox } from 'primereact/checkbox';
|
||||||
|
import { klona } from 'klona';
|
||||||
|
import { wrap } from 'object-path-immutable';
|
||||||
|
|
||||||
|
import { maxChecks, minChecks } from '../../../../helpers/validators';
|
||||||
|
|
||||||
const Checkboxes = ({
|
const Checkboxes = ({
|
||||||
fieldName,
|
fieldName,
|
||||||
@@ -29,11 +33,23 @@ const Checkboxes = ({
|
|||||||
updateFn(data);
|
updateFn(data);
|
||||||
}, [fieldVal]);
|
}, [fieldVal]);
|
||||||
|
|
||||||
|
const properConfig = (config) => {
|
||||||
|
let newConfig = klona(config);
|
||||||
|
if (config.minLength) {
|
||||||
|
newConfig = wrap(newConfig).set(['validate', 'minChecks'], (v) => minChecks(v, config.minLength)).value();
|
||||||
|
}
|
||||||
|
if (config.maxLength) {
|
||||||
|
newConfig = wrap(newConfig).set(['validate', 'maxChecks'], (v) => maxChecks(v, config.maxLength)).value();
|
||||||
|
}
|
||||||
|
|
||||||
|
return newConfig;
|
||||||
|
}
|
||||||
|
|
||||||
const input = <Controller
|
const input = <Controller
|
||||||
name={fieldName}
|
name={fieldName}
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue={fieldVal}
|
defaultValue={fieldVal}
|
||||||
rules={config}
|
rules={properConfig(config)}
|
||||||
render={({ field, fieldState }) =>
|
render={({ field, fieldState }) =>
|
||||||
options.map(o => <div className="appForm__fieldItem" key={o.name}>
|
options.map(o => <div className="appForm__fieldItem" key={o.name}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import validate from 'validate.js';
|
import validate from 'validate.js';
|
||||||
import { match, isEmpty } from 'ramda';
|
import { match, isEmpty, is } from 'ramda';
|
||||||
import CodiceFiscale from 'codice-fiscale-js';
|
import CodiceFiscale from 'codice-fiscale-js';
|
||||||
|
|
||||||
export const isPIVA = (v) => {
|
export const isPIVA = (v) => {
|
||||||
@@ -58,3 +58,11 @@ export const isMarcaDaBollo = (v) => {
|
|||||||
const regexp = new RegExp(/^[0-9]{14}$/);
|
const regexp = new RegExp(/^[0-9]{14}$/);
|
||||||
return !isEmpty(match(regexp, String(v)));
|
return !isEmpty(match(regexp, String(v)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const minChecks = (v, num) => {
|
||||||
|
return is(Array, v) ? v.length >= parseInt(num) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const maxChecks = (v, num) => {
|
||||||
|
return is(Array, v) ? v.length <= parseInt(num) : false;
|
||||||
|
}
|
||||||
@@ -91,6 +91,7 @@ const BandoApplication = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const errSubmitApplicationCallback = (data) => {
|
const errSubmitApplicationCallback = (data) => {
|
||||||
|
console.log(data)
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
if (data.status === 'VALIDATION_ERROR') {
|
if (data.status === 'VALIDATION_ERROR') {
|
||||||
if (formMsgs.current) {
|
if (formMsgs.current) {
|
||||||
@@ -103,6 +104,17 @@ const BandoApplication = () => {
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
} else if (data.status === 'EXCEPTION_ERROR') {
|
||||||
|
if (formMsgs.current) {
|
||||||
|
formMsgs.current.show([
|
||||||
|
{
|
||||||
|
id: '99',
|
||||||
|
sticky: true, severity: 'error', summary: '',
|
||||||
|
detail: data.message,
|
||||||
|
closable: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
set404FromErrorResponse(data);
|
set404FromErrorResponse(data);
|
||||||
}
|
}
|
||||||
@@ -184,6 +196,17 @@ const BandoApplication = () => {
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
} else if (data.status === 'EXCEPTION_ERROR') {
|
||||||
|
if (formMsgs.current) {
|
||||||
|
formMsgs.current.show([
|
||||||
|
{
|
||||||
|
id: '99',
|
||||||
|
sticky: true, severity: 'error', summary: '',
|
||||||
|
detail: data.message,
|
||||||
|
closable: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
set404FromErrorResponse(data);
|
set404FromErrorResponse(data);
|
||||||
}
|
}
|
||||||
@@ -317,14 +340,15 @@ const BandoApplication = () => {
|
|||||||
if (['min', 'max', 'minLength', 'maxLength', 'maxSize'].includes(cur)) {
|
if (['min', 'max', 'minLength', 'maxLength', 'maxSize'].includes(cur)) {
|
||||||
acc[cur] = parseInt(o.validators[cur]);
|
acc[cur] = parseInt(o.validators[cur]);
|
||||||
} else if ('pattern' === cur) {
|
} else if ('pattern' === cur) {
|
||||||
acc[cur] = new RegExp(o.validators[cur])
|
acc[cur] = new RegExp(o.validators[cur]);
|
||||||
} else if ('isRequired' === cur) {
|
} else if ('isRequired' === cur) {
|
||||||
acc[cur] = o.validators[cur]
|
//acc[cur] = o.validators[cur];
|
||||||
|
acc['required'] = true;
|
||||||
} else if ('custom' === cur && validationFns[o.validators[cur]]) {
|
} else if ('custom' === cur && validationFns[o.validators[cur]]) {
|
||||||
if (!acc.validate) {
|
if (!acc.validate) {
|
||||||
acc.validate = {}
|
acc.validate = {};
|
||||||
}
|
}
|
||||||
acc.validate[cur] = validationFns[o.validators[cur]]
|
acc.validate[cur] = validationFns[o.validators[cur]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,7 +356,7 @@ const BandoApplication = () => {
|
|||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
return ['paragraph'].includes(o.name) && text
|
return ['paragraph'].includes(o.name) && text
|
||||||
? <div className="appForm__content">{renderHtmlContent(text.value)}</div>
|
? <div className="appForm__content" key={o.id}>{renderHtmlContent(text.value)}</div>
|
||||||
: <FormField
|
: <FormField
|
||||||
key={o.id}
|
key={o.id}
|
||||||
type={o.name}
|
type={o.name}
|
||||||
@@ -375,6 +399,7 @@ const BandoApplication = () => {
|
|||||||
outlined
|
outlined
|
||||||
label={__('Salva bozza', 'gepafin')} icon="pi pi-save" iconPos="right"/>
|
label={__('Salva bozza', 'gepafin')} icon="pi pi-save" iconPos="right"/>
|
||||||
{activeStep < totalSteps
|
{activeStep < totalSteps
|
||||||
|
//&& activeStep === completedSteps
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={goForward}
|
onClick={goForward}
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ const BandoEdit = () => {
|
|||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
|
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<h2>{__('Publicca il Form', 'gepafin')}</h2>
|
<h2>{__('Pubblica il form', 'gepafin')}</h2>
|
||||||
|
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -734,7 +734,7 @@ export const elementItems = [
|
|||||||
],
|
],
|
||||||
validators: {}
|
validators: {}
|
||||||
},
|
},
|
||||||
/*{
|
{
|
||||||
id: 20,
|
id: 20,
|
||||||
sortOrder: 20,
|
sortOrder: 20,
|
||||||
name: 'table',
|
name: 'table',
|
||||||
@@ -744,8 +744,12 @@ export const elementItems = [
|
|||||||
{
|
{
|
||||||
name: "label",
|
name: "label",
|
||||||
value: "Tabella"
|
value: "Tabella"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "table_columns",
|
||||||
|
value: "Tabella"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
validators: {}
|
validators: {}
|
||||||
}*/
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
25
yarn.lock
25
yarn.lock
@@ -1999,6 +1999,18 @@
|
|||||||
resolved "https://registry.npmjs.org/@tannin/postfix/-/postfix-1.1.0.tgz"
|
resolved "https://registry.npmjs.org/@tannin/postfix/-/postfix-1.1.0.tgz"
|
||||||
integrity sha512-oocsqY7g0cR+Gur5jRQLSrX2OtpMLMse1I10JQBm8CdGMrDkh1Mg2gjsiquMHRtBs4Qwu5wgEp5GgIYHk4SNPw==
|
integrity sha512-oocsqY7g0cR+Gur5jRQLSrX2OtpMLMse1I10JQBm8CdGMrDkh1Mg2gjsiquMHRtBs4Qwu5wgEp5GgIYHk4SNPw==
|
||||||
|
|
||||||
|
"@tanstack/react-table@^8.20.5":
|
||||||
|
version "8.20.5"
|
||||||
|
resolved "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.20.5.tgz"
|
||||||
|
integrity sha512-WEHopKw3znbUZ61s9i0+i9g8drmDo6asTWbrQh8Us63DAk/M0FkmIqERew6P71HI75ksZ2Pxyuf4vvKh9rAkiA==
|
||||||
|
dependencies:
|
||||||
|
"@tanstack/table-core" "8.20.5"
|
||||||
|
|
||||||
|
"@tanstack/table-core@8.20.5":
|
||||||
|
version "8.20.5"
|
||||||
|
resolved "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.20.5.tgz"
|
||||||
|
integrity sha512-P9dF7XbibHph2PFRz8gfBKEXEY/HJPOhym8CHmjF8y3q5mWpKx9xtZapXQUWCgkqvsK0R46Azuz+VaxD4Xl+Tg==
|
||||||
|
|
||||||
"@tootallnate/once@1":
|
"@tootallnate/once@1":
|
||||||
version "1.1.2"
|
version "1.1.2"
|
||||||
resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz"
|
resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz"
|
||||||
@@ -7367,6 +7379,19 @@ object-keys@^1.1.1:
|
|||||||
resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz"
|
resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz"
|
||||||
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
|
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
|
||||||
|
|
||||||
|
object-path-immutable@^4.1.2:
|
||||||
|
version "4.1.2"
|
||||||
|
resolved "https://registry.npmjs.org/object-path-immutable/-/object-path-immutable-4.1.2.tgz"
|
||||||
|
integrity sha512-Bfrox46OegMkQXL872EzEjofMyBxk/2hgiy99NkCkYFegn6Dm9FvV2jY2Tnp9qLj2QL0TLii12CuPpzonkjJrA==
|
||||||
|
dependencies:
|
||||||
|
is-plain-object "^5.0.0"
|
||||||
|
object-path "^0.11.8"
|
||||||
|
|
||||||
|
object-path@^0.11.8:
|
||||||
|
version "0.11.8"
|
||||||
|
resolved "https://registry.npmjs.org/object-path/-/object-path-0.11.8.tgz"
|
||||||
|
integrity sha512-YJjNZrlXJFM42wTBn6zgOJVar9KFJvzx6sTWDte8sWZF//cnjl0BxHNpfZx+ZffXX63A9q0b1zsFiBX4g4X5KA==
|
||||||
|
|
||||||
object.assign@^4.1.4, object.assign@^4.1.5:
|
object.assign@^4.1.4, object.assign@^4.1.5:
|
||||||
version "4.1.5"
|
version "4.1.5"
|
||||||
resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz"
|
resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz"
|
||||||
|
|||||||
Reference in New Issue
Block a user