@pagopa/selfcare-common-frontend 1.1.0 → 1.2.2
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 +9 -2
- package/README.md +85 -1
- package/build.info +2 -2
- package/components/EndingPage.js +1 -1
- package/components/EndingPage.js.map +1 -1
- package/components/ErrorBoundary/ErrorBoundary.js +6 -9
- package/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/components/FilterModal.d.ts +1 -1
- package/components/Footer/Footer.d.ts +2 -1
- package/components/Footer/Footer.js +9 -5
- package/components/Footer/Footer.js.map +1 -1
- package/components/SessionModal.js +1 -1
- package/components/SessionModal.js.map +1 -1
- package/components/TitleBox.d.ts +1 -2
- package/components/TitleBox.js.map +1 -1
- package/components/UnloadEventHandler.d.ts +8 -0
- package/components/UnloadEventHandler.js +33 -0
- package/components/UnloadEventHandler.js.map +1 -0
- package/components/UserNotifyHandle.d.ts +7 -0
- package/components/UserNotifyHandle.js +55 -0
- package/components/UserNotifyHandle.js.map +1 -0
- package/hooks/useErrorDispatcher.d.ts +1 -1
- package/hooks/useErrorDispatcher.js +1 -1
- package/hooks/useErrorDispatcher.js.map +1 -1
- package/hooks/useLoading.d.ts +1 -1
- package/hooks/useLoading.js +1 -1
- package/hooks/useLoading.js.map +1 -1
- package/hooks/useUnloadEventInterceptor.d.ts +17 -0
- package/hooks/useUnloadEventInterceptor.js +60 -0
- package/hooks/useUnloadEventInterceptor.js.map +1 -0
- package/hooks/useUserNotify.d.ts +3 -0
- package/hooks/useUserNotify.js +11 -0
- package/hooks/useUserNotify.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/model/UserNotify.d.ts +23 -0
- package/model/UserNotify.js +3 -0
- package/model/UserNotify.js.map +1 -0
- package/package.json +14 -6
- package/redux/slices/appStateSlice.d.ts +45 -2
- package/redux/slices/appStateSlice.js +43 -0
- package/redux/slices/appStateSlice.js.map +1 -1
- package/redux/slices/userSlice.d.ts +3 -1
- package/redux/slices/userSlice.js.map +1 -1
- package/utils/api-utils.d.ts +16 -0
- package/utils/api-utils.js +63 -0
- package/utils/api-utils.js.map +1 -0
- package/utils/constants.d.ts +3 -0
- package/utils/constants.js +3 -0
- package/utils/constants.js.map +1 -1
- package/utils/fixSwagger20ArraySchemaDef.js +67 -0
- package/utils/routes-utils.d.ts +1 -0
- package/utils/routes-utils.js +1 -0
- package/utils/routes-utils.js.map +1 -1
- package/utils/storage-utils.d.ts +3 -0
- package/utils/storage-utils.js +3 -0
- package/utils/storage-utils.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,20 @@ 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
|
-
#### 1.
|
|
7
|
+
#### 1.2.2
|
|
8
8
|
|
|
9
|
+
- Selc 447 session modal defaults [`#13`](https://github.com/pagopa/selfcare-common-frontend/pull/13)
|
|
10
|
+
- SELC-417 fixed useUnloadEventInterceptor useEffect [`#12`](https://github.com/pagopa/selfcare-common-frontend/pull/12)
|
|
11
|
+
- added api-utils and utility to use together with @pagopa/openapi-codegen-ts [`#11`](https://github.com/pagopa/selfcare-common-frontend/pull/11)
|
|
12
|
+
- Selc-408 fix concurrent notify [`#10`](https://github.com/pagopa/selfcare-common-frontend/pull/10)
|
|
13
|
+
- bug fix [`#8`](https://github.com/pagopa/selfcare-common-frontend/pull/8)
|
|
14
|
+
- Selc 408 Implementare gestione notifiche utente [`#7`](https://github.com/pagopa/selfcare-common-frontend/pull/7)
|
|
15
|
+
- fix EndingPage width [`#6`](https://github.com/pagopa/selfcare-common-frontend/pull/6)
|
|
9
16
|
- SELC 369 [`#5`](https://github.com/pagopa/selfcare-common-frontend/pull/5)
|
|
10
17
|
- SELC-393 Gestione visualizzazione errore tramite Toast [`#4`](https://github.com/pagopa/selfcare-common-frontend/pull/4)
|
|
11
18
|
- Bump node-fetch from 3.0.0 to 3.1.1 [`#3`](https://github.com/pagopa/selfcare-common-frontend/pull/3)
|
|
12
19
|
- Bump nanoid from 3.1.30 to 3.2.0 [`#2`](https://github.com/pagopa/selfcare-common-frontend/pull/2)
|
|
13
20
|
- Bump follow-redirects from 1.14.4 to 1.14.7 [`#1`](https://github.com/pagopa/selfcare-common-frontend/pull/1)
|
|
14
21
|
- common logic extracted [`06d5b9c`](https://github.com/pagopa/selfcare-common-frontend/commit/06d5b9cc4d9a653e8ed08294efa011cd40cf80b7)
|
|
22
|
+
- Selc 417 (#9) - UnloadEventInterceptor feature [`59e769d`](https://github.com/pagopa/selfcare-common-frontend/commit/59e769d382f422a7ab6c687a0e8655854df25193)
|
|
15
23
|
- example code [`37e354d`](https://github.com/pagopa/selfcare-common-frontend/commit/37e354d15a0d7e74a6e568127267ce17cd6b78fa)
|
|
16
|
-
- fixed svg icon [`3c32a11`](https://github.com/pagopa/selfcare-common-frontend/commit/3c32a11296354b60ee47c69dfe849bd53d8f83fd)
|
package/README.md
CHANGED
|
@@ -81,7 +81,7 @@ Selfcare's page title
|
|
|
81
81
|
| title | string | Y | The title to show |
|
|
82
82
|
| subTitle | string | N | The subtitle to show |
|
|
83
83
|
| mtTitle | number | N | The margin top of the title |
|
|
84
|
-
| mbTitle |
|
|
84
|
+
| mbTitle | number | N | The margin bottom of the title |
|
|
85
85
|
| mbSubTitle | number | N | The margin bottom of the subtitle |
|
|
86
86
|
| variantTitle | Variant | N | The variant of the Typografy used for the title |
|
|
87
87
|
| variantSubTitle | Variant | N | The variant of the Typografy used for the subtitle |
|
|
@@ -109,6 +109,52 @@ Selfcare's ending page
|
|
|
109
109
|
| buttonLabel | string | N | The ending page button label if any |
|
|
110
110
|
| onButtonClick | () => void | N | if defined it will show a button that will performe this action on click |
|
|
111
111
|
|
|
112
|
+
# Utility functions
|
|
113
|
+
## api-utils
|
|
114
|
+
### onRedirectToLogin: (store: EnhancedStore) => void
|
|
115
|
+
To show an error popup to inform of the not valid session
|
|
116
|
+
|
|
117
|
+
### buildFetchApi = (timeoutMs: number = 300000) => fetch
|
|
118
|
+
Return the implementation of fetch configured with a timeout
|
|
119
|
+
|
|
120
|
+
### extractResponse <R>(response: t.Validation<TypeofApiResponse<any>>, successHttpStatus: number, onRedirectToLogin: () => void, notValidTokenHttpStatus: number | null = 401, notAuthorizedTokenHttpStatus: number | null = 403, emptyResponseHttpStatus: number | null = 404): Promise<R>
|
|
121
|
+
Extract the response of a @pagopa/openapi-codegen-ts generated client rest invocation having status code successHttpStatus.
|
|
122
|
+
If notValidTokenHttpStatus is not null and the returned status is equal to notValidTokenHttpStatus, it will call the onRedirectToLogin function and will schedule the redirect towards logout path.
|
|
123
|
+
If notAuthorizedTokenHttpStatus is not null and the returned status is equal to notAuthorizedTokenHttpStatus, it will throw an Error with message "Operation not allowed".
|
|
124
|
+
If emptyResponseHttpStatus is not null and the returned status is equal to emptyResponseHttpStatus, it will return a promise that resolve to null value.
|
|
125
|
+
Other statuses will return will throw a generic error.
|
|
126
|
+
|
|
127
|
+
## constants
|
|
128
|
+
### STORAGE_KEY_USER: string
|
|
129
|
+
The key used to store in the session storage the loggedUser in selfcare projects
|
|
130
|
+
|
|
131
|
+
### STORAGE_KEY_TOKEN: string
|
|
132
|
+
The key used to store in the session storage the logged user token in selfcare projects
|
|
133
|
+
|
|
134
|
+
### roleLabels: { [key in UserRole]: { shortLabel: string; longLabel: string } }
|
|
135
|
+
The short and long labels used for the roles of selfcare's projects
|
|
136
|
+
|
|
137
|
+
## routes-utils
|
|
138
|
+
### resolvePathVariables: (path: string, pathVariables: { [key: string]: string }): string
|
|
139
|
+
It will resolve the path variables in path using the provided map
|
|
140
|
+
|
|
141
|
+
## storage-utils
|
|
142
|
+
### storageDelete: (key: string) => void
|
|
143
|
+
It will delete a key from the local session storage
|
|
144
|
+
|
|
145
|
+
### storageWrite: (key: string, value: StorageValue, type: StorageValueType) => void
|
|
146
|
+
It will store a key/value pair in the local session storage
|
|
147
|
+
|
|
148
|
+
### function storageRead: (key: string, type: StorageValueType) => void
|
|
149
|
+
It will read a key from the local session storage
|
|
150
|
+
|
|
151
|
+
## utils
|
|
152
|
+
### formatDateAsLongString: (date: Date) => string
|
|
153
|
+
It will return a string representing the provided date in the italian format gg mmm aaaa
|
|
154
|
+
|
|
155
|
+
## fixSwagger20ArraySchemaDef.js
|
|
156
|
+
An utility script to use when generating the stub through @pagopa/openapi-codegen-ts in order to handle the REST api whose operations returns an array of objects
|
|
157
|
+
|
|
112
158
|
# Common decorators used in pagopa/selfcare react projects
|
|
113
159
|
## withLogin
|
|
114
160
|
This feature is based on react-redux library and require to register the reducer build in userSlice into the application's redux store.
|
|
@@ -149,3 +195,41 @@ The error to be submitted has type AppError which has the following fields:
|
|
|
149
195
|
| component | string | N | Can render a SessionModal or Toast component |
|
|
150
196
|
|
|
151
197
|
ASIS the notify consists just on the console.error invocation
|
|
198
|
+
|
|
199
|
+
## UserNotifyHandle
|
|
200
|
+
This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
|
|
201
|
+
It allows to dispatch User Notifies in order to display a pop up or a toast notification.
|
|
202
|
+
|
|
203
|
+
To use this feature you have to put UserNotifyHandle in your App as a child of a redux Provider component.
|
|
204
|
+
In order to dispatch a User Notify, you have to use the custom hook useUserNotify which will return a fuction to be used to dispatch the User Notify.
|
|
205
|
+
|
|
206
|
+
The user notify to be submitted has type UserNotify which has the following fields:
|
|
207
|
+
|
|
208
|
+
| Field | Type | Mandatory | Description |
|
|
209
|
+
|-------|------|-----------|-------------|
|
|
210
|
+
| id | string | Y | The identifier used to recognize the user notify: it cannot be possible to have the same error id at the same time |
|
|
211
|
+
| title | string | Y | / The title to show in the popup or toast |
|
|
212
|
+
| message | React.ReactNode | Y | The body to show in the popup or toast |
|
|
213
|
+
| logo | React.ElementType | N | If component === 'Toast'. The logo to be rendered. As default a confirm logo will be used |
|
|
214
|
+
| leftBorderColor | string | N | If component === 'Toast'. The color used for the left border |
|
|
215
|
+
| onConfirm | () => void | N | If component === 'SessionModal'. If defined, it will render a confirm button which will execute this function |
|
|
216
|
+
| confirmLabel | string | N | If component === 'SessionModal'. If present, this string will rappresent the confirm button label |
|
|
217
|
+
| onClose | () => void | N | If defined, it will be executed when closing the popup |
|
|
218
|
+
| closeLabel | string | N | If component === 'SessionModal'. The close button label |
|
|
219
|
+
| component | string | N | Can render a SessionModal or Toast component |
|
|
220
|
+
|
|
221
|
+
## UnloadEventHandler
|
|
222
|
+
This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
|
|
223
|
+
It allows to intercept when the user try to exit from the current page and ask him if he wants to continue or not.
|
|
224
|
+
|
|
225
|
+
To use this feature you have to put UnloadEventHandler in your App as a child of a redux Provider component.
|
|
226
|
+
In order to use this feature you have to use the custom hook useUnloadEventInterceptor, which will return an object having the following keys:
|
|
227
|
+
1. registerUnloadEvent: an arrow function which takes two optional parameters to customize the title and the description of the pop-up opened when invoking the exitAction function (see below) and enable the functionality.
|
|
228
|
+
2. unregisterUnloadEvent: an arrow function to call in order to disable this functionality.
|
|
229
|
+
|
|
230
|
+
If you wont to enable immediately this functionality when invoking the custom hook you can use the hook useUnloadEventInterceptorAndActivate, which will enable the functionality and will disable it when unmounting the component.
|
|
231
|
+
|
|
232
|
+
In order to show a custom pop-up when the user trigger an exit action you have to use the custom hook useUnloadEventOnExit which will return an arrow function to invoke instead of the exit action passing to it the exitAction itself.
|
|
233
|
+
|
|
234
|
+
When the exitAction is the Logout you can use the custom hook useUnloadEventLogout which is the customization of the useUnloadEventOnExit using the logout as an exit action.
|
|
235
|
+
|
package/build.info
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
tags/v1.
|
|
1
|
+
20220202.2 - selfcare-common-frontend.deploy(18875)
|
|
2
|
+
tags/v1.2.2^0 504858b61e5a76d093014dae8c7ba484879d5a78
|
package/components/EndingPage.js
CHANGED
|
@@ -5,5 +5,5 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const CheckIllustrationIcon_1 = (0, tslib_1.__importDefault)(require("./icons/CheckIllustrationIcon"));
|
|
7
7
|
/** Selfcare's Ending Page */
|
|
8
|
-
exports.default = ({ description, onButtonClick, icon = (0, jsx_runtime_1.jsx)(CheckIllustrationIcon_1.default, {}, void 0), title, buttonLabel }) => ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { minHeight: '100vh' }, display: "flex" }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true, direction: "column", style: { textAlign: 'center' }, margin: 'auto' }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center", mb: 5 }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: icon }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h2" }, { children: title }), void 0) }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center", mb: 7, mt: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { children: description }, void 0) }), void 0) }), void 0), onButtonClick && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", sx: { width: '200px', alignSelf: 'center' }, onClick: onButtonClick }, { children: buttonLabel }), void 0) }), void 0) }), void 0))] }), "0") }), void 0));
|
|
8
|
+
exports.default = ({ description, onButtonClick, icon = (0, jsx_runtime_1.jsx)(CheckIllustrationIcon_1.default, {}, void 0), title, buttonLabel }) => ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { minHeight: '100vh' }, display: "flex", flexGrow: 1 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true, direction: "column", style: { textAlign: 'center' }, margin: 'auto' }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center", mb: 5 }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: icon }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h2" }, { children: title }), void 0) }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center", mb: 7, mt: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { children: description }, void 0) }), void 0) }), void 0), onButtonClick && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", sx: { width: '200px', alignSelf: 'center' }, onClick: onButtonClick }, { children: buttonLabel }), void 0) }), void 0) }), void 0))] }), "0") }), void 0));
|
|
9
9
|
//# sourceMappingURL=EndingPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EndingPage.js","sourceRoot":"","sources":["../../src/lib/components/EndingPage.tsx"],"names":[],"mappings":";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,QAAQ,EAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,gBACvD,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,qBAAU,cACR,WAAW,WACD,YACR,YACF,EACN,aAAa,IAAI,CAChB,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,gBAC1C,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,iBAAM,kBACL,OAAO,EAAC,WAAW,EACnB,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAC3C,OAAO,EAAE,aAAa,gBAErB,WAAW,YACL,YACJ,YACF,CACR,MA9BoC,GAAG,CA+BnC,YACH,CACP,CAAC"}
|
|
@@ -16,7 +16,7 @@ const BlockingErrorPage_1 = (0, tslib_1.__importDefault)(require("./components/B
|
|
|
16
16
|
It allows to dispatch errors in order to display a warning or the error page to the user.
|
|
17
17
|
Errors dispatched will be notified using errorService
|
|
18
18
|
|
|
19
|
-
To use this feature you have to put
|
|
19
|
+
To use this feature you have to put ErrorBoundary in your App as a child of a redux Provider component.
|
|
20
20
|
In order to dispatch an error you have to use the custom hook useErrorDispatcher which will return a fuction to be used to dispatch the error. */
|
|
21
21
|
class ErrorBoundary extends react_1.Component {
|
|
22
22
|
constructor(props) {
|
|
@@ -46,19 +46,16 @@ class ErrorBoundary extends react_1.Component {
|
|
|
46
46
|
(0, errorService_1.handleErrors)(this.props.errors);
|
|
47
47
|
}
|
|
48
48
|
if (!hasBlockingError) {
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [this.props.children, hasError && this.buildNotBlockingError(this.props.errors
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [this.props.children, hasError && this.buildNotBlockingError(this.props.errors)] }, void 0));
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
52
|
return ((0, jsx_runtime_1.jsx)(BlockingErrorPage_1.default, { description: blockingErrors[0].displayableDescription, assistanceEmail: this.props.assistanceEmail }, void 0));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
buildNotBlockingError(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return this.buildErrorToast(error);
|
|
61
|
-
}
|
|
55
|
+
buildNotBlockingError(errors) {
|
|
56
|
+
const errorModal = errors.find((e) => e.component === 'SessionModal');
|
|
57
|
+
const errorToast = errors.find((e) => e.component === 'Toast');
|
|
58
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [errorModal && this.buildErrorModal(errorModal), errorToast && this.buildErrorToast(errorToast)] }, void 0));
|
|
62
59
|
}
|
|
63
60
|
buildErrorToast(error) {
|
|
64
61
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../src/lib/components/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":";;;;AACA,mCAAkC;AAClC,iCAAgF;AAChF,6CAAsC;AACtC,uCAA0C;AAC1C,oEAAgG;AAChG,8DAA2D;AAC3D,gFAA2C;AAC3C,kEAA6B;AAC7B,gFAA2C;AAC3C,oGAA+D;AAa/D;;;;;iJAKiJ;AACjJ,MAAM,aAAc,SAAQ,iBAAiC;IAC3D,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC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kB,CACnB,CAAC,aAAa,CAAC,CAAC;AACjB,kBAAe,sBAAsB,CAAC"}
|
|
@@ -6,7 +6,7 @@ declare type Props = {
|
|
|
6
6
|
handleClose: React.MouseEventHandler<HTMLButtonElement>;
|
|
7
7
|
/** The popup title */
|
|
8
8
|
title: string;
|
|
9
|
-
/** @see FilterModalConfig */
|
|
9
|
+
/** @see {@link FilterModalConfig} */
|
|
10
10
|
filterModalConfig?: FilterModalConfig<any, any>;
|
|
11
11
|
/** The popup height */
|
|
12
12
|
height?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
declare type Props = {
|
|
2
2
|
/** The email to which the assistance button will ask to send an email */
|
|
3
3
|
assistanceEmail?: string;
|
|
4
|
+
onExit?: (exitAction: () => void) => void;
|
|
4
5
|
};
|
|
5
6
|
/** SelfCare Footer component */
|
|
6
|
-
declare const Footer: ({ assistanceEmail }: Props) => JSX.Element;
|
|
7
|
+
declare const Footer: ({ assistanceEmail, onExit }: Props) => JSX.Element;
|
|
7
8
|
export default Footer;
|
|
@@ -6,7 +6,7 @@ const material_1 = require("@mui/material");
|
|
|
6
6
|
const assistanceService_1 = require("../../services/assistanceService");
|
|
7
7
|
const PagoPaIcon_1 = (0, tslib_1.__importDefault)(require("../icons/PagoPaIcon"));
|
|
8
8
|
/** SelfCare Footer component */
|
|
9
|
-
const Footer = ({ assistanceEmail }) => ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "footer", sx: {
|
|
9
|
+
const Footer = ({ assistanceEmail, onExit = exitAction => exitAction() }) => ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "footer", sx: {
|
|
10
10
|
pt: '32px',
|
|
11
11
|
height: '156px',
|
|
12
12
|
mt: 'auto',
|
|
@@ -27,22 +27,26 @@ const Footer = ({ assistanceEmail }) => ((0, jsx_runtime_1.jsxs)(material_1.Box,
|
|
|
27
27
|
lineHeight: '15px',
|
|
28
28
|
textAlign: 'left',
|
|
29
29
|
padding: '0px',
|
|
30
|
-
}, component: "div" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({
|
|
30
|
+
}, component: "div" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ onClick: () => onExit(() => window.location.assign('https://www.pagopa.it/it/privacy-policy/')), underline: "none", sx: {
|
|
31
31
|
marginRight: '10px',
|
|
32
32
|
color: '#9BB7CB !important',
|
|
33
33
|
textDecoration: 'none !important',
|
|
34
|
-
|
|
34
|
+
cursor: 'pointer'
|
|
35
|
+
} }, { children: 'Privacy Policy ' }), void 0), (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ onClick: () => onExit(() => window.location.assign('https://www.pagopa.it/it/termini-e-condizioni-di-utilizzo-del-sito/')), underline: "none", sx: {
|
|
35
36
|
margin: '10px',
|
|
36
37
|
color: '#9BB7CB !important',
|
|
37
38
|
textDecoration: 'none !important',
|
|
38
|
-
|
|
39
|
+
cursor: 'pointer'
|
|
40
|
+
} }, { children: 'Termini e condizioni d’uso del sito ' }), void 0), (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ onClick: () => onExit(() => window.location.assign('https://www.pagopa.it/static/781646994f1f8ddad2d95af3aaedac3d/Sicurezza-delle-informazioni_PagoPA-S.p.A..pdft')), underline: "none", sx: {
|
|
39
41
|
marginRight: '10px',
|
|
40
42
|
color: '#9BB7CB !important',
|
|
41
43
|
textDecoration: 'none !important',
|
|
42
|
-
|
|
44
|
+
cursor: 'pointer'
|
|
45
|
+
} }, { children: 'Sicurezza delle informazioni ' }), void 0), assistanceEmail && ((0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ onClick: () => onExit(() => window.location.assign((0, assistanceService_1.buildAssistanceURI)(assistanceEmail))), underline: "none", sx: {
|
|
43
46
|
margin: '10px',
|
|
44
47
|
color: '#9BB7CB !important',
|
|
45
48
|
textDecoration: 'none !important',
|
|
49
|
+
cursor: 'pointer'
|
|
46
50
|
} }, { children: 'Assistenza ' }), void 0))] }), void 0) }), void 0) }), void 0)] }), void 0));
|
|
47
51
|
exports.default = Footer;
|
|
48
52
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../src/lib/components/Footer/Footer.tsx"],"names":[],"mappings":";;;;AAAA,4CAA4D;AAC5D,wEAAsE;AACtE,kFAA6C;
|
|
1
|
+
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../src/lib/components/Footer/Footer.tsx"],"names":[],"mappings":";;;;AAAA,4CAA4D;AAC5D,wEAAsE;AACtE,kFAA6C;AAQ7C,gCAAgC;AAChC,MAAM,MAAM,GAAG,CAAC,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,EAAQ,EAAE,EAAE,CAAC,CACjF,wBAAC,cAAG,kBACF,SAAS,EAAC,QAAQ,EAClB,EAAE,EAAE;QACF,EAAE,EAAE,MAAM;QACV,MAAM,EAAE,OAAO;QACf,EAAE,EAAE,MAAM;QACV,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,UAAU;KACrB,iBAED,uBAAC,eAAI,kBAAC,SAAS,QAAC,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,gBAC5D,wBAAC,cAAG,kBAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,iBACxC,uBAAC,oBAAU,IAAC,OAAO,EAAC,YAAY,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAI,EAC3D,uBAAC,cAAG,kBAAC,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,gBACjD,wBAAC,qBAAU,kBACT,SAAS,EAAC,KAAK,EACf,EAAE,EAAE;gCACF,UAAU,EAAE,QAAQ;g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ClB,gBAEA,sCAAsC,YAClC,EACP,uBAAC,eAAI,kBACH,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,+GAA+G,CAAC,CAAC,EACpK,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE;gCACF,WAAW,EAAE,MAAM;gCACnB,KAAK,EAAE,oBAAoB;gCAC3B,cAAc,EAAE,iBAAiB;gCACjC,MAAM,EAAE,SAAS;6BAClB,gBAEA,+BAA+B,YAC3B,EACN,eAAe,IAAI,CAClB,uBAAC,eAAI,kBACH,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAA,sCAAkB,EAAC,eAAe,CAAC,CAAC,CAAC,EACxF,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE;gCACF,MAAM,EAAE,MAAM;gCACd,KAAK,EAAE,oBAAoB;gCAC3B,cAAc,EAAE,iBAAiB;gCACjC,MAAM,EAAE,SAAS;6BAClB,gBAEA,aAAa,YACT,CACR,aACU,YACT,YACD,aACH,CACP,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
|
@@ -8,7 +8,7 @@ const useMediaQuery_1 = (0, tslib_1.__importDefault)(require("@mui/material/useM
|
|
|
8
8
|
const styles_1 = require("@mui/material/styles");
|
|
9
9
|
const ClearOutlined_1 = (0, tslib_1.__importDefault)(require("@mui/icons-material/ClearOutlined"));
|
|
10
10
|
/** Selfcare's popup */
|
|
11
|
-
function SessionModal({ open, title, message, onConfirm, onConfirmLabel = 'Riprova', handleClose, handleExit = handleClose, onCloseLabel = 'Annulla', height
|
|
11
|
+
function SessionModal({ open, title, message, onConfirm, onConfirmLabel = 'Riprova', handleClose, handleExit = handleClose, onCloseLabel = 'Annulla', height, minHeight, width = '21.9em', }) {
|
|
12
12
|
const theme = (0, styles_1.useTheme)();
|
|
13
13
|
const fullScreen = (0, useMediaQuery_1.default)(theme.breakpoints.down('xs'));
|
|
14
14
|
return ((0, jsx_runtime_1.jsx)(Dialog_1.default, Object.assign({ fullScreen: fullScreen, open: open, onClose: handleClose, "aria-labelledby": "responsive-dialog-title" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, direction: "column", sx: { height, minHeight, width } }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mx: 3, sx: { height: '100%' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, mt: 4 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 10 }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleExit, style: { position: 'absolute', top: '20px', right: '16px', zIndex: 100 } }, { children: (0, jsx_runtime_1.jsx)(ClearOutlined_1.default, {}, void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", sx: { fontSize: '18px', fontWeight: '600' } }, { children: title }), void 0)] }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, my: 3 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: message }), void 0) }), void 0) }), void 0), onConfirm && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, mb: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ sx: { width: '100%' }, color: "primary", variant: "contained", onClick: onConfirm }, { children: onConfirmLabel }), void 0) }), void 0)), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, mb: 3, mt: onConfirm ? 0 : 7 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleClose, sx: { width: '100%' }, color: "primary", variant: "outlined" }, { children: onCloseLabel }), void 0) }), void 0)] }), void 0) }), void 0) }), void 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionModal.js","sourceRoot":"","sources":["../../src/lib/components/SessionModal.tsx"],"names":[],"mappings":";;;;AACA,4CAA0E;AAC1E,+EAA0C;AAC1C,6FAAwD;AACxD,iDAAgD;AAChD,mGAAkE;AA2BlE,uBAAuB;AACvB,SAAwB,YAAY,CAAC,EACnC,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,cAAc,GAAG,SAAS,EAC1B,WAAW,EACX,UAAU,GAAG,WAAW,EACxB,YAAY,GAAG,SAAS,EACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"SessionModal.js","sourceRoot":"","sources":["../../src/lib/components/SessionModal.tsx"],"names":[],"mappings":";;;;AACA,4CAA0E;AAC1E,+EAA0C;AAC1C,6FAAwD;AACxD,iDAAgD;AAChD,mGAAkE;AA2BlE,uBAAuB;AACvB,SAAwB,YAAY,CAAC,EACnC,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,cAAc,GAAG,SAAS,EAC1B,WAAW,EACX,UAAU,GAAG,WAAW,EACxB,YAAY,GAAG,SAAS,EACxB,MAAM,EACN,SAAS,EACT,KAAK,GAAG,QAAQ,GACV;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,kBACL,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,qBACJ,yBAAyB,gBAEzC,uBAAC,eAAI,kBAAC,SAAS,QAAC,SAAS,EAAC,QAAQ,EAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,gBACjE,wBAAC,cAAG,kBAAC,EAAE,EAAE,CAAC,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AAM,EAAE,EAAE,KAAK,EAAC,SAAS,EAAC,OAAO,EAAC,UAAU,gBACpF,YAAY,YACN,YACJ,aACH,YACD,YACA,CACV,CAAC;AACJ,CAAC;AAnED,+BAmEC"}
|
package/components/TitleBox.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { GridSize } from '@mui/material';
|
|
2
1
|
import { Variant } from '@mui/material/styles/createTypography';
|
|
3
2
|
declare type Props = {
|
|
4
3
|
/** The title to show */
|
|
@@ -8,7 +7,7 @@ declare type Props = {
|
|
|
8
7
|
/** The margin top of the title */
|
|
9
8
|
mtTitle?: number;
|
|
10
9
|
/** The margin bottom of the title */
|
|
11
|
-
mbTitle?:
|
|
10
|
+
mbTitle?: number;
|
|
12
11
|
/** The margin bottom of the subtitle */
|
|
13
12
|
mbSubTitle?: number;
|
|
14
13
|
/** The variant of the Typografy used for the title */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleBox.js","sourceRoot":"","sources":["../../src/lib/components/TitleBox.tsx"],"names":[],"mappings":";;;AAAA,4BAA4B;AAC5B,uCAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"TitleBox.js","sourceRoot":"","sources":["../../src/lib/components/TitleBox.tsx"],"names":[],"mappings":";;;AAAA,4BAA4B;AAC5B,uCAAuC;AACvC,4CAA2C;AAC3C,4CAAqC;AAwBrC,4BAA4B;AAC5B,SAAwB,QAAQ,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,CAAC,EACX,OAAO,EACP,UAAU,EACV,YAAY,GAAG,IAAI,EACnB,eAAe,GAAG,IAAI,EACtB,aAAa,EACb,gBAAgB,GAAG,MAAM,EACnB;IACN,OAAO,CACL,wBAAC,eAAI,kBAAC,SAAS,QAAC,EAAE,EAAE,OAAO,iBACzB,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,gBAC5B,uBAAC,qBAAU,kBAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,EAAC,QAAQ,EAAE,aAAa,EAAC,gBAAG,KAAK,YAAc,YACjF,EACP,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,gBAC/B,uBAAC,qBAAU,kBAAC,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBACrE,QAAQ,YACE,YACR,aACF,CACR,CAAC;AACJ,CAAC;AAvBD,2BAuBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
|
|
2
|
+
It allows to intercept when the user try to exit from the current page and ask him if he wants to continue or not.
|
|
3
|
+
|
|
4
|
+
To use this feature you have to put UnloadEventHandler in your App as a child of a redux Provider component.
|
|
5
|
+
In order to use this feature you have to use the custom hook useUnloadEventInterceptor.
|
|
6
|
+
@see {@link useUnloadEventInterceptor}
|
|
7
|
+
*/
|
|
8
|
+
export default function UnloadEventHandler(): JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_redux_1 = require("react-redux");
|
|
6
|
+
const useUnloadEventInterceptor_1 = require("../hooks/useUnloadEventInterceptor");
|
|
7
|
+
const appStateSlice_1 = require("../redux/slices/appStateSlice");
|
|
8
|
+
const SessionModal_1 = (0, tslib_1.__importDefault)(require("./SessionModal"));
|
|
9
|
+
/** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
|
|
10
|
+
It allows to intercept when the user try to exit from the current page and ask him if he wants to continue or not.
|
|
11
|
+
|
|
12
|
+
To use this feature you have to put UnloadEventHandler in your App as a child of a redux Provider component.
|
|
13
|
+
In order to use this feature you have to use the custom hook useUnloadEventInterceptor.
|
|
14
|
+
@see {@link useUnloadEventInterceptor}
|
|
15
|
+
*/
|
|
16
|
+
function UnloadEventHandler() {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
19
|
+
const unloadEventconfiguration = (0, react_redux_1.useSelector)(appStateSlice_1.appStateSelectors.selectUnloadEventConfiguration);
|
|
20
|
+
const { unregisterUnloadEvent } = (0, useUnloadEventInterceptor_1.useUnloadEventInterceptor)();
|
|
21
|
+
const onClose = () => {
|
|
22
|
+
dispatch(appStateSlice_1.appStateActions.closeUnloadEventNotify());
|
|
23
|
+
};
|
|
24
|
+
const onConfirm = () => {
|
|
25
|
+
unregisterUnloadEvent();
|
|
26
|
+
if (unloadEventconfiguration.exitAction) {
|
|
27
|
+
unloadEventconfiguration.exitAction();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(SessionModal_1.default, { open: unloadEventconfiguration.enabled && unloadEventconfiguration.open, title: (_a = unloadEventconfiguration.title) !== null && _a !== void 0 ? _a : 'Vuoi davvero uscire?', message: (_b = unloadEventconfiguration.description) !== null && _b !== void 0 ? _b : 'Se esci, la richiesta di assistenza andrà persa.', onConfirm: onConfirm, onConfirmLabel: 'Esci', handleClose: onClose }, void 0));
|
|
31
|
+
}
|
|
32
|
+
exports.default = UnloadEventHandler;
|
|
33
|
+
//# sourceMappingURL=UnloadEventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnloadEventHandler.js","sourceRoot":"","sources":["../../src/lib/components/UnloadEventHandler.tsx"],"names":[],"mappings":";;;;AAAA,6CAAuD;AACvD,kFAA+E;AAC/E,iEAAmF;AACnF,+EAA0C;AAE1C;;;;;;EAME;AACF,SAAwB,kBAAkB;;IACxC,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,wBAAwB,GAAG,IAAA,yBAAW,EAAC,iCAAiB,CAAC,8BAA8B,CAAC,CAAC;IAC/F,MAAM,EAAC,qBAAqB,EAAC,GAAG,IAAA,qDAAyB,GAAE,CAAC;IAE5D,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,QAAQ,CAAC,+BAAe,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC;IACF,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,qBAAqB,EAAE,CAAC;QACxB,IAAI,wBAAwB,CAAC,UAAU,EAAE;YACvC,wBAAwB,CAAC,UAAU,EAAE,CAAC;SACvC;IACH,CAAC,CAAC;IACF,OAAO,CACL,uBAAC,sBAAY,IACX,IAAI,EAAE,wBAAwB,CAAC,OAAO,IAAI,wBAAwB,CAAC,IAAI,EACvE,KAAK,EAAE,MAAA,wBAAwB,CAAC,KAAK,mCAAI,sBAAsB,EAC/D,OAAO,EACL,MAAA,wBAAwB,CAAC,WAAW,mCAAI,kDAAkD,EAE5F,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,OAAO,WACpB,CACH,CAAC;AACJ,CAAC;AA1BD,qCA0BC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
|
|
2
|
+
It allows to dispatch User Notifies in order to display a pop up or a toast notification.
|
|
3
|
+
|
|
4
|
+
To use this feature you have to put UserNotifyHandle in your App as a child of a redux Provider component.
|
|
5
|
+
In order to dispatch a User Notify, you have to use the custom hook useUserNotify which will return a fuction to be used to dispatch the User Notify. */
|
|
6
|
+
declare function UserNotifyHandle(): JSX.Element;
|
|
7
|
+
export default UserNotifyHandle;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_redux_1 = require("react-redux");
|
|
6
|
+
const __1 = require("..");
|
|
7
|
+
const appStateSlice_1 = require("../redux/slices/appStateSlice");
|
|
8
|
+
/** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
|
|
9
|
+
It allows to dispatch User Notifies in order to display a pop up or a toast notification.
|
|
10
|
+
|
|
11
|
+
To use this feature you have to put UserNotifyHandle in your App as a child of a redux Provider component.
|
|
12
|
+
In order to dispatch a User Notify, you have to use the custom hook useUserNotify which will return a fuction to be used to dispatch the User Notify. */
|
|
13
|
+
function UserNotifyHandle() {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
16
|
+
const notifies = (0, react_redux_1.useSelector)(appStateSlice_1.appStateSelectors.selectNotifies);
|
|
17
|
+
const lastNotifyToast = (0, react_1.useRef)();
|
|
18
|
+
const lastNotifyModal = (0, react_1.useRef)();
|
|
19
|
+
const { openModal, openToast } = updateCurrents(lastNotifyModal, lastNotifyToast, notifies);
|
|
20
|
+
const notifyModal = lastNotifyModal.current;
|
|
21
|
+
const notifyToast = lastNotifyToast.current;
|
|
22
|
+
const onClose = (notify) => {
|
|
23
|
+
dispatch(appStateSlice_1.appStateActions.removeNotify(notify));
|
|
24
|
+
if (notify === null || notify === void 0 ? void 0 : notify.onClose) {
|
|
25
|
+
notify.onClose();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const onConfirm = (notify) => {
|
|
29
|
+
dispatch(appStateSlice_1.appStateActions.removeNotify(notify));
|
|
30
|
+
if (notify === null || notify === void 0 ? void 0 : notify.onConfirm) {
|
|
31
|
+
notify.onConfirm();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(__1.Toast, { open: openToast, title: (_a = notifyToast === null || notifyToast === void 0 ? void 0 : notifyToast.title) !== null && _a !== void 0 ? _a : 'Notify Title', message: notifyToast === null || notifyToast === void 0 ? void 0 : notifyToast.message, logo: notifyToast === null || notifyToast === void 0 ? void 0 : notifyToast.logo, leftBorderColor: notifyToast === null || notifyToast === void 0 ? void 0 : notifyToast.leftBorderColor, onCloseToast: () => onClose(notifyToast) }, void 0), (0, jsx_runtime_1.jsx)(__1.SessionModal, { open: openModal, title: (_b = notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.title) !== null && _b !== void 0 ? _b : 'Notify Title', message: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.message, onConfirm: () => onConfirm(notifyModal), onConfirmLabel: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.confirmLabel, handleClose: () => onClose(notifyModal), onCloseLabel: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.closeLabel }, void 0)] }, void 0));
|
|
35
|
+
}
|
|
36
|
+
exports.default = UserNotifyHandle;
|
|
37
|
+
function updateCurrents(lastNotifyModalRef, lastNotifyToastRef, notifies) {
|
|
38
|
+
const lastNotifyToast = notifies.find((e) => e.component === 'Toast');
|
|
39
|
+
const lastNotifySessionModal = notifies.find((e) => e.component === 'SessionModal');
|
|
40
|
+
const openToast = !!lastNotifyToast;
|
|
41
|
+
const openModal = !!lastNotifySessionModal;
|
|
42
|
+
if (lastNotifySessionModal && lastNotifySessionModal !== (lastNotifyModalRef === null || lastNotifyModalRef === void 0 ? void 0 : lastNotifyModalRef.current)) {
|
|
43
|
+
// eslint-disable-next-line functional/immutable-data
|
|
44
|
+
lastNotifyModalRef.current = lastNotifySessionModal;
|
|
45
|
+
}
|
|
46
|
+
if (lastNotifyToast && lastNotifyToast !== (lastNotifyToastRef === null || lastNotifyToastRef === void 0 ? void 0 : lastNotifyToastRef.current)) {
|
|
47
|
+
// eslint-disable-next-line functional/immutable-data
|
|
48
|
+
lastNotifyToastRef.current = lastNotifyToast;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
openToast,
|
|
52
|
+
openModal,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
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AC;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,eAAe,IAAI,eAAe,MAAK,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAA,EAAE;QACtE,qDAAqD;QACrD,kBAAkB,CAAC,OAAO,GAAG,eAAe,CAAC;KAC9C;IACD,OAAO;QACL,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const react_redux_1 = require("react-redux");
|
|
4
4
|
const appStateSlice_1 = require("../redux/slices/appStateSlice");
|
|
5
|
-
/** @see ErrorBoundary */
|
|
5
|
+
/** @see {@link ErrorBoundary} */
|
|
6
6
|
function default_1() {
|
|
7
7
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
8
8
|
return (error) => dispatch(appStateSlice_1.appStateActions.addError(error));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useErrorDispatcher.js","sourceRoot":"","sources":["../../src/lib/hooks/useErrorDispatcher.ts"],"names":[],"mappings":";;AAAA,6CAA0C;AAC1C,iEAA0E;AAE1E,
|
|
1
|
+
{"version":3,"file":"useErrorDispatcher.js","sourceRoot":"","sources":["../../src/lib/hooks/useErrorDispatcher.ts"],"names":[],"mappings":";;AAAA,6CAA0C;AAC1C,iEAA0E;AAE1E,iCAAiC;AACjC;IACE,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,OAAO,CAAC,KAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,+BAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACxE,CAAC;AAHD,4BAGC"}
|
package/hooks/useLoading.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** @see LoadingOverlay */
|
|
1
|
+
/** @see {@link LoadingOverlay} */
|
|
2
2
|
export default function (task: string): (loading: boolean) => void;
|
package/hooks/useLoading.js
CHANGED
|
@@ -4,7 +4,7 @@ const lodash_1 = require("lodash");
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const react_redux_1 = require("react-redux");
|
|
6
6
|
const appStateSlice_1 = require("../redux/slices/appStateSlice");
|
|
7
|
-
/** @see LoadingOverlay */
|
|
7
|
+
/** @see {@link LoadingOverlay} */
|
|
8
8
|
function default_1(task) {
|
|
9
9
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
10
10
|
const ref = (0, react_1.useRef)((0, lodash_1.uniqueId)());
|
package/hooks/useLoading.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoading.js","sourceRoot":"","sources":["../../src/lib/hooks/useLoading.ts"],"names":[],"mappings":";;AAAA,mCAAkC;AAClC,iCAA+B;AAC/B,6CAA0C;AAC1C,iEAAgE;AAEhE,
|
|
1
|
+
{"version":3,"file":"useLoading.js","sourceRoot":"","sources":["../../src/lib/hooks/useLoading.ts"],"names":[],"mappings":";;AAAA,mCAAkC;AAClC,iCAA+B;AAC/B,6CAA0C;AAC1C,iEAAgE;AAEhE,kCAAkC;AAClC,mBAAyB,IAAY;IACnC,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,GAAG,GAAG,IAAA,cAAM,EAAC,IAAA,iBAAQ,GAAE,CAAC,CAAC;IAC/B,OAAO,CAAC,OAAgB,EAAE,EAAE,CAC1B,QAAQ,CAAC,+BAAe,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,IAAI,GAAG,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AACvF,CAAC;AALD,4BAKC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** In order to use this feature you have to use the custom hook useUnloadEventInterceptor, which will return an object having the following keys:
|
|
2
|
+
1. registerUnloadEvent: an arrow function which takes two optional parameters to customize the title and the description of the pop-up opened when invoking the exitAction function (see below) and enable the functionality.
|
|
3
|
+
2. unregisterUnloadEvent: an arrow function to call in order to disable this functionality.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useUnloadEventInterceptor: () => {
|
|
6
|
+
registerUnloadEvent: (title?: string | undefined, description?: string | undefined) => void;
|
|
7
|
+
unregisterUnloadEvent: () => void;
|
|
8
|
+
};
|
|
9
|
+
/** If you wont to enable immediately this functionality when invoking the custom hook you can use the hook useUnloadEventInterceptorAndActivate, which will enable the functionality and will disable it when unmounting the component. */
|
|
10
|
+
export declare const useUnloadEventInterceptorAndActivate: (title?: string | undefined, description?: string | undefined) => {
|
|
11
|
+
registerUnloadEvent: (title?: string | undefined, description?: string | undefined) => void;
|
|
12
|
+
unregisterUnloadEvent: () => void;
|
|
13
|
+
};
|
|
14
|
+
/** In order to show a custom pop-up when the user trigger an exit action you have to use the custom hook useUnloadEventOnExit which will return an arrow function to invoke instead of the exit action passing to it the exitAction itself. */
|
|
15
|
+
export declare const useUnloadEventOnExit: () => (exitAction: () => void) => void;
|
|
16
|
+
/** When the exitAction is the Logout you can use the custom hook useUnloadEventLogout which is the customization of the useUnloadEventOnExit using the logout as an exit action. */
|
|
17
|
+
export declare const useUnloadEventLogout: () => () => void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUnloadEventLogout = exports.useUnloadEventOnExit = exports.useUnloadEventInterceptorAndActivate = exports.useUnloadEventInterceptor = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_redux_1 = require("react-redux");
|
|
6
|
+
const env_1 = require("../config/env");
|
|
7
|
+
const appStateSlice_1 = require("../redux/slices/appStateSlice");
|
|
8
|
+
const appStateSlice_2 = require("./../redux/slices/appStateSlice");
|
|
9
|
+
/** In order to use this feature you have to use the custom hook useUnloadEventInterceptor, which will return an object having the following keys:
|
|
10
|
+
1. registerUnloadEvent: an arrow function which takes two optional parameters to customize the title and the description of the pop-up opened when invoking the exitAction function (see below) and enable the functionality.
|
|
11
|
+
2. unregisterUnloadEvent: an arrow function to call in order to disable this functionality.
|
|
12
|
+
*/
|
|
13
|
+
const useUnloadEventInterceptor = () => {
|
|
14
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
15
|
+
const registerUnloadEvent = (title, description) => {
|
|
16
|
+
dispatch(appStateSlice_1.appStateActions.enableUnloadEventInterceptor({ title, description }));
|
|
17
|
+
};
|
|
18
|
+
const unregisterUnloadEvent = () => {
|
|
19
|
+
dispatch(appStateSlice_1.appStateActions.disableUnloadEventInterceptor());
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
registerUnloadEvent,
|
|
23
|
+
unregisterUnloadEvent,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.useUnloadEventInterceptor = useUnloadEventInterceptor;
|
|
27
|
+
/** If you wont to enable immediately this functionality when invoking the custom hook you can use the hook useUnloadEventInterceptorAndActivate, which will enable the functionality and will disable it when unmounting the component. */
|
|
28
|
+
const useUnloadEventInterceptorAndActivate = (title, description) => {
|
|
29
|
+
const { registerUnloadEvent, unregisterUnloadEvent } = (0, exports.useUnloadEventInterceptor)();
|
|
30
|
+
(0, react_1.useEffect)(() => {
|
|
31
|
+
registerUnloadEvent(title, description);
|
|
32
|
+
return () => unregisterUnloadEvent();
|
|
33
|
+
}, []);
|
|
34
|
+
return {
|
|
35
|
+
registerUnloadEvent,
|
|
36
|
+
unregisterUnloadEvent,
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
exports.useUnloadEventInterceptorAndActivate = useUnloadEventInterceptorAndActivate;
|
|
40
|
+
/** In order to show a custom pop-up when the user trigger an exit action you have to use the custom hook useUnloadEventOnExit which will return an arrow function to invoke instead of the exit action passing to it the exitAction itself. */
|
|
41
|
+
const useUnloadEventOnExit = () => {
|
|
42
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
43
|
+
const eventconfiguration = (0, react_redux_1.useSelector)(appStateSlice_2.appStateSelectors.selectUnloadEventConfiguration);
|
|
44
|
+
return (exitAction) => {
|
|
45
|
+
if (eventconfiguration.enabled) {
|
|
46
|
+
dispatch(appStateSlice_1.appStateActions.openUnloadEventNotify(exitAction));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
exitAction();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
exports.useUnloadEventOnExit = useUnloadEventOnExit;
|
|
54
|
+
/** When the exitAction is the Logout you can use the custom hook useUnloadEventLogout which is the customization of the useUnloadEventOnExit using the logout as an exit action. */
|
|
55
|
+
const useUnloadEventLogout = () => {
|
|
56
|
+
const onExit = (0, exports.useUnloadEventOnExit)();
|
|
57
|
+
return () => onExit(() => window.location.assign(env_1.CONFIG.URL_FE.LOGOUT));
|
|
58
|
+
};
|
|
59
|
+
exports.useUnloadEventLogout = useUnloadEventLogout;
|
|
60
|
+
//# sourceMappingURL=useUnloadEventInterceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnloadEventInterceptor.js","sourceRoot":"","sources":["../../src/lib/hooks/useUnloadEventInterceptor.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAClC,6CAAuD;AACvD,uCAAuC;AACvC,iEAAgE;AAChE,mEAAoE;AAEpE;;;GAGG;AACI,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,mBAAmB,GAAG,CAAC,KAAc,EAAE,WAAoB,EAAE,EAAE;QACnE,QAAQ,CAAC,+BAAe,CAAC,4BAA4B,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IACjF,CAAC,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