@pagopa/selfcare-common-frontend 1.10.5 → 1.10.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
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
|
+
#### [v1.10.6](https://github.com/pagopa/selfcare-common-frontend/compare/v1.10.5...v1.10.6)
|
|
8
|
+
|
|
9
|
+
- fixed userNotify timers configured once per notify [`#68`](https://github.com/pagopa/selfcare-common-frontend/pull/68)
|
|
10
|
+
- modified toast z-index [`#67`](https://github.com/pagopa/selfcare-common-frontend/pull/67)
|
|
11
|
+
|
|
7
12
|
#### [v1.10.5](https://github.com/pagopa/selfcare-common-frontend/compare/v1.10.4...v1.10.5)
|
|
8
13
|
|
|
14
|
+
> 26 April 2022
|
|
15
|
+
|
|
9
16
|
- modified subHeader fontSize [`#66`](https://github.com/pagopa/selfcare-common-frontend/pull/66)
|
|
10
17
|
|
|
11
18
|
#### [v1.10.4](https://github.com/pagopa/selfcare-common-frontend/compare/v1.10.3...v1.10.4)
|
package/build.info
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
20220426.
|
|
2
|
-
remotes/origin/SELC-222
|
|
1
|
+
20220426.2 - selfcare-common-frontend.deploy(29013)
|
|
2
|
+
remotes/origin/SELC-222 a3960ab7e269f97506c4fb4c31afe2e8770fdac0
|
package/components/Toast.js
CHANGED
|
@@ -13,7 +13,7 @@ const CustomAlert = (0, system_1.styled)(material_1.Alert)({
|
|
|
13
13
|
/** Selfcare's toast */
|
|
14
14
|
function Toast({ open, title, message, onCloseToast, logo = ConfirmIcon_1.default, leftBorderColor = '#00CF86', width = '376px', wrapped = false, bottom = '64px', right = '64px', }) {
|
|
15
15
|
const positionStyle = !wrapped
|
|
16
|
-
? { position: 'fixed', bottom, right, zIndex:
|
|
16
|
+
? { position: 'fixed', bottom, right, zIndex: 105 }
|
|
17
17
|
: { marginTop: 2 };
|
|
18
18
|
return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: open && ((0, jsx_runtime_1.jsx)(CustomAlert, { className: "userToast", variant: "outlined", sx: {
|
|
19
19
|
...positionStyle,
|
|
@@ -18,8 +18,11 @@ function UserNotifyHandle() {
|
|
|
18
18
|
const notifies = (0, react_redux_1.useSelector)(appStateSlice_1.appStateSelectors.selectNotifies);
|
|
19
19
|
const lastNotifiesToast = (0, react_1.useRef)([]);
|
|
20
20
|
const lastNotifyModal = (0, react_1.useRef)();
|
|
21
|
+
const timers = (0, react_1.useRef)({});
|
|
21
22
|
const onClose = (notify) => {
|
|
22
23
|
dispatch(appStateSlice_1.appStateActions.removeNotify(notify));
|
|
24
|
+
// eslint-disable-next-line functional/immutable-data
|
|
25
|
+
delete timers.current[notify.id];
|
|
23
26
|
if (notify === null || notify === void 0 ? void 0 : notify.onClose) {
|
|
24
27
|
notify.onClose();
|
|
25
28
|
}
|
|
@@ -30,13 +33,13 @@ function UserNotifyHandle() {
|
|
|
30
33
|
notify.onConfirm();
|
|
31
34
|
}
|
|
32
35
|
};
|
|
33
|
-
const { openModal, openToast } = updateCurrents(lastNotifyModal, lastNotifiesToast, notifies, onClose);
|
|
36
|
+
const { openModal, openToast } = updateCurrents(lastNotifyModal, lastNotifiesToast, notifies, onClose, timers.current);
|
|
34
37
|
const notifyModal = lastNotifyModal.current;
|
|
35
38
|
const notifiesToast = lastNotifiesToast.current;
|
|
36
39
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ToastWrapper_1.default, { children: notifiesToast.map((n) => ((0, jsx_runtime_1.jsx)(__1.Toast, { wrapped: true, open: openToast, title: n.title, message: n.message, logo: n.logo, leftBorderColor: n.leftBorderColor, onCloseToast: () => onClose(n), width: n.width }, n.id))) }), (0, jsx_runtime_1.jsx)(__1.SessionModal, { open: openModal, title: (_a = notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.title) !== null && _a !== void 0 ? _a : 'Notify Title', message: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.message, onConfirm: (notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.onConfirm) ? () => onConfirm(notifyModal) : undefined, onConfirmLabel: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.confirmLabel, handleClose: () => onClose(notifyModal), onCloseLabel: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.closeLabel, width: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.width })] }));
|
|
37
40
|
}
|
|
38
41
|
exports.default = UserNotifyHandle;
|
|
39
|
-
function updateCurrents(lastNotifyModalRef, lastNotifiesToastRef, notifies, onClose) {
|
|
42
|
+
function updateCurrents(lastNotifyModalRef, lastNotifiesToastRef, notifies, onClose, timers) {
|
|
40
43
|
const lastNotifiesToast = notifies.filter((e) => e.component === 'Toast');
|
|
41
44
|
const lastNotifySessionModal = notifies.find((e) => e.component === 'SessionModal');
|
|
42
45
|
const openToast = lastNotifiesToast.length > 0;
|
|
@@ -49,8 +52,10 @@ function updateCurrents(lastNotifyModalRef, lastNotifiesToastRef, notifies, onCl
|
|
|
49
52
|
// eslint-disable-next-line functional/immutable-data
|
|
50
53
|
lastNotifiesToastRef.current = lastNotifiesToast;
|
|
51
54
|
lastNotifiesToast.forEach((n) => {
|
|
52
|
-
if (n.autoclosable === 'timer') {
|
|
55
|
+
if (n.autoclosable === 'timer' && !timers[n.id]) {
|
|
53
56
|
setTimeout(() => onClose(n), n.autocloseMilliseconds);
|
|
57
|
+
// eslint-disable-next-line functional/immutable-data
|
|
58
|
+
timers[n.id] = true;
|
|
54
59
|
}
|
|
55
60
|
});
|
|
56
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserNotifyHandle.js","sourceRoot":"","sources":["../../src/lib/components/UserNotifyHandle.tsx"],"names":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CAAC,CAAC;IAEpF,MAAM,SAAS,GAAY,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;IACxD,MAAM,SAAS,GAAY,CAAC,CAAC,sBAAsB,CAAC;IAEpD,IAAI,sBAAsB,IAAI,sBAAsB,MAAK,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAA,EAAE;QACpF,qDAAqD;QACrD,kBAAkB,CAAC,OAAO,GAAG,sBAAsB,CAAC;KACrD;IACD,IAAI,SAAS,EAAE;QACb,qDAAqD;QACrD,oBAAoB,CAAC,OAAO,GAAG,iBAAiB,CAAC;QAEjD,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YAC9B,IAAI,CAAC,CAAC,YAAY,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;gBAC/C,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,qBAAqB,CAAC,CAAC;gBACtD,qDAAqD;gBACrD,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;aACrB;QACH,CAAC,CAAC,CAAC;KACJ;IACD,OAAO;QACL,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC"}
|
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.10.
|
|
4
|
+
"version": "1.10.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/pagopa/selfcare-common-frontend",
|
|
7
7
|
"author": "https://www.pagopa.gov.it",
|