@pagopa/selfcare-common-frontend 1.34.59 → 1.34.61

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 CHANGED
@@ -4,8 +4,10 @@ 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.34.59](https://github.com/pagopa/selfcare-common-frontend/compare/v1.35.0...v1.34.59)
7
+ #### [v1.34.61](https://github.com/pagopa/selfcare-common-frontend/compare/v1.35.0...v1.34.61)
8
8
 
9
+ - [SELC-7070] feat: handle list of success codes [`#287`](https://github.com/pagopa/selfcare-common-frontend/pull/287)
10
+ - [SELC-6995] feat: make the content of the diaolog avaible to the screen reader [`#286`](https://github.com/pagopa/selfcare-common-frontend/pull/286)
9
11
  - [SELC-6986] feat: and new action and update mui italia [`#285`](https://github.com/pagopa/selfcare-common-frontend/pull/285)
10
12
  - [SELC-6825] Add codeowners [`#284`](https://github.com/pagopa/selfcare-common-frontend/pull/284)
11
13
  - update mui italia version to 1.5.3 [`#283`](https://github.com/pagopa/selfcare-common-frontend/pull/283)
@@ -41,6 +43,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
41
43
  - SELC-2590 [`#186`](https://github.com/pagopa/selfcare-common-frontend/pull/186)
42
44
  - SELC-2590 - update common [`#185`](https://github.com/pagopa/selfcare-common-frontend/pull/185)
43
45
  - Used a environment variable to manage correct links in the footer based to product and actual environment [`#184`](https://github.com/pagopa/selfcare-common-frontend/pull/184)
46
+ - [SELC-7070] feat: handle list of success codes (#287) [`#7070`](https://pagopa.atlassian.net/browse/7070)
47
+ - [SELC-6995] feat: make the content of the diaolog avaible to the screen reader (#286) [`#6995`](https://pagopa.atlassian.net/browse/6995)
44
48
  - [SELC-6986] feat: and new action and update mui italia (#285) [`#6986`](https://pagopa.atlassian.net/browse/6986)
45
49
  - [SELC-6825] Add codeowners (#284) [`#6825`](https://pagopa.atlassian.net/browse/6825)
46
50
  - [SELC-6417] feat: return status code for 404 case (#276) [`#6417`](https://pagopa.atlassian.net/browse/6417)
@@ -104,10 +108,21 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
104
108
  - Bump validator and @types/validator [`bca7ef1`](https://github.com/pagopa/selfcare-common-frontend/commit/bca7ef12f16fa24b75d5acbe5a96e1509c479b9e)
105
109
  - Bump react and @types/react [`12e0229`](https://github.com/pagopa/selfcare-common-frontend/commit/12e02297e407502c4d1c4e97b1396e5e5de1cd9f)
106
110
 
107
- #### [v1.35.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.58...v1.35.0)
111
+ #### [v1.35.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.60...v1.35.0)
108
112
 
109
113
  > 20 July 2023
110
114
 
115
+ #### [v1.34.60](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.59...v1.34.60)
116
+
117
+ > 6 June 2025
118
+
119
+ - [SELC-6995] feat: make the content of the diaolog avaible to the screen reader [`#286`](https://github.com/pagopa/selfcare-common-frontend/pull/286)
120
+ - [SELC-6995] feat: make the content of the diaolog avaible to the screen reader (#286) [`#6995`](https://pagopa.atlassian.net/browse/6995)
121
+
122
+ #### [v1.34.59](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.58...v1.34.59)
123
+
124
+ > 26 May 2025
125
+
111
126
  #### [v1.34.58](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.57...v1.34.58)
112
127
 
113
128
  > 8 May 2025
package/build.info CHANGED
@@ -1,2 +1,2 @@
1
- 20250526.1 - selfcare-common-frontend.deploy(214410)
2
- tags/v1.29.0~1^2 193546606d80739028ea3ef6941c9fd855a2aad6
1
+ 20250619.1 - selfcare-common-frontend.deploy(218720)
2
+ tags/v1.29.0~1^2 5347da3d55e07d5162af52a6dc59860731026a84
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
1
  import { TFunction } from 'i18next';
2
+ import * as React from 'react';
3
3
  type Props = {
4
4
  /** If this component should be displayed or not */
5
5
  open: boolean;
@@ -2,20 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ClearOutlined_1 = tslib_1.__importDefault(require("@mui/icons-material/ClearOutlined"));
5
6
  const material_1 = require("@mui/material");
6
7
  const Dialog_1 = tslib_1.__importDefault(require("@mui/material/Dialog"));
7
- const useMediaQuery_1 = tslib_1.__importDefault(require("@mui/material/useMediaQuery"));
8
8
  const styles_1 = require("@mui/material/styles");
9
- const ClearOutlined_1 = tslib_1.__importDefault(require("@mui/icons-material/ClearOutlined"));
9
+ const useMediaQuery_1 = tslib_1.__importDefault(require("@mui/material/useMediaQuery"));
10
10
  const react_i18next_1 = require("react-i18next");
11
11
  /** Selfcare's popup */
12
12
  function SessionModal({ t, open, title, message, onConfirm, onConfirmEnabled = true, onConfirmLabel = t('common.sessionModal.confirmButton'), productEnvironments, handleClose, handleExit = handleClose, onCloseLabel = t('common.sessionModal.closeButton'), height, minHeight, width = '100%', showCloseIcon = false, showCloseButton = true, }) {
13
13
  const theme = (0, styles_1.useTheme)();
14
14
  const fullScreen = (0, useMediaQuery_1.default)(theme.breakpoints.down('xs'));
15
- return ((0, jsx_runtime_1.jsx)(Dialog_1.default, { fullScreen: fullScreen, open: open, onClose: handleClose, "aria-labelledby": "responsive-dialog-title", children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, sx: { height, minHeight, width, maxWidth: '100%' }, px: 4, children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: 12, mt: 4, children: [showCloseIcon && ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: handleExit, style: { position: 'absolute', top: '20px', right: '16px', zIndex: 100 }, children: (0, jsx_runtime_1.jsx)(ClearOutlined_1.default, {}) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { fontSize: '24px', fontWeight: '700', wordBreak: 'break-word' }, children: title })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { width: "100%", children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, mt: 2, mb: 3, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", children: message }) }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: 12, display: "flex", justifyContent: productEnvironments ? 'space-between' : 'flex-end', flexWrap: 'wrap-reverse', children: [showCloseButton && ((0, jsx_runtime_1.jsx)(material_1.Box, { mb: 3, mt: 0, children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleClose, color: "primary", variant: "outlined", children: onCloseLabel }) })), onConfirm && ((0, jsx_runtime_1.jsxs)(material_1.Box, { mb: 3, display: "flex", flexDirection: "row-reverse", children: [(0, jsx_runtime_1.jsx)(material_1.Button, { sx: { marginLeft: 2 }, color: "primary", variant: "contained", onClick: onConfirm, disabled: !onConfirmEnabled, children: onConfirmLabel }), productEnvironments &&
16
- productEnvironments.map((p) => ((0, jsx_runtime_1.jsx)(material_1.Box, { ml: 2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { value: p.environment, color: "primary", variant: "contained", onClick: onConfirm, children: p.environment
17
- .toLowerCase()
18
- .replace(/\b[a-z]/g, p.environment.charAt(0).toUpperCase()) }) }, p.environment)))] }))] })] })] }) }));
15
+ return ((0, jsx_runtime_1.jsx)(Dialog_1.default, { fullScreen: fullScreen, open: open, onClose: handleClose, "aria-labelledby": "session-modal-title", "aria-describedby": "session-modal-description", children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, sx: { height, minHeight, width, maxWidth: '100%' }, px: 4, children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: 12, mt: 4, children: [showCloseIcon && ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: handleExit, style: { position: 'absolute', top: '20px', right: '16px', zIndex: 100 }, children: (0, jsx_runtime_1.jsx)(ClearOutlined_1.default, {}) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { id: "session-modal-title", variant: "h6", sx: { fontSize: '24px', fontWeight: '700', wordBreak: 'break-word' }, children: title })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { width: "100%", children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, mt: 2, mb: 3, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { id: "session-modal-description", variant: "body1", children: message }) }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: 12, display: "flex", justifyContent: productEnvironments ? 'space-between' : 'flex-end', flexWrap: 'wrap-reverse', children: [showCloseButton && ((0, jsx_runtime_1.jsx)(material_1.Box, { mb: 3, mt: 0, children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleClose, color: "primary", variant: "outlined", children: onCloseLabel }) })), onConfirm && ((0, jsx_runtime_1.jsxs)(material_1.Box, { mb: 3, display: "flex", flexDirection: "row-reverse", children: [(0, jsx_runtime_1.jsx)(material_1.Button, { sx: { marginLeft: 2 }, color: "primary", variant: "contained", onClick: onConfirm, disabled: !onConfirmEnabled, children: onConfirmLabel }), productEnvironments === null || productEnvironments === void 0 ? void 0 : productEnvironments.map((p) => ((0, jsx_runtime_1.jsx)(material_1.Box, { ml: 2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { value: p.environment, color: "primary", variant: "contained", onClick: onConfirm, children: p.environment
16
+ .toLowerCase()
17
+ .replace(/\b[a-z]/g, p.environment.charAt(0).toUpperCase()) }) }, p.environment)))] }))] })] })] }) }));
19
18
  }
