@pagopa/selfcare-common-frontend 2.5.5 → 2.5.6
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 +7 -0
- package/lib/components/Footer/Footer.js +0 -1
- package/lib/decorators/withLogin.js +1 -1
- package/lib/redux/slices/productsSlice.js +0 -1
- package/package.json +15 -18
- package/examples/locale/en.d.ts +0 -20
- package/examples/locale/en.js +0 -18
- package/examples/locale/index.d.ts +0 -1
- package/examples/locale/index.js +0 -4
- package/examples/locale/it.d.ts +0 -20
- package/examples/locale/it.js +0 -19
- package/lib/components/tests/FilterModal.test.d.ts +0 -1
- package/lib/components/tests/FilterModal.test.js +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,15 @@ 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
|
+
#### [v2.5.6](https://github.com/pagopa/selfcare-common-frontend/compare/v2.5.5...v2.5.6)
|
|
8
|
+
|
|
9
|
+
- chore: build cleanup, typecheck in CI, ESLint 9 [`#376`](https://github.com/pagopa/selfcare-common-frontend/pull/376)
|
|
10
|
+
- chore: release v2.5.5 [`#375`](https://github.com/pagopa/selfcare-common-frontend/pull/375)
|
|
11
|
+
|
|
7
12
|
#### [v2.5.5](https://github.com/pagopa/selfcare-common-frontend/compare/v2.5.4...v2.5.5)
|
|
8
13
|
|
|
14
|
+
> 3 November 2026
|
|
15
|
+
|
|
9
16
|
- chore: add AI docs and consumer-side package check [`#374`](https://github.com/pagopa/selfcare-common-frontend/pull/374)
|
|
10
17
|
- chore: release v2.5.4 [`#372`](https://github.com/pagopa/selfcare-common-frontend/pull/372)
|
|
11
18
|
|
|
@@ -5,7 +5,6 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
5
5
|
import { CONFIG, showStaticPrivacyPolicy } from '../../config/env';
|
|
6
6
|
import i18n from '../../locale/locale-utils';
|
|
7
7
|
import { LANGUAGES, pagoPALink } from './FooterConfig';
|
|
8
|
-
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
9
8
|
export default function Footer({ loggedUser, productsJsonUrl, onExit = (exitAction) => exitAction(), }) {
|
|
10
9
|
const { t } = useTranslation();
|
|
11
10
|
const currentLangByUrl = new URLSearchParams(window.location.search).get('lang');
|
|
@@ -24,7 +24,7 @@ export default function withLogin(WrappedComponent) {
|
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
25
25
|
asyncAttemptSilentLogin().finally(() => setLoading(false));
|
|
26
26
|
}
|
|
27
|
-
}, []);
|
|
27
|
+
}, []);
|
|
28
28
|
return user ? _jsx(WrappedComponent, { ...props }) : _jsx(_Fragment, {});
|
|
29
29
|
};
|
|
30
30
|
// eslint-disable-next-line functional/immutable-data
|
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": "2.5.
|
|
4
|
+
"version": "2.5.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/pagopa/selfcare-common-frontend",
|
|
7
7
|
"author": "https://www.pagopa.gov.it",
|
|
@@ -40,25 +40,23 @@
|
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"clean": "npm-run-all clean:*",
|
|
43
|
-
"setTsConfigStart": "copyfiles tsconfigStart.json build && renamer --replace tsconfig.json build/tsconfigStart.json && copyfiles -u 1 build/tsconfig.json . && rimraf build/tsconfig.json",
|
|
44
43
|
"start": "vite",
|
|
45
|
-
"build": "vite build",
|
|
46
|
-
"clean:build": "rimraf build",
|
|
47
|
-
"setTsConfigDist": "copyfiles tsconfigDist.json build && renamer --replace tsconfig.json build/tsconfigDist.json && copyfiles -u 1 build/tsconfig.json . && rimraf build/tsconfig.json",
|
|
48
44
|
"cpDistStatic": "copyfiles -u 2 src/lib/index.css src/lib/utils/fixSwagger20ArraySchemaDef.js dist && copyfiles package.json README.md CHANGELOG.md dist",
|
|
49
|
-
"dist": "
|
|
45
|
+
"dist": "tsc -p tsconfigDist.json && yarn cpDistStatic",
|
|
50
46
|
"clean:dist": "rimraf dist",
|
|
51
47
|
"check:package": "yarn clean:dist && yarn dist && node scripts/check-package.mjs",
|
|
52
48
|
"clean:package-check": "rimraf .package-check",
|
|
53
49
|
"test": "vitest run",
|
|
54
50
|
"test:coverage": "vitest run --coverage",
|
|
55
51
|
"clean:coverage": "rimraf coverage",
|
|
56
|
-
"lint-autofix": "
|
|
57
|
-
"lint": "
|
|
52
|
+
"lint-autofix": "eslint . --fix",
|
|
53
|
+
"lint": "eslint .",
|
|
54
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
58
55
|
"prettify": "prettier --write \"./**/*.{ts,tsx}\"",
|
|
59
56
|
"version": "auto-changelog -p --config .auto-changelog.json && git add CHANGELOG.md"
|
|
60
57
|
},
|
|
61
58
|
"devDependencies": {
|
|
59
|
+
"@eslint/js": "^9.39.5",
|
|
62
60
|
"@pagopa/openapi-codegen-ts": "^14.2.0",
|
|
63
61
|
"@testing-library/jest-dom": "^6.1.5",
|
|
64
62
|
"@testing-library/react": "^14.1.2",
|
|
@@ -71,28 +69,27 @@
|
|
|
71
69
|
"@types/react-redux": "^7.1.33",
|
|
72
70
|
"@types/react-router-dom": "^5.1.8",
|
|
73
71
|
"@types/redux-logger": "^3.0.9",
|
|
74
|
-
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
75
|
-
"@typescript-eslint/parser": "^5.0.0",
|
|
76
72
|
"@vitejs/plugin-react": "^5.2.0",
|
|
77
73
|
"@vitest/browser": "4.1.10",
|
|
78
74
|
"@vitest/coverage-v8": "4.1.10",
|
|
79
75
|
"auto-changelog": "^2.3.0",
|
|
80
76
|
"copyfiles": "^2.4.1",
|
|
81
|
-
"eslint": "
|
|
82
|
-
"eslint-config-prettier": "^
|
|
83
|
-
"eslint-plugin-functional": "^
|
|
84
|
-
"eslint-plugin-import": "^2.
|
|
85
|
-
"eslint-plugin-react": "^7.
|
|
86
|
-
"eslint-plugin-react-hooks": "^
|
|
87
|
-
"eslint-plugin-sonarjs": "^
|
|
77
|
+
"eslint": "^9.39.5",
|
|
78
|
+
"eslint-config-prettier": "^10.1.8",
|
|
79
|
+
"eslint-plugin-functional": "^9.0.5",
|
|
80
|
+
"eslint-plugin-import": "^2.32.0",
|
|
81
|
+
"eslint-plugin-react": "^7.37.5",
|
|
82
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
83
|
+
"eslint-plugin-sonarjs": "^4.2.2",
|
|
84
|
+
"globals": "^17.14.0",
|
|
88
85
|
"jsdom": "^28.1.0",
|
|
89
86
|
"mkdirp": "^1.0.4",
|
|
90
87
|
"npm-run-all": "^4.1.5",
|
|
91
88
|
"prettier": "^3.6.2",
|
|
92
89
|
"regex-replace": "^2.3.1",
|
|
93
|
-
"renamer": "^4.0.0",
|
|
94
90
|
"rimraf": "^6.0.1",
|
|
95
91
|
"typescript": "^5.9.2",
|
|
92
|
+
"typescript-eslint": "^8.72.1",
|
|
96
93
|
"vite": "^8.1.5",
|
|
97
94
|
"vite-plugin-html": "^3.2.2",
|
|
98
95
|
"vitest": "4.1.10"
|
package/examples/locale/en.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'session modal button': string;
|
|
3
|
-
labelTitle: string;
|
|
4
|
-
boldDescriptionText: string;
|
|
5
|
-
boldDescriptionTwo: string;
|
|
6
|
-
description: {
|
|
7
|
-
part1: string;
|
|
8
|
-
part2: string;
|
|
9
|
-
};
|
|
10
|
-
key: string;
|
|
11
|
-
key2: string;
|
|
12
|
-
nesting1: string;
|
|
13
|
-
nesting2: string;
|
|
14
|
-
nesting3: string;
|
|
15
|
-
arrayJoinWithInterpolation: string[];
|
|
16
|
-
arrayOfObjects: {
|
|
17
|
-
name: string;
|
|
18
|
-
}[];
|
|
19
|
-
};
|
|
20
|
-
export default _default;
|
package/examples/locale/en.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const descriptionEn = 'bold description';
|
|
2
|
-
export default {
|
|
3
|
-
'session modal button': 'Translate Example Session Modal',
|
|
4
|
-
labelTitle: 'name Title',
|
|
5
|
-
boldDescriptionText: ' Test Description with bold text',
|
|
6
|
-
boldDescriptionTwo: `view ${descriptionEn}`,
|
|
7
|
-
description: {
|
|
8
|
-
part1: 'eng: description test-part1',
|
|
9
|
-
part2: 'eng: description test-part2',
|
|
10
|
-
},
|
|
11
|
-
key: '{{what}} {{and}} {{how}}!!',
|
|
12
|
-
key2: 'I am <1>{{author}}</1> not bold',
|
|
13
|
-
nesting1: '1 $t(nesting2)',
|
|
14
|
-
nesting2: '2 $t(nesting3)',
|
|
15
|
-
nesting3: '3',
|
|
16
|
-
arrayJoinWithInterpolation: ['you', 'can', '{{myVar}}'],
|
|
17
|
-
arrayOfObjects: [{ name: 'tom' }, { name: 'steve' }],
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/examples/locale/index.js
DELETED
package/examples/locale/it.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'session modal button': string;
|
|
3
|
-
labelTitle: string;
|
|
4
|
-
boldDescriptionText: string;
|
|
5
|
-
boldDescriptionTwo: string;
|
|
6
|
-
description: {
|
|
7
|
-
part1: string;
|
|
8
|
-
part2: string;
|
|
9
|
-
};
|
|
10
|
-
key: string;
|
|
11
|
-
key2: string;
|
|
12
|
-
nesting1: string;
|
|
13
|
-
nesting2: string;
|
|
14
|
-
nesting3: string;
|
|
15
|
-
arrayJoinWithInterpolation: string[];
|
|
16
|
-
arrayOfObjects: {
|
|
17
|
-
name: string;
|
|
18
|
-
}[];
|
|
19
|
-
};
|
|
20
|
-
export default _default;
|
package/examples/locale/it.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const labelTitle = 'nome Titolo';
|
|
2
|
-
const descriptionIt = 'descrizione in grassetto';
|
|
3
|
-
export default {
|
|
4
|
-
'session modal button': 'Esempio Traduzione SessionModal',
|
|
5
|
-
labelTitle: `${labelTitle}`,
|
|
6
|
-
boldDescriptionText: ' testo in grassetto',
|
|
7
|
-
boldDescriptionTwo: `visualizza la ${descriptionIt}`,
|
|
8
|
-
description: {
|
|
9
|
-
part1: 'ita: descrizione test-parte1',
|
|
10
|
-
part2: 'ita: descrizione test-parte2',
|
|
11
|
-
},
|
|
12
|
-
key: '{{what}} {{e}} {{how}}!!',
|
|
13
|
-
key2: 'sono <1>{{author}}</1> non in grassetto',
|
|
14
|
-
nesting1: '1 $t(nesting2)',
|
|
15
|
-
nesting2: '2 $t(nesting3)',
|
|
16
|
-
nesting3: '3',
|
|
17
|
-
arrayJoinWithInterpolation: ['tu', 'puoi', '{{myVar}}'],
|
|
18
|
-
arrayOfObjects: [{ name: 'tom' }, { name: ' steve' }],
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './../../../examples/locale';
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
-
import FilterModal from '../FilterModal';
|
|
4
|
-
import './../../../examples/locale';
|
|
5
|
-
vi.mock('i18next-browser-languagedetector');
|
|
6
|
-
const data = [
|
|
7
|
-
{ id: '1', label: 'Option 1' },
|
|
8
|
-
{ id: '2', label: 'Option 2' },
|
|
9
|
-
{ id: '3', label: 'Option 3' },
|
|
10
|
-
];
|
|
11
|
-
const filterModalConfig = {
|
|
12
|
-
data,
|
|
13
|
-
getLabel: (e) => e.label,
|
|
14
|
-
getValue: (e) => e.id,
|
|
15
|
-
onFilterChange: vi.fn(),
|
|
16
|
-
};
|
|
17
|
-
describe('FilterModal Component', () => {
|
|
18
|
-
test('should display the radio buttons with the correct labels', () => {
|
|
19
|
-
render(_jsx(FilterModal, { open: true, handleClose: () => { }, title: "Test Title", filterModalConfig: filterModalConfig }));
|
|
20
|
-
data.forEach((item) => {
|
|
21
|
-
expect(screen.getByLabelText(item.label)).not.toBeNull();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
test('should call onFilterChange with the correct value when a radio button is selected and the button is clicked', () => {
|
|
25
|
-
render(_jsx(FilterModal, { open: true, handleClose: () => { }, title: "Test Title", filterModalConfig: filterModalConfig }));
|
|
26
|
-
fireEvent.click(screen.getByLabelText('Option 2'));
|
|
27
|
-
fireEvent.click(screen.getByText('Filtra'));
|
|
28
|
-
expect(filterModalConfig.onFilterChange).toHaveBeenCalledWith(data[1]);
|
|
29
|
-
});
|
|
30
|
-
test('should call handleClose when the apply filter button is clicked', () => {
|
|
31
|
-
const handleClose = vi.fn();
|
|
32
|
-
render(_jsx(FilterModal, { open: true, handleClose: handleClose, title: "Test Title", filterModalConfig: filterModalConfig }));
|
|
33
|
-
fireEvent.click(screen.getByLabelText('Option 2'));
|
|
34
|
-
fireEvent.click(screen.getByText('Filtra'));
|
|
35
|
-
expect(handleClose).toHaveBeenCalled();
|
|
36
|
-
});
|
|
37
|
-
});
|