@pagopa/selfcare-common-frontend 1.5.12 → 1.5.13
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 +6 -0
- package/README.md +11 -7
- package/build.info +2 -2
- package/hooks/useLogin.js +5 -6
- package/hooks/useLogin.js.map +1 -1
- package/package.json +1 -1
- package/services/assistanceService.js +2 -3
- package/services/assistanceService.js.map +1 -1
- package/utils/constants.d.ts +0 -4
- package/utils/constants.js +1 -5
- package/utils/constants.js.map +1 -1
- package/utils/storage-utils.d.ts +7 -0
- package/utils/storage-utils.js +10 -1
- package/utils/storage-utils.js.map +1 -1
- package/utils/storage.d.ts +5 -0
- package/utils/storage.js +9 -0
- package/utils/storage.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,14 @@ 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.13](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.12...v1.5.13)
|
|
8
|
+
|
|
9
|
+
- storageOpsBuilder + token and user storageOps methods [`#39`](https://github.com/pagopa/selfcare-common-frontend/pull/39)
|
|
10
|
+
|
|
7
11
|
#### [v1.5.12](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.11...v1.5.12)
|
|
8
12
|
|
|
13
|
+
> 23 February 2022
|
|
14
|
+
|
|
9
15
|
- storage-utils can writes to local storage [`#38`](https://github.com/pagopa/selfcare-common-frontend/pull/38)
|
|
10
16
|
|
|
11
17
|
#### [v1.5.11](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.10...v1.5.11)
|
package/README.md
CHANGED
|
@@ -141,12 +141,6 @@ If emptyResponseHttpStatus is not null and the returned status is equal to empt
|
|
|
141
141
|
Other statuses will return will throw a generic error.
|
|
142
142
|
|
|
143
143
|
## constants
|
|
144
|
-
### STORAGE_KEY_USER: string
|
|
145
|
-
The key used to store in the session storage the loggedUser in selfcare projects
|
|
146
|
-
|
|
147
|
-
### STORAGE_KEY_TOKEN: string
|
|
148
|
-
The key used to store in the session storage the logged user token in selfcare projects
|
|
149
|
-
|
|
150
144
|
### roleLabels: { [key in UserRole]: { shortLabel: string; longLabel: string } }
|
|
151
145
|
The short and long labels used for the roles of selfcare's projects
|
|
152
146
|
|
|
@@ -163,10 +157,13 @@ If local is true, it will use the local session storage instead.
|
|
|
163
157
|
It will store a key/value pair in the session storage.
|
|
164
158
|
If local is true, it will use the local session storage instead.
|
|
165
159
|
|
|
166
|
-
###
|
|
160
|
+
### storageRead: (key: string, type: StorageValueType, local?: boolean) => void
|
|
167
161
|
It will read a key from the session storage.
|
|
168
162
|
If local is true, it will use the local session storage instead.
|
|
169
163
|
|
|
164
|
+
### storageOpsBuilder(key: string, type: StorageValueType, local: boolean): StorageOps
|
|
165
|
+
It will build an object containing a complete set of operation to perform on the same key.
|
|
166
|
+
|
|
170
167
|
## utils
|
|
171
168
|
### formatDateAsLongString: (date: Date) => string
|
|
172
169
|
It will return a string representing the provided date in the italian format gg mmm aaaa
|
|
@@ -174,6 +171,13 @@ It will return a string representing the provided date in the italian format gg
|
|
|
174
171
|
## fixSwagger20ArraySchemaDef.js
|
|
175
172
|
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
|
|
176
173
|
|
|
174
|
+
## storage
|
|
175
|
+
### storageTokenOps
|
|
176
|
+
An object containing a complete set of operation on the storage regarding the key used to store in the storage the loggedUser token in selfcare projects.
|
|
177
|
+
|
|
178
|
+
### storageUserOps
|
|
179
|
+
An object containing a complete set of operation on the storage regarding the key used to store in the storage the loggedUser in selfcare projects.
|
|
180
|
+
|
|
177
181
|
# Decorators
|
|
178
182
|
## withLogin
|
|
179
183
|
This feature is based on react-redux library and require to register the reducer build in userSlice into the application's redux store.
|
package/build.info
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
20220223.
|
|
2
|
-
tags/v1.5.
|
|
1
|
+
20220223.2 - selfcare-common-frontend.deploy(21362)
|
|
2
|
+
tags/v1.5.13^0 64b6990b823c2a33bc72c583bd0156b0286254bd
|
package/hooks/useLogin.js
CHANGED
|
@@ -4,10 +4,9 @@ exports.useLogin = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const isEmpty_1 = (0, tslib_1.__importDefault)(require("lodash/isEmpty"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
|
-
const storage_utils_1 = require("../utils/storage-utils");
|
|
8
7
|
const env_1 = require("../config/env");
|
|
9
|
-
const constants_1 = require("../utils/constants");
|
|
10
8
|
const userSlice_1 = require("../redux/slices/userSlice");
|
|
9
|
+
const storage_1 = require("../utils/storage");
|
|
11
10
|
const testToken = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Imp3dF9kZjplNjoxOTplYToxZTpjZTplNjo3Yjo3MDo0MjoyYzphMjpjZDo4Yjo1MjowYiJ9.eyJlbWFpbCI6ImZ1cmlvdml0YWxlQG1hcnRpbm8uaXQiLCJmYW1pbHlfbmFtZSI6IlNhcnRvcmkiLCJmaXNjYWxfbnVtYmVyIjoiU1JUTkxNMDlUMDZHNjM1UyIsIm5hbWUiOiJBbnNlbG1vIiwiZnJvbV9hYSI6ZmFsc2UsInVpZCI6IjliMTdjZTcwLWY3OWYtNDJkOS04YjBlLTRlN2ViNGQ4ODA3NCIsImxldmVsIjoiTDIiLCJpYXQiOjE2Mzk1OTI2NTMsImlzcyI6IlNQSUQiLCJqdGkiOiIwMUZQWk5DV1c0RFhIQ0JZNFlHVFBKTkM2UiJ9.Cz6bZ1degD0APpJS3rfLPdjpjBE9JBGByVoLcFtqGhDxRAOhP_5aKqE0-1S9u9QUCakmhLA8i1auV7ImP8CLMaJTyUGUwz85yYL9KgqcRZ9qsYghFDqBQsh-n5_4Ldsu1-vBp2klwpJA87ppdzEyLZnSp6kUhpytFf00XtmSOYvt6-OMI6K6bBVFGXk_IYGs4KHx3-fij1DGg-_8BhghtkvJVyC2p9R4XezT8oXg55H-sBigTPdk9LssDa75Pj91zwPrbwTOBp9Tgk0HqOgieEDDpIuVplJI2uaq9YpDNyZkR8RnkSV072gPWlrJXDEb1-zXty7nT8NcGdRGTHDkkQ';
|
|
12
11
|
const mockedUser = {
|
|
13
12
|
uid: '0',
|
|
@@ -22,15 +21,15 @@ const useLogin = () => {
|
|
|
22
21
|
const attemptSilentLogin = async () => {
|
|
23
22
|
if (env_1.CONFIG.MOCKS.MOCK_USER) {
|
|
24
23
|
setUser(mockedUser);
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
storage_1.storageTokenOps.write(testToken);
|
|
25
|
+
storage_1.storageUserOps.write(mockedUser);
|
|
27
26
|
return;
|
|
28
27
|
}
|
|
29
|
-
const sessionStorageUser =
|
|
28
|
+
const sessionStorageUser = storage_1.storageUserOps.read();
|
|
30
29
|
// If there are no credentials, it is impossible to get the user, so
|
|
31
30
|
if ((0, isEmpty_1.default)(sessionStorageUser)) {
|
|
32
31
|
// Remove any partial data that might have remained, just for safety
|
|
33
|
-
|
|
32
|
+
storage_1.storageUserOps.delete();
|
|
34
33
|
// Go to the login view
|
|
35
34
|
window.location.assign(env_1.CONFIG.URL_FE.LOGIN);
|
|
36
35
|
// This return is necessary
|
package/hooks/useLogin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLogin.js","sourceRoot":"","sources":["../../src/lib/hooks/useLogin.ts"],"names":[],"mappings":";;;;AAAA,0EAAqC;AACrC,6CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"useLogin.js","sourceRoot":"","sources":["../../src/lib/hooks/useLogin.ts"],"names":[],"mappings":";;;;AAAA,0EAAqC;AACrC,6CAA0C;AAC1C,uCAAuC;AAEvC,yDAAwD;AACxD,8CAAmE;AAEnE,MAAM,SAAS,GACb,0xBAA0xB,CAAC;AAE7xB,MAAM,UAAU,GAAG;IACjB,GAAG,EAAE,GAAG;IACR,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,mBAAmB;CAC3B,CAAC;AAEK,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,CAAC,IAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,uBAAW,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1E,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,YAAM,CAAC,KAAK,CAAC,SAAS,EAAE;YAC1B,OAAO,CAAC,UAAU,CAAC,CAAC;YACpB,yBAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACjC,wBAAc,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACjC,OAAO;SACR;QAED,MAAM,kBAAkB,GAAG,wBAAc,CAAC,IAAI,EAAE,CAAC;QAEjD,oEAAoE;QACpE,IAAI,IAAA,iBAAO,EAAC,kBAAkB,CAAC,EAAE;YAC/B,oEAAoE;YACpE,wBAAc,CAAC,MAAM,EAAE,CAAC;YACxB,uBAAuB;YACvB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5C,2BAA2B;YAC3B,OAAO;SACR;QAED,2DAA2D;QAC3D,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAChC,CAAC,CAAC;AA7BW,QAAA,QAAQ,YA6BnB"}
|
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.5.
|
|
4
|
+
"version": "1.5.13",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/pagopa/selfcare-common-frontend",
|
|
7
7
|
"author": "https://www.pagopa.gov.it",
|
|
@@ -4,11 +4,10 @@ exports.buildAssistanceURI = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const isEmpty_1 = (0, tslib_1.__importDefault)(require("lodash/isEmpty"));
|
|
6
6
|
const env_1 = require("../config/env");
|
|
7
|
-
const
|
|
8
|
-
const constants_1 = require("../utils/constants");
|
|
7
|
+
const storage_1 = require("../utils/storage");
|
|
9
8
|
const analyticsService_1 = require("./analyticsService");
|
|
10
9
|
const buildAssistanceURI = (assistanceEmail) => {
|
|
11
|
-
const sessionStorageUser =
|
|
10
|
+
const sessionStorageUser = storage_1.storageUserOps.read();
|
|
12
11
|
if ((0, isEmpty_1.default)(sessionStorageUser)) {
|
|
13
12
|
(0, analyticsService_1.trackEvent)('CUSTOMER_CARE_MAILTO');
|
|
14
13
|
return `mailto:${assistanceEmail}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistanceService.js","sourceRoot":"","sources":["../../src/lib/services/assistanceService.ts"],"names":[],"mappings":";;;;AAAA,0EAAqC;AACrC,uCAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"assistanceService.js","sourceRoot":"","sources":["../../src/lib/services/assistanceService.ts"],"names":[],"mappings":";;;;AAAA,0EAAqC;AACrC,uCAAuC;AACvC,8CAAkD;AAClD,yDAAgD;AAEzC,MAAM,kBAAkB,GAAG,CAAC,eAAwB,EAAE,EAAE;IAC7D,MAAM,kBAAkB,GAAG,wBAAc,CAAC,IAAI,EAAE,CAAC;IAEjD,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/constants.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { UserRole } from '../model/Party';
|
|
2
|
-
/** The key used to store in the session storage the loggedUser in selfcare projects */
|
|
3
|
-
export declare const STORAGE_KEY_USER = "user";
|
|
4
|
-
/** The key used to store in the session storage the logged user token in selfcare projects */
|
|
5
|
-
export declare const STORAGE_KEY_TOKEN = "token";
|
|
6
2
|
export declare const LOADING_TASK_LOGIN_CHECK = "LOGIN_CHECK";
|
|
7
3
|
export declare const LOADING_TASK_RETRIEVE_CACHED_VALUES = "RETRIEVE_CACHED_VALUES";
|
|
8
4
|
/** The short and long labels used for the roles of selfcare's projects */
|
package/utils/constants.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.roleLabels = exports.LOADING_TASK_RETRIEVE_CACHED_VALUES = exports.LOADING_TASK_LOGIN_CHECK =
|
|
4
|
-
/** The key used to store in the session storage the loggedUser in selfcare projects */
|
|
5
|
-
exports.STORAGE_KEY_USER = 'user';
|
|
6
|
-
/** The key used to store in the session storage the logged user token in selfcare projects */
|
|
7
|
-
exports.STORAGE_KEY_TOKEN = 'token';
|
|
3
|
+
exports.roleLabels = exports.LOADING_TASK_RETRIEVE_CACHED_VALUES = exports.LOADING_TASK_LOGIN_CHECK = void 0;
|
|
8
4
|
exports.LOADING_TASK_LOGIN_CHECK = 'LOGIN_CHECK';
|
|
9
5
|
exports.LOADING_TASK_RETRIEVE_CACHED_VALUES = 'RETRIEVE_CACHED_VALUES';
|
|
10
6
|
/** The short and long labels used for the roles of selfcare's projects */
|
package/utils/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/utils/constants.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/utils/constants.ts"],"names":[],"mappings":";;;AAEa,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"}
|
package/utils/storage-utils.d.ts
CHANGED
|
@@ -6,4 +6,11 @@ export declare function storageDelete(key: string, local?: boolean): void;
|
|
|
6
6
|
export declare function storageWrite(key: string, value: StorageValue, type: StorageValueType, local?: boolean): void;
|
|
7
7
|
/** It will read a key from the session storage. If local is true, it will use the local session storage instead. */
|
|
8
8
|
export declare function storageRead(key: string, type: StorageValueType, local?: boolean): any;
|
|
9
|
+
export declare type StorageOps<T> = {
|
|
10
|
+
delete: () => void;
|
|
11
|
+
read: () => T;
|
|
12
|
+
write: (value: T) => void;
|
|
13
|
+
};
|
|
14
|
+
/** Build an object with a complete set of operation to perform on the same key */
|
|
15
|
+
export declare function storageOpsBuilder<T extends StorageValue>(key: string, type: StorageValueType, local: boolean): StorageOps<T>;
|
|
9
16
|
export {};
|
package/utils/storage-utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.storageRead = exports.storageWrite = exports.storageDelete = void 0;
|
|
3
|
+
exports.storageOpsBuilder = exports.storageRead = exports.storageWrite = exports.storageDelete = void 0;
|
|
4
4
|
/** It will delete a key from the session storage. If local is true, it will use the local session storage instead. */
|
|
5
5
|
function storageDelete(key, local) {
|
|
6
6
|
const storage = local ? window.localStorage : window.sessionStorage;
|
|
@@ -34,4 +34,13 @@ function storageRead(key, type, local) {
|
|
|
34
34
|
return parseFn[type]();
|
|
35
35
|
}
|
|
36
36
|
exports.storageRead = storageRead;
|
|
37
|
+
/** Build an object with a complete set of operation to perform on the same key */
|
|
38
|
+
function storageOpsBuilder(key, type, local) {
|
|
39
|
+
return {
|
|
40
|
+
delete: () => storageDelete(key, local),
|
|
41
|
+
read: () => storageRead(key, type, local),
|
|
42
|
+
write: (value) => storageWrite(key, value, type, local),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.storageOpsBuilder = storageOpsBuilder;
|
|
37
46
|
//# sourceMappingURL=storage-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-utils.js","sourceRoot":"","sources":["../../src/lib/utils/storage-utils.ts"],"names":[],"mappings":";;;AAIA,sHAAsH;AACtH,SAAgB,aAAa,CAAC,GAAW,EAAE,KAAe;IACxD,MAAM,OAAO,GAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC;IAC7E,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAHD,sCAGC;AAED,8HAA8H;AAC9H,SAAgB,YAAY,CAC1B,GAAW,EACX,KAAmB,EACnB,IAAsB,EACtB,KAAe;IAEf,MAAM,WAAW,GAAgD;QAC/D,MAAM,EAAE,GAAG,EAAE,CAAC,KAAe;QAC7B,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;QAC3B,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;KACpC,CAAC;IAEF,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;IAExC,MAAM,OAAO,GAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,MA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AAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;KACxD,CAAC;AACJ,CAAC;AAVD,8CAUC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { User } from '../model/User';
|
|
2
|
+
/** An object containing a complete set of operation on the storage regarding the key used to store in the storage the loggedUser token in selfcare projects */
|
|
3
|
+
export declare const storageTokenOps: import("./storage-utils").StorageOps<string>;
|
|
4
|
+
/** An object containing a complete set of operation on the storage regarding the key used to store in the storage the loggedUser in selfcare projects */
|
|
5
|
+
export declare const storageUserOps: import("./storage-utils").StorageOps<User>;
|
package/utils/storage.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.storageUserOps = exports.storageTokenOps = void 0;
|
|
4
|
+
const storage_utils_1 = require("./storage-utils");
|
|
5
|
+
/** An object containing a complete set of operation on the storage regarding the key used to store in the storage the loggedUser token in selfcare projects */
|
|
6
|
+
exports.storageTokenOps = (0, storage_utils_1.storageOpsBuilder)('token', 'string', true);
|
|
7
|
+
/** An object containing a complete set of operation on the storage regarding the key used to store in the storage the loggedUser in selfcare projects */
|
|
8
|
+
exports.storageUserOps = (0, storage_utils_1.storageOpsBuilder)('user', 'object', true);
|
|
9
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/lib/utils/storage.ts"],"names":[],"mappings":";;;AACA,mDAAoD;AAEpD,+JAA+J;AAClJ,QAAA,eAAe,GAAG,IAAA,iCAAiB,EAAS,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AAClF,yJAAyJ;AAC5I,QAAA,cAAc,GAAG,IAAA,iCAAiB,EAAO,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC"}
|