20
19
  exports.default = (0, react_i18next_1.withTranslation)()(SessionModal);
21
20
  //# sourceMappingURL=SessionModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SessionModal.js","sourceRoot":"","sources":["../../../src/lib/components/SessionModal.tsx"],"names":[],"mappings":";;;;AACA,4CAA0E;AAC1E,0EAA0C;AAC1C,wFAAwD;AACxD,iDAAgD;AAChD,8FAAkE;AAClE,iDAAgD;AAwChD,uB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CAAC,WAAW,EAAE,CAAC,GACtD,IAVM,CAAC,CAAC,WAAW,CAWxB,CACP,CAAC,IACA,CACP,IACI,IACH,IACD,GACA,CACV,CAAC;AACJ,CAAC;AACD,kBAAe,IAAA,+BAAe,GAAE,CAAC,YAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"SessionModal.js","sourceRoot":"","sources":["../../../src/lib/components/SessionModal.tsx"],"names":[],"mappings":";;;;AAAA,8FAAkE;AAClE,4CAA0E;AAC1E,0EAA0C;AAC1C,iDAAgD;AAChD,wFAAwD;AAGxD,iDAAgD;AAuChD,uBAAuB;AACvB,SAAS,YAAY,CAAC,EACpB,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,gBAAgB,GAAG,IAAI,EACvB,cAAc,GAAG,CAAC,CAAC,mCAAmC,CAAC,EACvD,mBAAmB,EACnB,WAAW,EACX,UAAU,GAAG,WAAW,EACxB,YAAY,GAAG,CAAC,CAAC,iCAAiC,CAAC,EACnD,MAAM,EACN,SAAS,EACT,KAAK,GAAG,MAAM,EACd,aAAa,GAAG,KAAK,EACrB,eAAe,GAAG,IAAI,GAChB;IACN,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE/D,OAAO,CACL,uBAAC,gBAAM,IACL,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,qBACJ,qBAAqB,sBACpB,2BAA2B,YAE5C,wBAAC,eAAI,IAAC,SAAS,QAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,aACvE,wBAAC,eAAI,IAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,aACrB,aAA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AAC,WAAW,EACnB,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,CAAC,gBAAgB,YAE1B,cAAc,GACR,EACR,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC/B,uBAAC,cAAG,IAAC,EAAE,EAAE,CAAC,YACR,uBAAC,iBAAM,IACL,KAAK,EAAE,CAAC,CAAC,WAAW,EACpB,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,SAAS,YAEjB,CAAC,CAAC,WAAW;qDACX,WAAW,EAAE;qDACb,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,GACtD,IAVM,CAAC,CAAC,WAAW,CAWxB,CACP,CAAC,IACE,CACP,IACI,IACH,IACD,GACA,CACV,CAAC;AACJ,CAAC;AACD,kBAAe,IAAA,+BAAe,GAAE,CAAC,YAAY,CAAC,CAAC"}
