@pagopa/selfcare-common-frontend 1.3.1 → 1.5.1
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 +28 -0
- package/README.md +58 -13
- package/build.info +2 -2
- package/components/ErrorBoundary/ErrorBoundary.js +3 -0
- package/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/components/UnloadEventHandler.js +1 -1
- package/components/UnloadEventHandler.js.map +1 -1
- package/components/UserNotifyHandle.js +7 -4
- package/components/UserNotifyHandle.js.map +1 -1
- package/decorators/withRetrievedValue.d.ts +14 -0
- package/decorators/withRetrievedValue.js +48 -0
- package/decorators/withRetrievedValue.js.map +1 -0
- package/hooks/useFakePagination.d.ts +9 -0
- package/hooks/useFakePagination.js +66 -0
- package/hooks/useFakePagination.js.map +1 -0
- package/hooks/useReduxCachedValue.d.ts +4 -0
- package/hooks/useReduxCachedValue.js +39 -0
- package/hooks/useReduxCachedValue.js.map +1 -0
- package/model/AppError.d.ts +31 -0
- package/model/AppError.js +3 -0
- package/model/AppError.js.map +1 -0
- package/model/UserNotify.d.ts +7 -0
- package/package.json +2 -3
- package/redux/slices/appStateSlice.d.ts +2 -25
- package/redux/slices/appStateSlice.js +18 -0
- package/redux/slices/appStateSlice.js.map +1 -1
- package/services/assistanceService.js +2 -0
- package/services/assistanceService.js.map +1 -1
- package/utils/api-utils.d.ts +1 -1
- package/utils/constants.d.ts +2 -0
- package/utils/constants.js +12 -3
- package/utils/constants.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,36 @@ 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.5.1](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.0...v1.5.1)
|
|
8
|
+
|
|
9
|
+
- withRetrievedValue will accept a component to show while loading [`#25`](https://github.com/pagopa/selfcare-common-frontend/pull/25)
|
|
10
|
+
|
|
11
|
+
#### [v1.5.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.4.1...v1.5.0)
|
|
12
|
+
|
|
13
|
+
> 11 February 2022
|
|
14
|
+
|
|
15
|
+
- Toast autoclosable in UserNotifyHandle and ErrorBoundaryfeatures [`#24`](https://github.com/pagopa/selfcare-common-frontend/pull/24)
|
|
16
|
+
- Customhook cached redux [`#23`](https://github.com/pagopa/selfcare-common-frontend/pull/23)
|
|
17
|
+
- fixed readme [`#22`](https://github.com/pagopa/selfcare-common-frontend/pull/22)
|
|
18
|
+
- fake-pagination custom hook [`#21`](https://github.com/pagopa/selfcare-common-frontend/pull/21)
|
|
19
|
+
|
|
20
|
+
#### [v1.4.1](https://github.com/pagopa/selfcare-common-frontend/compare/v1.4.0...v1.4.1)
|
|
21
|
+
|
|
22
|
+
> 9 February 2022
|
|
23
|
+
|
|
24
|
+
- edit-rolelabel - added description in roleLabels [`#20`](https://github.com/pagopa/selfcare-common-frontend/pull/20)
|
|
25
|
+
|
|
26
|
+
#### [v1.4.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.3.1...v1.4.0)
|
|
27
|
+
|
|
28
|
+
> 8 February 2022
|
|
29
|
+
|
|
30
|
+
- Selc 144 track events [`#19`](https://github.com/pagopa/selfcare-common-frontend/pull/19)
|
|
31
|
+
- Selc 144 track events (#19) [`#144`](https://pagopa.atlassian.net/browse/144)
|
|
32
|
+
|
|
7
33
|
#### [v1.3.1](https://github.com/pagopa/selfcare-common-frontend/compare/v1.3.0...v1.3.1)
|
|
8
34
|
|
|
35
|
+
> 7 February 2022
|
|
36
|
+
|
|
9
37
|
- analyticsService will accept a callback [`#18`](https://github.com/pagopa/selfcare-common-frontend/pull/18)
|
|
10
38
|
|
|
11
39
|
#### [v1.3.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.2.3...v1.3.0)
|
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# SelfCare's common components & features
|
|
2
|
-
This library contains
|
|
2
|
+
This library contains [utilities](#utilities), [components](#components), [decorators](#decorators), [custom hooks](#custom-hooks) and [features](#features) built for the selfcare project.
|
|
3
3
|
|
|
4
4
|
# Configuration
|
|
5
5
|
In order to use these components it's necessary to set the following keys of the CONFIG object imported from /config/env as first things inside the application:
|
|
6
6
|
|
|
7
7
|
| Key | Type | Description | DefaultValue |
|
|
8
|
+
|-----|------|-------------|--------------|
|
|
8
9
|
| URL_FE.LOGIN | string | The url of the login page | /auth/login |
|
|
9
10
|
| URL_FE.LOGOUT | string | The url of the logout page | /auth/logout |
|
|
10
11
|
| URL_FE.ASSISTANCE | string | The url of the assistance page | /assistenza |
|
|
@@ -12,7 +13,7 @@ In order to use these components it's necessary to set the following keys of the
|
|
|
12
13
|
| ANALYTICS.* | | See [analitics feature](#analytics) | |
|
|
13
14
|
| CONSENT.* | | See [consent management feature](#consent-management) | |
|
|
14
15
|
|
|
15
|
-
#
|
|
16
|
+
# Components
|
|
16
17
|
## Header
|
|
17
18
|
SelfCare Header component
|
|
18
19
|
|
|
@@ -56,16 +57,16 @@ Modal used to show a list of values from which to choose a single value
|
|
|
56
57
|
| Prop | Type | Mandatory | Description |
|
|
57
58
|
|------|------|-----------|-------------|
|
|
58
59
|
| open | boolean | Y | If the popup is to be displayed |
|
|
59
|
-
| handleClose | React.MouseEventHandler
|
|
60
|
+
| handleClose | React.MouseEventHandler`<HTMLButtonElement>` | Y | The function to be invoked when clicking on exit button or selecting a value |
|
|
60
61
|
| title | string | Y | The popup title |
|
|
61
|
-
| filterModalConfig | FilterModalConfig
|
|
62
|
+
| filterModalConfig | FilterModalConfig`<any, any>` | N | See below |
|
|
62
63
|
| height | string | N | The popup height |
|
|
63
64
|
| minHeight | string | N | The popup minHeight |
|
|
64
65
|
|
|
65
66
|
FilterModalConfig fields:
|
|
66
67
|
| Field | Type | Mandatory | Description |
|
|
67
68
|
|-------|------|-----------|-------------|
|
|
68
|
-
| data | Array
|
|
69
|
+
| data | Array`<T>` | Y | The list of values between to which choose |
|
|
69
70
|
| getLabel | (e: T) => string | Y | A function that will select the label to show |
|
|
70
71
|
| getValue | (e: T) => string | Y | A function that will select the value to return when selecting an item |
|
|
71
72
|
| onFilterChange | (v: V) => void | Y | The function invoked when selecting a value |
|
|
@@ -78,10 +79,10 @@ Selfcare's popup
|
|
|
78
79
|
| open | boolean | Y | If this component should be displayed or not |
|
|
79
80
|
| title | string | Y | The title to show in the popup |
|
|
80
81
|
| message | React.ReactNode | Y | The body to show in the popup |
|
|
81
|
-
| onConfirm | React.MouseEventHandler
|
|
82
|
+
| onConfirm | React.MouseEventHandler`<HTMLButtonElement>` | N | If defined, it will render a confirm button using this function as behavior |
|
|
82
83
|
| onConfirmLabel | string | N | The confirm label text |
|
|
83
|
-
| handleClose | React.MouseEventHandler
|
|
84
|
-
| handleExit | React.MouseEventHandler
|
|
84
|
+
| handleClose | React.MouseEventHandler`<HTMLButtonElement>` | Y | The function invoked when clicking on close button or in the showed X icon |
|
|
85
|
+
| handleExit | React.MouseEventHandler`<HTMLButtonElement>` | N | If defined, it allow to set a different behavior when clicking on X icon |
|
|
85
86
|
| onCloseLabel | string | N | Close button text |
|
|
86
87
|
| height | string | N | The popup height |
|
|
87
88
|
| minHeight | string | N | The popup minHeight |
|
|
@@ -123,7 +124,7 @@ Selfcare's ending page
|
|
|
123
124
|
| buttonLabel | string | N | The ending page button label if any |
|
|
124
125
|
| onButtonClick | () => void | N | if defined it will show a button that will performe this action on click |
|
|
125
126
|
|
|
126
|
-
#
|
|
127
|
+
# Utilities
|
|
127
128
|
## api-utils
|
|
128
129
|
### onRedirectToLogin: (store: EnhancedStore) => void
|
|
129
130
|
To show an error popup to inform of the not valid session
|
|
@@ -131,7 +132,7 @@ To show an error popup to inform of the not valid session
|
|
|
131
132
|
### buildFetchApi = (timeoutMs: number = 300000) => fetch
|
|
132
133
|
Return the implementation of fetch configured with a timeout
|
|
133
134
|
|
|
134
|
-
### extractResponse
|
|
135
|
+
### 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>`
|
|
135
136
|
Extract the response of a @pagopa/openapi-codegen-ts generated client rest invocation having status code successHttpStatus.
|
|
136
137
|
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.
|
|
137
138
|
If notAuthorizedTokenHttpStatus is not null and the returned status is equal to notAuthorizedTokenHttpStatus, it will throw an Error with message "Operation not allowed".
|
|
@@ -169,14 +170,54 @@ It will return a string representing the provided date in the italian format gg
|
|
|
169
170
|
## fixSwagger20ArraySchemaDef.js
|
|
170
171
|
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
|
|
171
172
|
|
|
172
|
-
#
|
|
173
|
+
# Decorators
|
|
173
174
|
## withLogin
|
|
174
175
|
This feature is based on react-redux library and require to register the reducer build in userSlice into the application's redux store.
|
|
175
176
|
This decorator has to be applied to components whose acces require an active session.
|
|
176
177
|
Accessing to the components decorated with it without a session will brought to the login page.
|
|
177
178
|
It's possible to modify the login path changing the value in [CONFIG.URL_FE.LOGIN](#Configuration) inside the index.tsx file
|
|
178
179
|
|
|
179
|
-
|
|
180
|
+
## withRetrievedValue
|
|
181
|
+
Decorator to retrieve a value and serve it once ready to the decorated component.
|
|
182
|
+
Using it together with [useReduxCachedValue](#usereduxcachedvalue) will allow to build a component which will use centralized and cached data
|
|
183
|
+
See withRetrievedValue.test.tsx file for an example.
|
|
184
|
+
|
|
185
|
+
Given the following type parameters:
|
|
186
|
+
* ENTITY_TYPE extends Record`<string, any>`,
|
|
187
|
+
* PROP_NAME extends string,
|
|
188
|
+
* PROPS extends Record`<PROP_NAME, ENTITY_TYPE>`
|
|
189
|
+
|
|
190
|
+
The arguments to provide to the decorator are the following:
|
|
191
|
+
|
|
192
|
+
| Prop | Type | Mandatory | Description |
|
|
193
|
+
|------|------|-----------|-------------|
|
|
194
|
+
| propEntityName | PROP_NAME | Y | The name of the prop to which serve the value when available |
|
|
195
|
+
| getRetrieverService | () => () => Promise`<ENTITY_TYPE>` | Y | A function that will return an other function to retrieve the expected value. This for allow the use of custom hook |
|
|
196
|
+
| WrappedComponent | React.ComponentType`<PROPS>` | Y | The component to decore |
|
|
197
|
+
| onError | (appError: AppError) => void | N | What to do in case of error. As default, it will use the feature ErrorBoundary |
|
|
198
|
+
| onLoading | ReactNode | N | A component to show while waiting for the value |
|
|
199
|
+
|
|
200
|
+
# Custom Hooks
|
|
201
|
+
## useFakePagination
|
|
202
|
+
Custom hook used to simulate paginated resources when the external service doesn't implement it, caching values when filter doesn't change and serving them a page at time.
|
|
203
|
+
Cached values are stored using useRef, so they are local to the component using this hook.
|
|
204
|
+
The sorting actually is applied using string representation
|
|
205
|
+
|
|
206
|
+
## useReduxCachedValue
|
|
207
|
+
It will return a method that only at the very first invocation it will call the retrieverService only the first time, storing the obtained values, and returning always cached values.
|
|
208
|
+
See useReduxCachedValue.test.tsx file for an example.
|
|
209
|
+
|
|
210
|
+
The arguments to provide to the custom hook are the following:
|
|
211
|
+
|
|
212
|
+
| Prop | Type | Mandatory | Description |
|
|
213
|
+
|------|------|-----------|-------------|
|
|
214
|
+
| entity | string | Y | The name of the entity, used just for logging purpose |
|
|
215
|
+
| retrieverService | () => Promise`<T>` | Y | The service that will retrieve the value |
|
|
216
|
+
| reduxSelector | (state: any) => T | undefined | Y | The selector to verify if a value already exists |
|
|
217
|
+
| reduxSetterAction | PayloadActionCreator`<T>` | Y | The action to store the value |
|
|
218
|
+
| alwaysRetrieve | boolean | N | If true, it will always retrieve and store the new value |
|
|
219
|
+
|
|
220
|
+
# Features
|
|
180
221
|
## LoadingOverlay
|
|
181
222
|
This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
|
|
182
223
|
It allows to draw a loader when an async task to wait is running.
|
|
@@ -207,6 +248,8 @@ The error to be submitted has type AppError which has the following fields:
|
|
|
207
248
|
| onClose | () => void | N | If defined, in case of not blocking error, it will be executed when closing the popup |
|
|
208
249
|
| toNotify | boolean | Y | If true, it will notify the error |
|
|
209
250
|
| component | string | N | Can render a SessionModal or Toast component |
|
|
251
|
+
| autoclosable | string | N | If component === 'Toast'. The notify will be autoclosed using this configuration, as default timer. If none, it will not be closed automatically. If timer, it will be closed after autocloseMilliseconds milliseconds |
|
|
252
|
+
| autocloseMilliseconds | boolean | N | If component === 'Toast' and autoclosable === 'timer'. The millisecond after which close the notify. As default 2000 |
|
|
210
253
|
|
|
211
254
|
The error will be notified as a GENERIC_ERROR through the [analytcs feature](#analytics)
|
|
212
255
|
|
|
@@ -231,6 +274,8 @@ The user notify to be submitted has type UserNotify which has the following fiel
|
|
|
231
274
|
| onClose | () => void | N | If defined, it will be executed when closing the popup |
|
|
232
275
|
| closeLabel | string | N | If component === 'SessionModal'. The close button label |
|
|
233
276
|
| component | string | N | Can render a SessionModal or Toast component |
|
|
277
|
+
| autoclosable | string | N | If component === 'Toast'. The notify will be autoclosed using this configuration, as default timer. If none, it will not be closed automatically. If timer, it will be closed after autocloseMilliseconds milliseconds |
|
|
278
|
+
| autocloseMilliseconds | boolean | N | If component === 'Toast' and autoclosable === 'timer'. The millisecond after which close the notify. As default 2000 |
|
|
234
279
|
|
|
235
280
|
## UnloadEventHandler
|
|
236
281
|
This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
|
|
@@ -265,7 +310,7 @@ This feature can be configured with the following keys of the [CONFIG](#Configur
|
|
|
265
310
|
| PERSISTENCE | string | Where to store session data, possible values are cookie or localStorage | localStorage |
|
|
266
311
|
| LOG_IP | boolean | If the ip should be sent | false |
|
|
267
312
|
| LOG_IP | boolean | If the ip should be sent | false |
|
|
268
|
-
| PROPERTY_BLACKLIST | Array
|
|
313
|
+
| PROPERTY_BLACKLIST | Array`<string>` | If the ip should be sent | ["$current_url", "$initial_referrer", "$referrer"] |
|
|
269
314
|
| ADDITIONAL_PROPERTIES | {[key: string]: string} | An object containing a fixed set of properties to send every time, overridden if the actual event will report the same properties | {} |
|
|
270
315
|
| ADDITIONAL_PROPERTIES_IMPORTANT | {[key: string]: string} | As ADDITIONAL_PROPERTIES, but these properties will take the precedence overriding events conflicting properties | {} |
|
|
271
316
|
|
package/build.info
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
remotes/origin/
|
|
1
|
+
20220214.1 - selfcare-common-frontend.deploy(20316)
|
|
2
|
+
remotes/origin/dependabot/npm_and_yarn/follow-redirects-1.14.8 7ef79dc222e49dd330354ff6868d6735ab4861bf
|
|
@@ -59,6 +59,9 @@ class ErrorBoundary extends react_1.Component {
|
|
|
59
59
|
}
|
|
60
60
|
buildErrorToast(error) {
|
|
61
61
|
var _a, _b;
|
|
62
|
+
if (error.autoclosable === 'timer') {
|
|
63
|
+
setTimeout(() => this.handleClose(error), error.autocloseMilliseconds);
|
|
64
|
+
}
|
|
62
65
|
return ((0, jsx_runtime_1.jsx)(Toast_1.default, { open: true, title: (_a = error.displayableTitle) !== null && _a !== void 0 ? _a : 'ERRORE', message: (_b = error.displayableDescription) !== null && _b !== void 0 ? _b : 'Spiacenti, qualcosa è andato storto.', logo: FaultIcon_1.default, leftBorderColor: "#C02927", onCloseToast: () => this.handleClose(error) }, void 0));
|
|
63
66
|
}
|
|
64
67
|
buildErrorModal(error) {
|
|
@@ -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;AAC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Ac,EAAC,iCAAiB,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;AAE1F,SAAS,eAAe,CAAC,KAAU;IACjC,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,MAAM,kBAAkB,GAAG,CAAC,QAA0B,EAAE,EAAE,CAAC,CAAC;IAC1D,QAAQ,EAAE,CAAC,KAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,+BAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxE,WAAW,EAAE,CAAC,KAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,+BAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;CAC/E,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAA0C,IAAA,qBAAO,EAC3E,eAAe,EACf,kBAAkB,CACnB,CAAC,aAAa,CAAC,CAAC;AACjB,kBAAe,sBAAsB,CAAC"}
|
|
@@ -27,7 +27,7 @@ function UnloadEventHandler() {
|
|
|
27
27
|
unloadEventconfiguration.exitAction();
|
|
28
28
|
}
|
|
29
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,
|
|
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, le modifiche apportate andranno perse.', onConfirm: onConfirm, onConfirmLabel: 'Esci', handleClose: onClose }, void 0));
|
|
31
31
|
}
|
|
32
32
|
exports.default = UnloadEventHandler;
|
|
33
33
|
//# sourceMappingURL=UnloadEventHandler.js.map
|
|
@@ -1 +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,
|
|
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,EAAE,qBAAqB,EAAE,GAAG,IAAA,qDAAyB,GAAE,CAAC;IAE9D,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,iDAAiD,EAE3F,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,OAAO,WACpB,CACH,CAAC;AACJ,CAAC;AA1BD,qCA0BC"}
|
|
@@ -16,9 +16,6 @@ function UserNotifyHandle() {
|
|
|
16
16
|
const notifies = (0, react_redux_1.useSelector)(appStateSlice_1.appStateSelectors.selectNotifies);
|
|
17
17
|
const lastNotifyToast = (0, react_1.useRef)();
|
|
18
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
19
|
const onClose = (notify) => {
|
|
23
20
|
dispatch(appStateSlice_1.appStateActions.removeNotify(notify));
|
|
24
21
|
if (notify === null || notify === void 0 ? void 0 : notify.onClose) {
|
|
@@ -31,10 +28,13 @@ function UserNotifyHandle() {
|
|
|
31
28
|
notify.onConfirm();
|
|
32
29
|
}
|
|
33
30
|
};
|
|
31
|
+
const { openModal, openToast } = updateCurrents(lastNotifyModal, lastNotifyToast, notifies, onClose);
|
|
32
|
+
const notifyModal = lastNotifyModal.current;
|
|
33
|
+
const notifyToast = lastNotifyToast.current;
|
|
34
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
35
|
}
|
|
36
36
|
exports.default = UserNotifyHandle;
|
|
37
|
-
function updateCurrents(lastNotifyModalRef, lastNotifyToastRef, notifies) {
|
|
37
|
+
function updateCurrents(lastNotifyModalRef, lastNotifyToastRef, notifies, onClose) {
|
|
38
38
|
const lastNotifyToast = notifies.find((e) => e.component === 'Toast');
|
|
39
39
|
const lastNotifySessionModal = notifies.find((e) => e.component === 'SessionModal');
|
|
40
40
|
const openToast = !!lastNotifyToast;
|
|
@@ -46,6 +46,9 @@ function updateCurrents(lastNotifyModalRef, lastNotifyToastRef, notifies) {
|
|
|
46
46
|
if (lastNotifyToast && lastNotifyToast !== (lastNotifyToastRef === null || lastNotifyToastRef === void 0 ? void 0 : lastNotifyToastRef.current)) {
|
|
47
47
|
// eslint-disable-next-line functional/immutable-data
|
|
48
48
|
lastNotifyToastRef.current = lastNotifyToast;
|
|
49
|
+
if (lastNotifyToast.autoclosable === 'timer') {
|
|
50
|
+
setTimeout(() => onClose(lastNotifyToast), lastNotifyToast.autocloseMilliseconds);
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
53
|
return {
|
|
51
54
|
openToast,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserNotifyHandle.js","sourceRoot":"","sources":["../../src/lib/components/UserNotifyHandle.tsx"],"names":[],"mappings":";;;AAAA,iCAAiD;AACjD,6CAAuD;AACvD,0BAAyC;AAEzC,iEAAmF;AAEnF;;;;wJAIwJ;AACxJ,SAAS,gBAAg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sBAAsB,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,cAAc,CAAC,CAAC;IAEpF,MAAM,SAAS,GAAY,CAAC,CAAC,eAAe,CAAC;IAC7C,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,eAAe,IAAI,eAAe,MAAK,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAA,EAAE;QACtE,qDAAqD;QACrD,kBAAkB,CAAC,OAAO,GAAG,eAAe,CAAC;QAE7C,IAAI,eAAe,CAAC,YAAY,KAAK,OAAO,EAAE;YAC5C,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;SACnF;KACF;IACD,OAAO;QACL,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AppError } from '../model/AppError';
|
|
3
|
+
/** Decorator to retrieve a value and serve it once ready to the decorated component */
|
|
4
|
+
export default function withRetrievedValue<ENTITY_TYPE extends Record<string, any>, PROP_NAME extends string, PROPS extends Record<PROP_NAME, ENTITY_TYPE>>(
|
|
5
|
+
/** The name of the prop to which serve the value when available */
|
|
6
|
+
propEntityName: PROP_NAME,
|
|
7
|
+
/** A function that will return an other function to retrieve the expected value. This for allow the use of custom hook */
|
|
8
|
+
getRetrieverService: () => () => Promise<ENTITY_TYPE>,
|
|
9
|
+
/** The component to decore */
|
|
10
|
+
WrappedComponent: React.ComponentType<PROPS>,
|
|
11
|
+
/** What to do in case of error. As default, it will use the feature ErrorBoundary */
|
|
12
|
+
onError?: (appError: AppError) => void,
|
|
13
|
+
/** A component to show while waiting for the value */
|
|
14
|
+
onLoading?: ReactNode): import("react").ComponentType<Omit<PROPS, PROP_NAME>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
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_1 = require("react");
|
|
6
|
+
const useErrorDispatcher_1 = (0, tslib_1.__importDefault)(require("../hooks/useErrorDispatcher"));
|
|
7
|
+
/** Decorator to retrieve a value and serve it once ready to the decorated component */
|
|
8
|
+
function withRetrievedValue(
|
|
9
|
+
/** The name of the prop to which serve the value when available */
|
|
10
|
+
propEntityName,
|
|
11
|
+
/** A function that will return an other function to retrieve the expected value. This for allow the use of custom hook */
|
|
12
|
+
getRetrieverService,
|
|
13
|
+
/** The component to decore */
|
|
14
|
+
WrappedComponent,
|
|
15
|
+
/** What to do in case of error. As default, it will use the feature ErrorBoundary */
|
|
16
|
+
onError,
|
|
17
|
+
/** A component to show while waiting for the value */
|
|
18
|
+
onLoading) {
|
|
19
|
+
const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
20
|
+
const ComponentWithParties = (props) => {
|
|
21
|
+
const [value, setValue] = (0, react_1.useState)();
|
|
22
|
+
const cachedRetrieve = getRetrieverService();
|
|
23
|
+
const addError = (0, useErrorDispatcher_1.default)();
|
|
24
|
+
const doRetrieve = () => {
|
|
25
|
+
cachedRetrieve()
|
|
26
|
+
.then((v) => setValue(v))
|
|
27
|
+
.catch((reason) => (onError !== null && onError !== void 0 ? onError : addError)({
|
|
28
|
+
id: `RETRIEVE_VALUE_${propEntityName}`,
|
|
29
|
+
blocking: false,
|
|
30
|
+
techDescription: `Something gone wrong while retrieving ${propEntityName}`,
|
|
31
|
+
toNotify: true,
|
|
32
|
+
error: reason,
|
|
33
|
+
onRetry: doRetrieve,
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
(0, react_1.useEffect)(() => {
|
|
37
|
+
if (!value) {
|
|
38
|
+
doRetrieve();
|
|
39
|
+
}
|
|
40
|
+
}, []);
|
|
41
|
+
return value !== undefined ? ((0, jsx_runtime_1.jsx)(WrappedComponent, Object.assign({}, props, { [propEntityName]: value }), void 0)) : (onLoading !== null && onLoading !== void 0 ? onLoading : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}, void 0));
|
|
42
|
+
};
|
|
43
|
+
// eslint-disable-next-line functional/immutable-data
|
|
44
|
+
ComponentWithParties.displayName = `withRetrieve${propEntityName}(${displayName})`;
|
|
45
|
+
return ComponentWithParties;
|
|
46
|
+
}
|
|
47
|
+
exports.default = withRetrievedValue;
|
|
48
|
+
//# sourceMappingURL=withRetrievedValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withRetrievedValue.js","sourceRoot":"","sources":["../../src/lib/decorators/withRetrievedValue.tsx"],"names":[],"mappings":";;;;AAAA,iCAAuD;AACvD,kGAA6D;AAG7D,uFAAuF;AACvF,SAAwB,kBAAkB;AAKxC,mEAAmE;AACnE,cAAyB;AACzB,2HAA2H;AAC3H,mBAAqD;AACrD,8BAA8B;AAC9B,gBAA4C;AAC5C,qFAAqF;AACrF,OAAsC;AACtC,sDAAsD;AACtD,SAAqB;IAErB,MAAM,WAAW,GAAG,gBAAgB,CAAC,WAAW,IAAI,gBAAgB,CAAC,IAAI,IAAI,WAAW,CAAC;IAEzF,MAAM,oBAAoB,GAAG,CAAC,KAAY,EAAE,EAAE;QAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,GAAe,CAAC;QAClD,MAAM,cAAc,GAAG,mBAAmB,EAAE,CAAC;QAE7C,MAAM,QAAQ,GAAG,IAAA,4BAAkB,GAAE,CAAC;QAEtC,MAAM,UAAU,GAAG,GAAS,EAAE;YAC5B,cAAc,EAAE;iBACb,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;iBACxB,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAChB,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,QAAQ,CAAC,CAAC;gBACpB,EAAE,EAAE,kBAAkB,cAAc,EAAE;gBACtC,QAAQ,EAAE,KAAK;gBACf,eAAe,EAAE,yCAAyC,cAAc,EAAE;gBAC1E,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,UAAU;aACpB,CAAC,CACH,CAAC;QACN,CAAC,CAAC;QAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;YACb,IAAI,CAAC,KAAK,EAAE;gBACV,UAAU,EAAE,CAAC;aACd;QACH,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAC3B,uBAAC,gBAAgB,oBAAM,KAAe,EAAM,EAAE,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,UAAI,CAC5E,CAAC,CAAC,CAAC,CACF,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,0DAAK,CACnB,CAAC;IACJ,CAAC,CAAC;IAEF,qDAAqD;IACrD,oBAAoB,CAAC,WAAW,GAAG,eAAe,cAAc,IAAI,WAAW,GAAG,CAAC;IAEnF,OAAO,oBAAmE,CAAC;AAC7E,CAAC;AAxDD,qCAwDC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PageRequest } from '../model/PageRequest';
|
|
2
|
+
import { PageResource } from '../model/PageResource';
|
|
3
|
+
/**
|
|
4
|
+
* Custom hook used to simulate paginated resources when the external service doesn't implement it, caching values when filter doesn't change and serving them a page at time.
|
|
5
|
+
* Cached values are stored using useRef, so they are local to the component using this hook.
|
|
6
|
+
* The sorting actually is applied using string representation
|
|
7
|
+
*/
|
|
8
|
+
declare const useFakePagination: <T extends Record<string, any>>(fetch: () => Promise<T[]>) => (pageRequest: PageRequest, filterChanged: boolean) => Promise<PageResource<T>>;
|
|
9
|
+
export default useFakePagination;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const toPageResource = (content, page, size, totalElements) => ({
|
|
5
|
+
content,
|
|
6
|
+
page: {
|
|
7
|
+
number: page,
|
|
8
|
+
size,
|
|
9
|
+
totalElements,
|
|
10
|
+
totalPages: size > 0 ? Math.ceil(totalElements / size) : 0,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
const extractPageRequest = (data, pageRequest) => {
|
|
14
|
+
const firstIndex = pageRequest.page * pageRequest.size;
|
|
15
|
+
return toPageResource(firstIndex < data.length && pageRequest.size > 0
|
|
16
|
+
? data.slice(firstIndex, firstIndex + pageRequest.size)
|
|
17
|
+
: [], pageRequest.page, pageRequest.size, data.length);
|
|
18
|
+
};
|
|
19
|
+
const applySort = (data, sort) => {
|
|
20
|
+
const sortConfiguration = sort.split(' ').map((order) => {
|
|
21
|
+
const [key, direction] = order.split(',');
|
|
22
|
+
return { key, asc: direction === 'asc' };
|
|
23
|
+
});
|
|
24
|
+
// eslint-disable-next-line functional/immutable-data
|
|
25
|
+
data.sort((a, b) => {
|
|
26
|
+
for (const order of sortConfiguration) {
|
|
27
|
+
const compare = `${a[order.key]}`.localeCompare(`${b[order.key]}`);
|
|
28
|
+
if (compare !== 0) {
|
|
29
|
+
return compare * (order.asc ? 1 : -1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return 0;
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Custom hook used to simulate paginated resources when the external service doesn't implement it, caching values when filter doesn't change and serving them a page at time.
|
|
37
|
+
* Cached values are stored using useRef, so they are local to the component using this hook.
|
|
38
|
+
* The sorting actually is applied using string representation
|
|
39
|
+
*/
|
|
40
|
+
const useFakePagination = (fetch) => {
|
|
41
|
+
const cachedData = (0, react_1.useRef)();
|
|
42
|
+
const cachedDataSort = (0, react_1.useRef)();
|
|
43
|
+
const checkAndApplySort = (sort) => {
|
|
44
|
+
if (sort && cachedDataSort.current !== sort) {
|
|
45
|
+
applySort(cachedData.current, sort);
|
|
46
|
+
// eslint-disable-next-line functional/immutable-data
|
|
47
|
+
cachedDataSort.current = sort;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return (pageRequest, filterChanged) => {
|
|
51
|
+
if (!filterChanged && cachedData.current) {
|
|
52
|
+
checkAndApplySort(pageRequest.sort);
|
|
53
|
+
return new Promise((resolve) => resolve(extractPageRequest(cachedData.current, pageRequest)));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return fetch().then((results) => {
|
|
57
|
+
// eslint-disable-next-line functional/immutable-data
|
|
58
|
+
cachedData.current = results;
|
|
59
|
+
checkAndApplySort(pageRequest.sort);
|
|
60
|
+
return extractPageRequest(cachedData.current, pageRequest);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
exports.default = useFakePagination;
|
|
66
|
+
//# sourceMappingURL=useFakePagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFakePagination.js","sourceRoot":"","sources":["../../src/lib/hooks/useFakePagination.ts"],"names":[],"mappings":";;AAAA,iCAA+B;AAI/B,MAAM,cAAc,GAAG,CACrB,OAAiB,EACjB,IAAY,EACZ,IAAY,EACZ,aAAqB,EACJ,EAAE,CAAC,CAAC;IACrB,OAAO;IACP,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,IAAI;QACJ,aAAa;QACb,UAAU,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,CA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Creator } from '@reduxjs/toolkit';
|
|
2
|
+
/** It will return a method that only at the very first invocation it will call the retrieverService only the first time, storing the obtained values, and returning always cached values */
|
|
3
|
+
declare const useReduxCachedValue: <T extends any[] | Record<string, any>>(entity: string, retrieverService: () => Promise<T>, reduxSelector: (state: any) => T | undefined, reduxSetterAction: import("@reduxjs/toolkit/dist/tsHelpers").IsAny<T, import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, import("@reduxjs/toolkit/dist/tsHelpers").IsUnknown<T, import("@reduxjs/toolkit").ActionCreatorWithNonInferrablePayload<string>, import("@reduxjs/toolkit/dist/tsHelpers").IfVoid<T, import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, import("@reduxjs/toolkit/dist/tsHelpers").IfMaybeUndefined<T, import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<T, string>, import("@reduxjs/toolkit").ActionCreatorWithPayload<T, string>>>>>, alwaysRetrieve?: boolean | undefined) => () => Promise<T>;
|
|
4
|
+
export default useReduxCachedValue;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_redux_1 = require("react-redux");
|
|
5
|
+
const constants_1 = require("../utils/constants");
|
|
6
|
+
const useLoading_1 = (0, tslib_1.__importDefault)(require("./useLoading"));
|
|
7
|
+
/** It will return a method that only at the very first invocation it will call the retrieverService only the first time, storing the obtained values, and returning always cached values */
|
|
8
|
+
const useReduxCachedValue = (
|
|
9
|
+
/** The name of the entity, used just for logging purpose */
|
|
10
|
+
entity,
|
|
11
|
+
/** The service that will retrieve the value */
|
|
12
|
+
retrieverService,
|
|
13
|
+
/** The selector to verify if a value already exists */
|
|
14
|
+
reduxSelector,
|
|
15
|
+
/** The action to store the value */
|
|
16
|
+
reduxSetterAction,
|
|
17
|
+
/** If true, it will always retrieve and store the new value */
|
|
18
|
+
alwaysRetrieve) => {
|
|
19
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
20
|
+
const entities = (0, react_redux_1.useSelector)(reduxSelector);
|
|
21
|
+
const setEntities = (value) => dispatch(reduxSetterAction(value));
|
|
22
|
+
const setLoading = (0, useLoading_1.default)(`${constants_1.LOADING_TASK_RETRIEVE_CACHED_VALUES}_${entity}`);
|
|
23
|
+
return () => {
|
|
24
|
+
if (alwaysRetrieve || !entities) {
|
|
25
|
+
setLoading(true);
|
|
26
|
+
return retrieverService()
|
|
27
|
+
.then((e) => {
|
|
28
|
+
setEntities(e);
|
|
29
|
+
return e;
|
|
30
|
+
})
|
|
31
|
+
.finally(() => setLoading(false));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return new Promise((resolve) => resolve(entities));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
exports.default = useReduxCachedValue;
|
|
39
|
+
//# sourceMappingURL=useReduxCachedValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReduxCachedValue.js","sourceRoot":"","sources":["../../src/lib/hooks/useReduxCachedValue.tsx"],"names":[],"mappings":";;;AACA,6CAAuD;AACvD,kDAAyE;AACzE,2EAAsC;AAEtC,4LAA4L;AAC5L,MAAM,mBAAmB,GAAG;AAC1B,4DAA4D;AAC5D,MAAc;AACd,+CAA+C;AAC/C,gBAAkC;AAClC,uDAAuD;AACvD,aAA4C;AAC5C,oCAAoC;AACpC,iBAA0C;AAC1C,+DAA+D;AAC/D,cAAwB,EACJ,EAAE;IACtB,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,aAAa,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,CAAC,KAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAErE,MAAM,UAAU,GAAG,IAAA,oBAAU,EAAC,GAAG,+CAAmC,IAAI,MAAM,EAAE,CAAC,CAAC;IAElF,OAAO,GAAe,EAAE;QACtB,IAAI,cAAc,IAAI,CAAC,QAAQ,EAAE;YAC/B,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,OAAO,gBAAgB,EAAE;iBACtB,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;gBACV,WAAW,CAAC,CAAC,CAAC,CAAC;gBACf,OAAO,CAAC,CAAC;YACX,CAAC,CAAC;iBACD,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;SACrC;aAAM;YACL,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;SACpD;IACH,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ErrorInfo } from 'react';
|
|
2
|
+
export declare type AppError = {
|
|
3
|
+
/** The identifier used to recognize the error: it cannot be possible to have the same error id at the same time */
|
|
4
|
+
id: string;
|
|
5
|
+
/** The Error thrown */
|
|
6
|
+
error: Error;
|
|
7
|
+
errorInfo?: ErrorInfo;
|
|
8
|
+
/** If true, this error will show the error page, not allowing the user to do anything, otherwise it will show a closable popup */
|
|
9
|
+
blocking: boolean;
|
|
10
|
+
/** A description of the error to send when notifying the error */
|
|
11
|
+
techDescription: string;
|
|
12
|
+
/** A text to show as title of the popup when a not blocking error occurs */
|
|
13
|
+
displayableTitle?: string;
|
|
14
|
+
/** A text to show as body of the popup when a not blocking error occurs */
|
|
15
|
+
displayableDescription?: string;
|
|
16
|
+
/** If defined, in case of not blocking error, it will render a retry button which will execute this function */
|
|
17
|
+
onRetry?: () => void;
|
|
18
|
+
/** If defined, in case of not blocking error, it will be executed when closing the popup */
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
/** If true, it will notify the error */
|
|
21
|
+
toNotify: boolean;
|
|
22
|
+
/** Can render a SessionModal or Toast component */
|
|
23
|
+
component?: 'SessionModal' | 'Toast';
|
|
24
|
+
/** If component === 'Toast'. The notify will be autoclosed using this configuration, as default timer.
|
|
25
|
+
* If none, it will not be closed automatically.
|
|
26
|
+
* If timer, it will be closed after autocloseMilliseconds milliseconds
|
|
27
|
+
*/
|
|
28
|
+
autoclosable?: 'none' | 'timer';
|
|
29
|
+
/** If component === 'Toast' and autoclosable === 'timer'. The millisecond after which close the notify. As default 2000 */
|
|
30
|
+
autocloseMilliseconds?: number;
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppError.js","sourceRoot":"","sources":["../../src/lib/model/AppError.ts"],"names":[],"mappings":""}
|
package/model/UserNotify.d.ts
CHANGED
|
@@ -8,6 +8,13 @@ export declare type UserNotify = {
|
|
|
8
8
|
message: React.ReactNode;
|
|
9
9
|
/** If component === 'Toast'. The logo to be rendered. As default a confirm logo will be used */
|
|
10
10
|
logo?: React.ElementType;
|
|
11
|
+
/** If component === 'Toast'. The notify will be autoclosed using this configuration, as default timer.
|
|
12
|
+
* If none, it will not be closed automatically.
|
|
13
|
+
* If timer, it will be closed after autocloseMilliseconds milliseconds
|
|
14
|
+
*/
|
|
15
|
+
autoclosable?: 'none' | 'timer';
|
|
16
|
+
/** If component === 'Toast' and autoclosable === 'timer'. The millisecond after which close the notify. As default 2000 */
|
|
17
|
+
autocloseMilliseconds?: number;
|
|
11
18
|
/** If component === 'Toast'. The color used for the left border */
|
|
12
19
|
leftBorderColor?: string;
|
|
13
20
|
/** If component === 'SessionModal'. If defined, it will render a confirm button which will execute this function */
|
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.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/pagopa/selfcare-common-frontend",
|
|
7
7
|
"author": "https://www.pagopa.gov.it",
|
|
@@ -121,8 +121,7 @@
|
|
|
121
121
|
"src/lib/common-polyfill.ts",
|
|
122
122
|
"src/lib/index.ts",
|
|
123
123
|
"src/lib/components/icons/*",
|
|
124
|
-
"src/lib/model/*"
|
|
125
|
-
"src/store.ts"
|
|
124
|
+
"src/lib/model/*"
|
|
126
125
|
]
|
|
127
126
|
}
|
|
128
127
|
}
|
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import {
|
|
2
|
+
import { AppError } from '../../model/AppError';
|
|
3
3
|
import { UserNotify } from '../../model/UserNotify';
|
|
4
|
-
export
|
|
5
|
-
/** The identifier used to recognize the error: it cannot be possible to have the same error id at the same time */
|
|
6
|
-
id: string;
|
|
7
|
-
/** The Error thrown */
|
|
8
|
-
error: Error;
|
|
9
|
-
errorInfo?: ErrorInfo;
|
|
10
|
-
/** If true, this error will show the error page, not allowing the user to do anything, otherwise it will show a closable popup */
|
|
11
|
-
blocking: boolean;
|
|
12
|
-
/** A description of the error to send when notifying the error */
|
|
13
|
-
techDescription: string;
|
|
14
|
-
/** A text to show as title of the popup when a not blocking error occurs */
|
|
15
|
-
displayableTitle?: string;
|
|
16
|
-
/** A text to show as body of the popup when a not blocking error occurs */
|
|
17
|
-
displayableDescription?: string;
|
|
18
|
-
/** If defined, in case of not blocking error, it will render a retry button which will execute this function */
|
|
19
|
-
onRetry?: () => void;
|
|
20
|
-
/** If defined, in case of not blocking error, it will be executed when closing the popup */
|
|
21
|
-
onClose?: () => void;
|
|
22
|
-
/** If true, it will notify the error */
|
|
23
|
-
toNotify: boolean;
|
|
24
|
-
/** Can render a SessionModal or Toast component */
|
|
25
|
-
component?: 'SessionModal' | 'Toast';
|
|
26
|
-
};
|
|
4
|
+
export type { AppError } from '../../model/AppError';
|
|
27
5
|
interface AppStateState {
|
|
28
6
|
loading: {
|
|
29
7
|
result: boolean;
|
|
@@ -96,4 +74,3 @@ export declare const appStateSelectors: {
|
|
|
96
74
|
exitAction?: (() => void) | undefined;
|
|
97
75
|
};
|
|
98
76
|
};
|
|
99
|
-
export {};
|
|
@@ -40,12 +40,30 @@ exports.appStateSlice = (0, toolkit_1.createSlice)({
|
|
|
40
40
|
if (!action.payload.component) {
|
|
41
41
|
action.payload.component = 'SessionModal';
|
|
42
42
|
}
|
|
43
|
+
if (action.payload.component === 'Toast') {
|
|
44
|
+
if (action.payload.autoclosable === undefined) {
|
|
45
|
+
action.payload.autoclosable = 'timer';
|
|
46
|
+
}
|
|
47
|
+
if (action.payload.autoclosable === 'timer' &&
|
|
48
|
+
(!action.payload.autocloseMilliseconds || action.payload.autocloseMilliseconds < 0)) {
|
|
49
|
+
action.payload.autocloseMilliseconds = 2000;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
43
52
|
state.errors.push(action.payload);
|
|
44
53
|
},
|
|
45
54
|
removeError: (state, action) => {
|
|
46
55
|
state.errors = state.errors.filter((e) => e.id !== action.payload.id);
|
|
47
56
|
},
|
|
48
57
|
addNotify: (state, action) => {
|
|
58
|
+
if (action.payload.component === 'Toast') {
|
|
59
|
+
if (action.payload.autoclosable === undefined) {
|
|
60
|
+
action.payload.autoclosable = 'timer';
|
|
61
|
+
}
|
|
62
|
+
if (action.payload.autoclosable === 'timer' &&
|
|
63
|
+
(!action.payload.autocloseMilliseconds || action.payload.autocloseMilliseconds < 0)) {
|
|
64
|
+
action.payload.autocloseMilliseconds = 2000;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
49
67
|
state.userNotifies.push(action.payload);
|
|
50
68
|
},
|
|
51
69
|
removeNotify: (state, action) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appStateSlice.js","sourceRoot":"","sources":["../../../src/lib/redux/slices/appStateSlice.ts"],"names":[],"mappings":";;;AAAA,8CAA8D;
|
|
1
|
+
{"version":3,"file":"appStateSlice.js","sourceRo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AC,KAAK,EAAE,EAAE;YAChC,KAAK,CAAC,wBAAwB,CAAC,IAAI,GAAG,KAAK,CAAC;YAC5C,KAAK,CAAC,wBAAwB,CAAC,UAAU,GAAG,SAAS,CAAC;QACxD,CAAC;KACF;CACF,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,qBAAa,CAAC,OAAO,CAAC;AACxC,QAAA,eAAe,GAAG,qBAAa,CAAC,OAAO,CAAC;AAExC,QAAA,iBAAiB,GAAG;IAC/B,aAAa,EAAE,CAAC,KAAkC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM;IACpF,YAAY,EAAE,CAAC,KAAkC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM;IAC3E,cAAc,EAAE,CAAC,KAAkC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY;IACnF,8BAA8B,EAAE,CAAC,KAAkC,EAAE,EAAE,CACrE,KAAK,CAAC,QAAQ,CAAC,wBAAwB;CAC1C,CAAC"}
|
|
@@ -6,9 +6,11 @@ const isEmpty_1 = (0, tslib_1.__importDefault)(require("lodash/isEmpty"));
|
|
|
6
6
|
const env_1 = require("../config/env");
|
|
7
7
|
const storage_utils_1 = require("../utils/storage-utils");
|
|
8
8
|
const constants_1 = require("../utils/constants");
|
|
9
|
+
const analyticsService_1 = require("./analyticsService");
|
|
9
10
|
const buildAssistanceURI = (assistanceEmail) => {
|
|
10
11
|
const sessionStorageUser = (0, storage_utils_1.storageRead)(constants_1.STORAGE_KEY_USER, 'object');
|
|
11
12
|
if ((0, isEmpty_1.default)(sessionStorageUser)) {
|
|
13
|
+
(0, analyticsService_1.trackEvent)('CUSTOMER_CARE_MAILTO');
|
|
12
14
|
return `mailto:${assistanceEmail}`;
|
|
13
15
|
}
|
|
14
16
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistanceService.js","sourceRoot":"","sources":["../../src/lib/services/assistanceService.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"assistanceService.js","sourceRoot":"","sources":["../../src/lib/services/assistanceService.ts"],"names":[],"mappings":";;;;AAAA,0EAAqC;AACrC,uCAAuC;AACvC,0DAAqD;AACrD,kDAAsD;AACtD,yDAAgD;AAEzC,MAAM,kBAAkB,GAAG,CAAC,eAAwB,EAAE,EAAE;IAC7D,MAAM,kBAAkB,GAAG,IAAA,2BAAW,EAAC,4BAAgB,EAAE,QAAQ,CAAC,CAAC;IAEnE,IAAI,IAAA,iBAAO,EAAC,kBAAkB,CAAC,EAAE;QAC/B,IAAA,6BAAU,EAAC,sBAAsB,CAAC,CAAC;QACnC,OAAO,UAAU,eAAe,EAAE,CAAC;KACpC;SAAM;QACL,OAAO,YAAM,CAAC,MAAM,CAAC,UAAU,CAAC;KACjC;AACH,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B"}
|
package/utils/api-utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as t from 'io-ts';
|
|
|
3
3
|
import { EnhancedStore } from '@reduxjs/toolkit';
|
|
4
4
|
/** To show an error popup to inform of the not valid session */
|
|
5
5
|
export declare const onRedirectToLogin: (store: EnhancedStore) => {
|
|
6
|
-
payload: import("../
|
|
6
|
+
payload: import("../model/AppError").AppError;
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
9
9
|
/** Return the implementation of fetch configured with a timeout */
|
package/utils/constants.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ export declare const STORAGE_KEY_USER = "user";
|
|
|
4
4
|
/** The key used to store in the session storage the logged user token in selfcare projects */
|
|
5
5
|
export declare const STORAGE_KEY_TOKEN = "token";
|
|
6
6
|
export declare const LOADING_TASK_LOGIN_CHECK = "LOGIN_CHECK";
|
|
7
|
+
export declare const LOADING_TASK_RETRIEVE_CACHED_VALUES = "RETRIEVE_CACHED_VALUES";
|
|
7
8
|
/** The short and long labels used for the roles of selfcare's projects */
|
|
8
9
|
export declare const roleLabels: {
|
|
9
10
|
[key in UserRole]: {
|
|
10
11
|
shortLabel: string;
|
|
11
12
|
longLabel: string;
|
|
13
|
+
description: string;
|
|
12
14
|
};
|
|
13
15
|
};
|
package/utils/constants.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.roleLabels = exports.LOADING_TASK_LOGIN_CHECK = exports.STORAGE_KEY_TOKEN = exports.STORAGE_KEY_USER = void 0;
|
|
3
|
+
exports.roleLabels = exports.LOADING_TASK_RETRIEVE_CACHED_VALUES = exports.LOADING_TASK_LOGIN_CHECK = exports.STORAGE_KEY_TOKEN = exports.STORAGE_KEY_USER = void 0;
|
|
4
4
|
/** The key used to store in the session storage the loggedUser in selfcare projects */
|
|
5
5
|
exports.STORAGE_KEY_USER = 'user';
|
|
6
6
|
/** The key used to store in the session storage the logged user token in selfcare projects */
|
|
7
7
|
exports.STORAGE_KEY_TOKEN = 'token';
|
|
8
8
|
exports.LOADING_TASK_LOGIN_CHECK = 'LOGIN_CHECK';
|
|
9
|
+
exports.LOADING_TASK_RETRIEVE_CACHED_VALUES = 'RETRIEVE_CACHED_VALUES';
|
|
9
10
|
/** The short and long labels used for the roles of selfcare's projects */
|
|
10
11
|
exports.roleLabels = {
|
|
11
|
-
ADMIN: {
|
|
12
|
-
|
|
12
|
+
ADMIN: {
|
|
13
|
+
shortLabel: 'Ref. Amministrativo',
|
|
14
|
+
longLabel: 'Referente Amministrativo',
|
|
15
|
+
description: 'Gestisce i prodotti e gli utenti attivi',
|
|
16
|
+
},
|
|
17
|
+
LIMITED: {
|
|
18
|
+
shortLabel: 'Ref. Operativo',
|
|
19
|
+
longLabel: 'Referente Operativo',
|
|
20
|
+
description: 'Operatore prodotto',
|
|
21
|
+
},
|
|
13
22
|
};
|
|
14
23
|
//# sourceMappingURL=constants.js.map
|
package/utils/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/utils/constants.ts"],"names":[],"mappings":";;;AAEA,uFAAuF;AAC1E,QAAA,gBAAgB,GAAG,MAAM,CAAC;AACvC,8FAA8F;AACjF,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAE5B,QAAA,wBAAwB,GAAG,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/utils/constants.ts"],"names":[],"mappings":";;;AAEA,uFAAuF;AAC1E,QAAA,gBAAgB,GAAG,MAAM,CAAC;AACvC,8FAA8F;AACjF,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAE5B,QAAA,wBAAwB,GAAG,aAAa,CAAC;AACzC,QAAA,mCAAmC,GAAG,wBAAwB,CAAC;AAE5E,0EAA0E;AAC7D,QAAA,UAAU,GAEnB;IACF,KAAK,EAAE;QACL,UAAU,EAAE,qBAAqB;QACjC,SAAS,EAAE,0BAA0B;QACrC,WAAW,EAAE,yCAAyC;KACvD;IACD,OAAO,EAAE;QACP,UAAU,EAAE,gBAAgB;QAC5B,SAAS,EAAE,qBAAqB;QAChC,WAAW,EAAE,oBAAoB;KAClC;CACF,CAAC"}
|