@pagopa/selfcare-common-frontend 1.12.0 → 1.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/build.info +2 -2
- package/config/env.js +1 -1
- package/package.json +1 -1
- package/utils/verifyNameMatchWithTaxCode.d.ts +6 -0
- package/utils/verifyNameMatchWithTaxCode.js +50 -0
- package/utils/verifyNameMatchWithTaxCode.js.map +1 -0
- package/utils/verifySurnameMatchWithTaxCode.d.ts +6 -0
- package/utils/verifySurnameMatchWithTaxCode.js +29 -0
- package/utils/verifySurnameMatchWithTaxCode.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,28 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v1.12.3](https://github.com/pagopa/selfcare-common-frontend/compare/v1.12.2...v1.12.3)
|
|
8
|
+
|
|
9
|
+
- SELC-1509 Added to checkCF one consonant case [`#102`](https://github.com/pagopa/selfcare-common-frontend/pull/102)
|
|
10
|
+
- SELC-1509 Added to checkCF one consonant case (#102) [`#1509`](https://pagopa.atlassian.net/browse/1509)
|
|
11
|
+
|
|
12
|
+
#### [v1.12.2](https://github.com/pagopa/selfcare-common-frontend/compare/v1.12.1...v1.12.2)
|
|
13
|
+
|
|
14
|
+
> 8 September 2022
|
|
15
|
+
|
|
16
|
+
- SELC-1509 Creation of utilities functions with description for easily usage in other repos [`#101`](https://github.com/pagopa/selfcare-common-frontend/pull/101)
|
|
17
|
+
- SELC-1509 Creation of utilities functions with description for easily usage in other repos (#101) [`#1509`](https://pagopa.atlassian.net/browse/1509)
|
|
18
|
+
|
|
19
|
+
#### [v1.12.1](https://github.com/pagopa/selfcare-common-frontend/compare/v1.12.0...v1.12.1)
|
|
20
|
+
|
|
21
|
+
> 5 September 2022
|
|
22
|
+
|
|
23
|
+
- Change configuration in order to rehabilitate mixpanel [`cbcdb88`](https://github.com/pagopa/selfcare-common-frontend/commit/cbcdb88aad8b71c8b9d115adc91085b378fd182c)
|
|
24
|
+
|
|
7
25
|
#### [v1.12.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.11.14...v1.12.0)
|
|
8
26
|
|
|
27
|
+
> 23 August 2022
|
|
28
|
+
|
|
9
29
|
- SELC-1471 - added localization in footer [`#99`](https://github.com/pagopa/selfcare-common-frontend/pull/99)
|
|
10
30
|
- SELC-1471 - added localization in footer (#99) [`#1471`](https://pagopa.atlassian.net/browse/1471) [`#1471`](https://pagopa.atlassian.net/browse/1471)
|
|
11
31
|
|
package/build.info
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
remotes/origin/SELC-1407_usingEnableAssistanceProp
|
|
1
|
+
20220909.1 - selfcare-common-frontend.deploy(46565)
|
|
2
|
+
remotes/origin/SELC-1407_usingEnableAssistanceProp e8d12c68ca25067ad09e7514ecd2f399517921ae
|
package/config/env.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagopa/selfcare-common-frontend",
|
|
3
3
|
"description": "Shared React components for the pagopa selfcare project",
|
|
4
|
-
"version": "1.12.
|
|
4
|
+
"version": "1.12.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/pagopa/selfcare-common-frontend",
|
|
7
7
|
"author": "https://www.pagopa.gov.it",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** It allows you to verify that the name that the user would be entering corresponds or not with the
|
|
2
|
+
* characters given to the name in the taxcode.
|
|
3
|
+
* It covers the possible cases and return: TRUE, when the three letters of name in taxCode doesn't match
|
|
4
|
+
* with the name entered by the user, otherwise FALSE when they match.
|
|
5
|
+
* */
|
|
6
|
+
export declare const verifyNameMatchWithTaxCode: (name: string, fiscalCode?: string | undefined) => string | boolean | undefined;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** It allows you to verify that the name that the user would be entering corresponds or not with the
|
|
3
|
+
* characters given to the name in the taxcode.
|
|
4
|
+
* It covers the possible cases and return: TRUE, when the three letters of name in taxCode doesn't match
|
|
5
|
+
* with the name entered by the user, otherwise FALSE when they match.
|
|
6
|
+
* */
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.verifyNameMatchWithTaxCode = void 0;
|
|
9
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
10
|
+
const verifyNameMatchWithTaxCode = (name, fiscalCode) => {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
const fiscalCodeName = fiscalCode === null || fiscalCode === void 0 ? void 0 : fiscalCode.substring(3, 6).toLocaleUpperCase();
|
|
13
|
+
const consonantsName = (_a = name
|
|
14
|
+
.match(/[^aeiou]/gi)) === null || _a === void 0 ? void 0 : _a.join('').replace(/\s/g, '').toLocaleUpperCase();
|
|
15
|
+
if ((consonantsName === null || consonantsName === void 0 ? void 0 : consonantsName.length) === 3 && fiscalCodeName === consonantsName) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
else if (consonantsName && (consonantsName === null || consonantsName === void 0 ? void 0 : consonantsName.length) > 3) {
|
|
19
|
+
const threeNameLetters = (consonantsName === null || consonantsName === void 0 ? void 0 : consonantsName.slice(0, 1)) + (consonantsName === null || consonantsName === void 0 ? void 0 : consonantsName.slice(2, 4));
|
|
20
|
+
if (fiscalCodeName === threeNameLetters) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else if (consonantsName && (consonantsName === null || consonantsName === void 0 ? void 0 : consonantsName.length) === 2) {
|
|
25
|
+
const firstVocalFound = (_b = name
|
|
26
|
+
.match(/[aeiou]/gi)) === null || _b === void 0 ? void 0 : _b.join('').substring(0, 1).toLocaleUpperCase();
|
|
27
|
+
if (firstVocalFound) {
|
|
28
|
+
const threeNameLetters = consonantsName === null || consonantsName === void 0 ? void 0 : consonantsName.concat(firstVocalFound);
|
|
29
|
+
if (fiscalCodeName === threeNameLetters) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else if (consonantsName && (consonantsName === null || consonantsName === void 0 ? void 0 : consonantsName.length) === 1) {
|
|
35
|
+
const firstTwoVocalFound = (_c = name
|
|
36
|
+
.match(/[aeiou]/gi)) === null || _c === void 0 ? void 0 : _c.join('').substring(0, 2).toLocaleUpperCase();
|
|
37
|
+
if (firstTwoVocalFound) {
|
|
38
|
+
const threeNameLetters = consonantsName === null || consonantsName === void 0 ? void 0 : consonantsName.concat(firstTwoVocalFound);
|
|
39
|
+
if (fiscalCodeName === threeNameLetters) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return fiscalCode;
|
|
48
|
+
};
|
|
49
|
+
exports.verifyNameMatchWithTaxCode = verifyNameMatchWithTaxCode;
|
|
50
|
+
//# sourceMappingURL=verifyNameMatchWithTaxCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyNameMatchWithTaxCode.js","sourceRoot":"","sources":["../../src/lib/utils/verifyNameMatchWithTaxCode.tsx"],"names":[],"mappings":";AAAA;;;;KAIK;;;AAEL,wDAAwD;AACjD,MAAM,0BAA0B,GAAG,CAAC,IAAY,EAAE,UAAmB,EAAE,EAAE;;IAC9E,MAAM,cAAc,GAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACvE,MAAM,cAAc,GAAG,MAAA,IAAI;SACxB,KAAK,CAAC,YAAY,CAAC,0CAClB,IAAI,CAAC,EAAE,EACR,OAAO,CAAC,KAAK,EAAE,EAAE,EACj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B,MAAM,gBAAgB,GAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;YACpE,IAAI,cAAc,KAAK,gBAAgB,EAAE;gBACvC,OAAO,KAAK,CAAC;aACd;SACF;KACF;SAAM;QACL,OAAO,IAAI,CAAC;KACb;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA1CW,QAAA,0BAA0B,8BA0CrC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** It allows you to verify that the surname that the user would be entering corresponds or not with the
|
|
2
|
+
* characters given to the surname in the taxcode.
|
|
3
|
+
* It covers the possible cases and return: TRUE, when the three letters of surname in taxCode doesn't match
|
|
4
|
+
* with the surname entered by the user, otherwise FALSE when they match.
|
|
5
|
+
* */
|
|
6
|
+
export declare const verifySurnameMatchWithTaxCode: (surname: string, fiscalCode?: string | undefined) => string | boolean | undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** It allows you to verify that the surname that the user would be entering corresponds or not with the
|
|
3
|
+
* characters given to the surname in the taxcode.
|
|
4
|
+
* It covers the possible cases and return: TRUE, when the three letters of surname in taxCode doesn't match
|
|
5
|
+
* with the surname entered by the user, otherwise FALSE when they match.
|
|
6
|
+
* */
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.verifySurnameMatchWithTaxCode = void 0;
|
|
9
|
+
const verifySurnameMatchWithTaxCode = (surname, fiscalCode) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const fiscalCodeSurname = fiscalCode === null || fiscalCode === void 0 ? void 0 : fiscalCode.substring(0, 3).toLocaleUpperCase();
|
|
12
|
+
const consonantsSurname = (_a = surname
|
|
13
|
+
.match(/[^aeiou]/gi)) === null || _a === void 0 ? void 0 : _a.join('').replace(/\s/g, '').toLocaleUpperCase();
|
|
14
|
+
if (consonantsSurname && (consonantsSurname === null || consonantsSurname === void 0 ? void 0 : consonantsSurname.length) >= 3) {
|
|
15
|
+
const threeSurnameLetters = consonantsSurname === null || consonantsSurname === void 0 ? void 0 : consonantsSurname.substring(0, 3);
|
|
16
|
+
return fiscalCodeSurname !== threeSurnameLetters;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const firstVocalFound = (_b = surname
|
|
20
|
+
.match(/[aeiou]/gi)) === null || _b === void 0 ? void 0 : _b.join('').substring(0, 1).toLocaleUpperCase();
|
|
21
|
+
if (firstVocalFound) {
|
|
22
|
+
const threeSurnameLetters = consonantsSurname === null || consonantsSurname === void 0 ? void 0 : consonantsSurname.concat(firstVocalFound);
|
|
23
|
+
return fiscalCodeSurname !== threeSurnameLetters;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return fiscalCode;
|
|
27
|
+
};
|
|
28
|
+
exports.verifySurnameMatchWithTaxCode = verifySurnameMatchWithTaxCode;
|
|
29
|
+
//# sourceMappingURL=verifySurnameMatchWithTaxCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifySurnameMatchWithTaxCode.js","sourceRoot":"","sources":["../../src/lib/utils/verifySurnameMatchWithTaxCode.tsx"],"names":[],"mappings":";AAAA;;;;KAIK;;;AAEE,MAAM,6BAA6B,GAAG,CAAC,OAAe,EAAE,UAAmB,EAAE,EAAE;;IACpF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC1E,MAAM,iBAAiB,GAAG,MAAA,OAAO;SAC9B,KAAK,CAAC,YAAY,CAAC,0CAClB,IAAI,CAAC,EAAE,EACR,OAAO,CAAC,KAAK,EAAE,EAAE,EACjB,iBAAiB,EAAE,CAAC;IACvB,IAAI,iBAAiB,IAAI,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,KAAI,CAAC,EAAE;QACvD,MAAM,mBAAmB,GAAG,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/D,OAAO,iBAAiB,KAAK,mBAAmB,CAAC;KAClD;SAAM;QACL,MAAM,eAAe,GAAG,MAAA,OAAO;aAC5B,KAAK,CAAC,WAAW,CAAC,0CACjB,IAAI,CAAC,EAAE,EACR,SAAS,CAAC,CAAC,EAAE,CAAC,EACd,iBAAiB,EAAE,CAAC;QACvB,IAAI,eAAe,EAAE;YACnB,MAAM,mBAAmB,GAAG,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,CAAC,eAAe,CAAC,CAAC;YACvE,OAAO,iBAAiB,KAAK,mBAAmB,CAAC;SAClD;KACF;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAtBW,QAAA,6BAA6B,iCAsBxC"}
|