@@ -13,4 +13,4 @@ If notValidTokenHttpStatus is not null and the returned status is equal to notVa
13
13
  If notAuthorizedTokenHttpStatus is not null and the returned status is equal to notAuthorizedTokenHttpStatus, it will throw an Error with message "Operation not allowed".
14
14
  If emptyResponseHttpStatus is not null and the returned status is equal to emptyResponseHttpStatus, it will return a promise that resolve to null value.
15
15
  Other statuses will return will throw a generic error. */
16
- export declare const extractResponse: <R>(response: t.Validation<TypeofApiResponse<ApiRequestType<any, any, any, IResponseType<any, any, any>>>>, successHttpStatus: number, onRedirectToLogin: () => void, notValidTokenHttpStatus?: number | null, notAuthorizedTokenHttpStatus?: number | null, emptyResponseHttpStatus?: number | null) => Promise<R>;
16
+ export declare const extractResponse: <R>(response: t.Validation<TypeofApiResponse<ApiRequestType<any, any, any, IResponseType<any, any, any>>>>, successHttpStatus: number | Array<number>, onRedirectToLogin: () => void, notValidTokenHttpStatus?: number | null, notAuthorizedTokenHttpStatus?: number | null, emptyResponseHttpStatus?: number | null) => Promise<R>;
@@ -32,8 +32,9 @@ If notAuthorizedTokenHttpStatus is not null and the returned status is equal to
32
32
  If emptyResponseHttpStatus is not null and the returned status is equal to emptyResponseHttpStatus, it will return a promise that resolve to null value.
33
33
  Other statuses will return will throw a generic error. */
34
34
  const extractResponse = async (response, successHttpStatus, onRedirectToLogin, notValidTokenHttpStatus = 401, notAuthorizedTokenHttpStatus = 403, emptyResponseHttpStatus = 404) => {
35
+ const successCodes = Array.isArray(successHttpStatus) ? successHttpStatus : [successHttpStatus];
35
36
  if ((0, Either_1.isRight)(response)) {
36
- if (response.right.status === successHttpStatus) {
37
+ if (successCodes.includes(response.right.status)) {
37
38
  return response.right.value;
38
39
  }
39
40
  else if (notValidTokenHttpStatus && response.right.status === notValidTokenHttpStatus) {
@@ -1 +1 @@
1
- {"version":3,"file":"api-utils.js","sourceRoot":"","sources":["../../../src/lib/utils/api-utils.ts"],"names":[],"mappings":";;;AACA,6CAAoD;AAEpD,mDAA2C;AAC3C,wDAAwF;AAGxF,uCAAuC;AACvC,iEAAgE;AAEhE,gEAAgE;AACzD,MAAM,iBAAiB,GAAG,CAAC,KAAoB,EAAE,EAAE,CACxD,KAAK,CAAC,QAAQ,CACZ,+BAAe,CAAC,QAAQ,CAAC;IACvB,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,IAAI,KAAK,EAAE;IAClB,eAAe,EAAE,4BAA4B;IAC7C,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,gBAAgB,EAAE,kBAAkB;IACpC,sBAAsB,EAAE,mDAAmD;CAC5E,CAAC,CACH,CAAC;AAXS,QAAA,iBAAiB,qBAW1B;AAEJ,mEAAmE;AAC5D,MAAM,aAAa,GAAG,CAC3B,YAAoB,MAAM,EACyD,EAAE;IACrF,qDAAqD;IACrD,MAAM,cAAc,GAAG,IAAA,sBAAc,EAAC,kBAAK,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,C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CAAC;SAC3C;aAAM,IAAI,uBAAuB,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,uBAAuB,EAAE;YACvF,OAAO,OAAO,CAAC,OAAO,CAAC,IAAoB,CAAC,CAAC;SAC9C;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,oCAAoC,iBAAiB,aAAa,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAC1F,CAAC;YACF,6DAA6D;YAC7D,aAAa;YACb,qDAAqD;YACrD,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;YACzC,6DAA6D;YAC7D,aAAa;YACb,qDAAqD;YACrD,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;YACtC,MAAM,KAAK,CAAC;SACb;KACF;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC1D,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7C,MAAM,IAAA,gBAAO,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC;AA7CW,QAAA,eAAe,mBA6C1B"}
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.34.59",
4
+ "version": "1.34.61",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/pagopa/selfcare-common-frontend",
7
7
  "author": "https://www.pagopa.gov.it",