@redhat-cloud-services/frontend-components-utilities 4.0.19 → 5.0.3
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/MiddlewareListener/MiddlewareListener.js.map +1 -1
- package/MiddlewareListener/index.js.map +1 -1
- package/RBAC/RBAC.d.ts +0 -1
- package/RBAC/RBAC.js +18 -18
- package/RBAC/RBAC.js.map +1 -1
- package/RBAC/index.js.map +1 -1
- package/RBACHook/RBACHook.d.ts +1 -1
- package/RBACHook/RBACHook.js +4 -4
- package/RBACHook/RBACHook.js.map +1 -1
- package/RBACHook/index.js.map +1 -1
- package/ReducerRegistry/ReducerRegistry.js +3 -3
- package/ReducerRegistry/ReducerRegistry.js.map +1 -1
- package/ReducerRegistry/index.js.map +1 -1
- package/Registry/Registry.js +3 -3
- package/Registry/Registry.js.map +1 -1
- package/Registry/index.d.ts +2 -2
- package/Registry/index.js.map +1 -1
- package/RouterParams/RouterParams.d.ts +0 -1
- package/RouterParams/RouterParams.js.map +1 -1
- package/RouterParams/index.js.map +1 -1
- package/RowLoader/RowLoader.js.map +1 -1
- package/RowLoader/index.js.map +1 -1
- package/TestingUtils/CypressUtils/CustomCommands.js +6 -5
- package/TestingUtils/CypressUtils/CustomCommands.js.map +1 -1
- package/TestingUtils/CypressUtils/PaginationUtils.js +5 -5
- package/TestingUtils/CypressUtils/PaginationUtils.js.map +1 -1
- package/TestingUtils/CypressUtils/TableUtils.js +6 -6
- package/TestingUtils/CypressUtils/TableUtils.js.map +1 -1
- package/TestingUtils/CypressUtils/UIFilters.js +5 -6
- package/TestingUtils/CypressUtils/UIFilters.js.map +1 -1
- package/TestingUtils/CypressUtils/index.js.map +1 -1
- package/TestingUtils/CypressUtils/selectors.d.ts +2 -2
- package/TestingUtils/CypressUtils/selectors.js.map +1 -1
- package/TestingUtils/JestUtils/TestWrapper.js.map +1 -1
- package/TestingUtils/JestUtils/index.js.map +1 -1
- package/TestingUtils/package.json +1 -1
- package/debounce/debounce.js.map +1 -1
- package/debounce/index.js.map +1 -1
- package/esm/MiddlewareListener/MiddlewareListener.d.ts +17 -0
- package/esm/MiddlewareListener/MiddlewareListener.js.map +1 -1
- package/esm/MiddlewareListener/index.d.ts +2 -0
- package/esm/MiddlewareListener/index.js.map +1 -1
- package/esm/RBAC/RBAC.d.ts +29 -0
- package/esm/RBAC/RBAC.js +14 -14
- package/esm/RBAC/RBAC.js.map +1 -1
- package/esm/RBAC/index.d.ts +2 -0
- package/esm/RBAC/index.js.map +1 -1
- package/esm/RBACHook/RBACHook.d.ts +10 -0
- package/esm/RBACHook/RBACHook.js +2 -2
- package/esm/RBACHook/RBACHook.js.map +1 -1
- package/esm/RBACHook/index.d.ts +2 -0
- package/esm/RBACHook/index.js.map +1 -1
- package/esm/ReducerRegistry/ReducerRegistry.d.ts +19 -0
- package/esm/ReducerRegistry/ReducerRegistry.js.map +1 -1
- package/esm/ReducerRegistry/index.d.ts +2 -0
- package/esm/ReducerRegistry/index.js.map +1 -1
- package/esm/Registry/Registry.d.ts +6 -0
- package/esm/Registry/Registry.js.map +1 -1
- package/esm/Registry/index.d.ts +2 -0
- package/esm/Registry/index.js.map +1 -1
- package/esm/RouterParams/RouterParams.d.ts +6 -0
- package/esm/RouterParams/RouterParams.js.map +1 -1
- package/esm/RouterParams/index.d.ts +2 -0
- package/esm/RouterParams/index.js.map +1 -1
- package/esm/RowLoader/RowLoader.d.ts +3 -0
- package/esm/RowLoader/RowLoader.js.map +1 -1
- package/esm/RowLoader/index.d.ts +2 -0
- package/esm/RowLoader/index.js.map +1 -1
- package/esm/TestingUtils/CypressUtils/CustomCommands.d.ts +4 -0
- package/esm/TestingUtils/CypressUtils/CustomCommands.js +4 -2
- package/esm/TestingUtils/CypressUtils/CustomCommands.js.map +1 -1
- package/esm/TestingUtils/CypressUtils/PaginationUtils.d.ts +11 -0
- package/esm/TestingUtils/CypressUtils/PaginationUtils.js.map +1 -1
- package/esm/TestingUtils/CypressUtils/TableUtils.d.ts +12 -0
- package/esm/TestingUtils/CypressUtils/TableUtils.js.map +1 -1
- package/esm/TestingUtils/CypressUtils/UIFilters.d.ts +18 -0
- package/esm/TestingUtils/CypressUtils/UIFilters.js.map +1 -1
- package/esm/TestingUtils/CypressUtils/index.d.ts +5 -0
- package/esm/TestingUtils/CypressUtils/index.js.map +1 -1
- package/esm/TestingUtils/CypressUtils/selectors.d.ts +52 -0
- package/esm/TestingUtils/CypressUtils/selectors.js.map +1 -1
- package/esm/TestingUtils/JestUtils/TestWrapper.d.ts +20 -0
- package/esm/TestingUtils/JestUtils/TestWrapper.js.map +1 -1
- package/esm/TestingUtils/JestUtils/index.d.ts +1 -0
- package/esm/TestingUtils/JestUtils/index.js.map +1 -1
- package/esm/debounce/debounce.d.ts +4 -0
- package/esm/debounce/debounce.js.map +1 -1
- package/esm/debounce/index.d.ts +2 -0
- package/esm/debounce/index.js.map +1 -1
- package/esm/helpers/helpers.d.ts +11 -0
- package/esm/helpers/helpers.js.map +1 -1
- package/esm/helpers/index.d.ts +3 -0
- package/esm/helpers/index.js.map +1 -1
- package/esm/helpers/urlPathHelpers.d.ts +3 -0
- package/esm/helpers/urlPathHelpers.js.map +1 -1
- package/esm/index.d.ts +22 -0
- package/esm/index.js.map +1 -1
- package/esm/interceptors/index.d.ts +2 -0
- package/esm/interceptors/index.js.map +1 -1
- package/esm/interceptors/interceptors.d.ts +14 -0
- package/esm/interceptors/interceptors.js +3 -4
- package/esm/interceptors/interceptors.js.map +1 -1
- package/esm/parseCvssScore/index.d.ts +2 -0
- package/esm/parseCvssScore/index.js.map +1 -1
- package/esm/parseCvssScore/parseCvssScore.d.ts +2 -0
- package/esm/parseCvssScore/parseCvssScore.js +1 -1
- package/esm/parseCvssScore/parseCvssScore.js.map +1 -1
- package/esm/styles/_all.scss +3 -3
- package/esm/useExportPDF/index.d.ts +2 -0
- package/esm/useExportPDF/index.js.map +1 -1
- package/esm/useExportPDF/useExportPDF.d.ts +3 -0
- package/esm/useExportPDF/useExportPDF.js +6 -29
- package/esm/useExportPDF/useExportPDF.js.map +1 -1
- package/esm/useFetchBatched/index.d.ts +1 -0
- package/esm/useFetchBatched/index.js.map +1 -1
- package/esm/useFetchBatched/useFetchBatched.d.ts +7 -0
- package/esm/useFetchBatched/useFetchBatched.js.map +1 -1
- package/esm/useInsightsNavigate/index.d.ts +2 -0
- package/esm/useInsightsNavigate/index.js.map +1 -1
- package/esm/useInsightsNavigate/useInsightsNavigate.d.ts +3 -0
- package/esm/useInsightsNavigate/useInsightsNavigate.js +1 -2
- package/esm/useInsightsNavigate/useInsightsNavigate.js.map +1 -1
- package/esm/useInventory/index.d.ts +2 -0
- package/esm/useInventory/index.js.map +1 -1
- package/esm/useInventory/useInventory.d.ts +13 -0
- package/esm/useInventory/useInventory.js +2 -2
- package/esm/useInventory/useInventory.js.map +1 -1
- package/esm/usePromiseQueue/index.d.ts +1 -0
- package/esm/usePromiseQueue/index.js.map +1 -1
- package/esm/usePromiseQueue/usePromiseQueue.d.ts +6 -0
- package/esm/usePromiseQueue/usePromiseQueue.js +10 -3
- package/esm/usePromiseQueue/usePromiseQueue.js.map +1 -1
- package/esm/useSuspenseLoader/index.d.ts +2 -0
- package/esm/useSuspenseLoader/index.js.map +1 -1
- package/esm/useSuspenseLoader/useSuspenseLoader.d.ts +6 -0
- package/esm/useSuspenseLoader/useSuspenseLoader.js.map +1 -1
- package/helpers/helpers.js +5 -5
- package/helpers/helpers.js.map +1 -1
- package/helpers/index.js.map +1 -1
- package/helpers/urlPathHelpers.d.ts +1 -1
- package/helpers/urlPathHelpers.js.map +1 -1
- package/index.js.map +1 -1
- package/interceptors/index.js.map +1 -1
- package/interceptors/interceptors.js +9 -10
- package/interceptors/interceptors.js.map +1 -1
- package/package.json +45 -53
- package/parseCvssScore/index.js.map +1 -1
- package/parseCvssScore/parseCvssScore.js.map +1 -1
- package/styles/_all.scss +3 -3
- package/useExportPDF/index.js.map +1 -1
- package/useExportPDF/useExportPDF.d.ts +1 -1
- package/useExportPDF/useExportPDF.js +6 -29
- package/useExportPDF/useExportPDF.js.map +1 -1
- package/useFetchBatched/index.js.map +1 -1
- package/useFetchBatched/useFetchBatched.js.map +1 -1
- package/useInsightsNavigate/index.js.map +1 -1
- package/useInsightsNavigate/useInsightsNavigate.d.ts +1 -1
- package/useInsightsNavigate/useInsightsNavigate.js +1 -5
- package/useInsightsNavigate/useInsightsNavigate.js.map +1 -1
- package/useInventory/index.js.map +1 -1
- package/useInventory/useInventory.js +2 -2
- package/useInventory/useInventory.js.map +1 -1
- package/usePromiseQueue/index.js.map +1 -1
- package/usePromiseQueue/usePromiseQueue.js +11 -4
- package/usePromiseQueue/usePromiseQueue.js.map +1 -1
- package/useSuspenseLoader/index.js.map +1 -1
- package/useSuspenseLoader/useSuspenseLoader.js.map +1 -1
- package/README.md +0 -92
- package/esm/mergeMessages/index.js +0 -3
- package/esm/mergeMessages/index.js.map +0 -1
- package/esm/mergeMessages/mergeMessages.js +0 -71
- package/esm/mergeMessages/mergeMessages.js.map +0 -1
- package/mergeMessages/index.d.ts +0 -1
- package/mergeMessages/index.js +0 -3
- package/mergeMessages/index.js.map +0 -1
- package/mergeMessages/mergeMessages.d.ts +0 -1
- package/mergeMessages/mergeMessages.js +0 -71
- package/mergeMessages/mergeMessages.js.map +0 -1
- package/mergeMessages/package.json +0 -1
|
@@ -35,8 +35,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g =
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
39
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
40
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
41
|
function step(op) {
|
|
42
42
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -65,11 +65,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
65
65
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
66
66
|
};
|
|
67
67
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
|
-
exports.instance = exports.useAxiosWithPlatformInterceptors = exports.
|
|
68
|
+
exports.instance = exports.useAxiosWithPlatformInterceptors = exports.interceptor401 = exports.authInterceptor = exports.HttpError = void 0;
|
|
69
|
+
exports.authInterceptorWithChrome = authInterceptorWithChrome;
|
|
70
|
+
exports.responseDataInterceptor = responseDataInterceptor;
|
|
71
|
+
exports.interceptor401WithChrome = interceptor401WithChrome;
|
|
72
|
+
exports.interceptor500 = interceptor500;
|
|
73
|
+
exports.errorInterceptor = errorInterceptor;
|
|
69
74
|
var react_1 = require("react");
|
|
70
75
|
var axios_1 = __importDefault(require("axios"));
|
|
71
76
|
var browser_1 = require("@sentry/browser");
|
|
72
|
-
var useChrome_1 = require("@redhat-cloud-services/frontend-components/useChrome");
|
|
73
77
|
var HttpError = (function (_super) {
|
|
74
78
|
__extends(HttpError, _super);
|
|
75
79
|
function HttpError(description) {
|
|
@@ -94,7 +98,6 @@ function authInterceptorWithChrome(chrome) {
|
|
|
94
98
|
});
|
|
95
99
|
};
|
|
96
100
|
}
|
|
97
|
-
exports.authInterceptorWithChrome = authInterceptorWithChrome;
|
|
98
101
|
exports.authInterceptor = authInterceptorWithChrome();
|
|
99
102
|
function responseDataInterceptor(response) {
|
|
100
103
|
if (response.data) {
|
|
@@ -102,7 +105,6 @@ function responseDataInterceptor(response) {
|
|
|
102
105
|
}
|
|
103
106
|
return response;
|
|
104
107
|
}
|
|
105
|
-
exports.responseDataInterceptor = responseDataInterceptor;
|
|
106
108
|
function interceptor401WithChrome(chrome) {
|
|
107
109
|
return function (error) {
|
|
108
110
|
if (error.response && error.response.status === 401) {
|
|
@@ -112,7 +114,6 @@ function interceptor401WithChrome(chrome) {
|
|
|
112
114
|
throw error;
|
|
113
115
|
};
|
|
114
116
|
}
|
|
115
|
-
exports.interceptor401WithChrome = interceptor401WithChrome;
|
|
116
117
|
exports.interceptor401 = interceptor401WithChrome();
|
|
117
118
|
function interceptor500(error) {
|
|
118
119
|
if (error.response && error.response.status >= 500 && error.response.status < 600) {
|
|
@@ -122,7 +123,6 @@ function interceptor500(error) {
|
|
|
122
123
|
}
|
|
123
124
|
throw error;
|
|
124
125
|
}
|
|
125
|
-
exports.interceptor500 = interceptor500;
|
|
126
126
|
function errorInterceptor(err) {
|
|
127
127
|
var _a, _b;
|
|
128
128
|
if (!axios_1.default.isCancel(err)) {
|
|
@@ -144,9 +144,8 @@ function errorInterceptor(err) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
exports.errorInterceptor = errorInterceptor;
|
|
148
147
|
var useAxiosWithPlatformInterceptors = function () {
|
|
149
|
-
var chrome =
|
|
148
|
+
var chrome = window.insights.chrome;
|
|
150
149
|
var instance = (0, react_1.useMemo)(function () {
|
|
151
150
|
var memoInstance = axios_1.default.create();
|
|
152
151
|
memoInstance.interceptors.request.use(authInterceptorWithChrome(chrome));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptors.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"interceptors.js","sourceRoot":"","sources":["../../../../packages/utils/src/interceptors/interceptors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,8DAOC;AAKD,0DAMC;AAED,4DAUC;AAKD,wCAQC;AAED,4CAoBC;AA7ED,+BAAgC;AAChC,gDAA0B;AAC1B,2CAAmE;AAEnE;IA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
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@types/react": "^18.0.0",
|
|
50
|
-
"glob": "10.3.3",
|
|
51
|
-
"react-intl": "^6.6.8",
|
|
52
|
-
"redux-mock-store": "^1.5.4"
|
|
53
|
-
},
|
|
54
|
-
"sideEffects": false
|
|
2
|
+
"name": "@redhat-cloud-services/frontend-components-utilities",
|
|
3
|
+
"version": "5.0.3",
|
|
4
|
+
"description": "Util functions for RedHat Cloud Services project.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "esm/index.js",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/RedHatInsights/frontend-components.git"
|
|
14
|
+
},
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/RedHatInsights/frontend-components/issues"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/RedHatInsights/frontend-components/tree/master/packages/utils#readme",
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@patternfly/react-core": "^5.0.0",
|
|
23
|
+
"@patternfly/react-table": "^5.0.0",
|
|
24
|
+
"react": "^18.2.0",
|
|
25
|
+
"react-dom": "^18.2.0",
|
|
26
|
+
"react-redux": "^7.0.0",
|
|
27
|
+
"react-router-dom": "^5.0.0 || ^6.0.0"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@redhat-cloud-services/rbac-client": "^1.0.111 || 2.x",
|
|
31
|
+
"@redhat-cloud-services/types": "^1.0.9",
|
|
32
|
+
"@sentry/browser": "^7.119.1",
|
|
33
|
+
"awesome-debounce-promise": "^2.1.0",
|
|
34
|
+
"axios": "^0.28.1 || ^1.7.0",
|
|
35
|
+
"commander": "^2.20.3",
|
|
36
|
+
"mkdirp": "^1.0.4",
|
|
37
|
+
"p-map": "^7.0.2",
|
|
38
|
+
"react-content-loader": "^6.2.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/react": "^18.0.0",
|
|
42
|
+
"glob": "10.3.3",
|
|
43
|
+
"react-intl": "^6.6.8",
|
|
44
|
+
"redux-mock-store": "^1.5.4"
|
|
45
|
+
},
|
|
46
|
+
"sideEffects": false
|
|
55
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utils/src/parseCvssScore/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,mDAA2C;AAAlC,0HAAA,OAAO,OAAA;AAChB,mDAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseCvssScore.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"parseCvssScore.js","sourceRoot":"","sources":["../../../../packages/utils/src/parseCvssScore/parseCvssScore.tsx"],"names":[],"mappings":";;;AACA,qDAAiD;AAEjD,SAAS,cAAc,CAAC,MAAwB,EAAE,MAAwB,EAAE,UAAkB;IAAlB,2BAAA,EAAA,kBAAkB;IAC5F,IAAM,SAAS,GAAG,8FAA8F,CAAC;IACjH,IAAM,SAAS,GAAG,4EAA4E,CAAC;IAC/F,OAAO,CACL,CAAC,MAAM,IAAI,UAAU,CAAC,MAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC,MAAM,IAAI,CACT,uBAAC,oBAAO,IAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAC3C,6CACG,UAAG,UAAU,CAAC,MAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAAG,UAAU,IAAI,UAAU,IACnE,GACC,CACX,CAAC,IAAI,CACJ,uBAAC,oBAAO,IAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAC3C,mDAAgB,GACR,CACX,CACF,CAAC;AACJ,CAAC;AAED,kBAAe,cAAc,CAAC"}
|
package/styles/_all.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Sass Imports
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
2
|
+
@use './_variables.scss' as variables;
|
|
3
|
+
@use './_helpers.scss' as helpers;
|
|
4
|
+
@use './_mixins.scss' as mixins;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utils/src/useExportPDF/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AAAhC,wHAAA,OAAO,OAAA;AAChB,iDAA+B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const pdfGeneratorURL: URL;
|
|
2
|
-
declare const usePDFExport: (service: string
|
|
2
|
+
declare const usePDFExport: (service: string) => (template: string, filename: string, exportSettings: Record<string, unknown>) => Promise<void>;
|
|
3
3
|
export default usePDFExport;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -37,7 +37,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.pdfGeneratorURL = void 0;
|
|
40
|
-
var redux_1 = require("@redhat-cloud-services/frontend-components-notifications/redux");
|
|
41
40
|
var CRC_PDF_GENERATE_API = '/api/crc-pdf-generator/v1/generate';
|
|
42
41
|
exports.pdfGeneratorURL = new URL(CRC_PDF_GENERATE_API, window.location.origin);
|
|
43
42
|
var fetchPDF = function (service, template, params) {
|
|
@@ -63,38 +62,16 @@ var renderPDF = function (pdfBlob, fileName) {
|
|
|
63
62
|
a.click();
|
|
64
63
|
a.remove();
|
|
65
64
|
};
|
|
66
|
-
var usePDFExport = function (service
|
|
65
|
+
var usePDFExport = function (service) {
|
|
67
66
|
var exportPDF = function (template, filename, exportSettings) { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
-
var pdfBlob
|
|
67
|
+
var pdfBlob;
|
|
69
68
|
return __generator(this, function (_a) {
|
|
70
69
|
switch (_a.label) {
|
|
71
|
-
case 0:
|
|
72
|
-
dispatch((0, redux_1.addNotification)({
|
|
73
|
-
variant: 'info',
|
|
74
|
-
title: 'Preparing export',
|
|
75
|
-
description: 'Once complete, your download will start automatically.',
|
|
76
|
-
}));
|
|
77
|
-
_a.label = 1;
|
|
70
|
+
case 0: return [4, fetchPDF(service, template, exportSettings)];
|
|
78
71
|
case 1:
|
|
79
|
-
_a.trys.push([1, 3, , 4]);
|
|
80
|
-
return [4, fetchPDF(service, template, exportSettings)];
|
|
81
|
-
case 2:
|
|
82
72
|
pdfBlob = _a.sent();
|
|
83
73
|
renderPDF(pdfBlob, filename);
|
|
84
|
-
|
|
85
|
-
variant: 'success',
|
|
86
|
-
title: 'Downloading export',
|
|
87
|
-
}));
|
|
88
|
-
return [3, 4];
|
|
89
|
-
case 3:
|
|
90
|
-
e_1 = _a.sent();
|
|
91
|
-
dispatch((0, redux_1.addNotification)({
|
|
92
|
-
variant: 'danger',
|
|
93
|
-
title: 'Couldn’t download export',
|
|
94
|
-
description: 'Reinitiate this export to try again.',
|
|
95
|
-
}));
|
|
96
|
-
return [3, 4];
|
|
97
|
-
case 4: return [2];
|
|
74
|
+
return [2];
|
|
98
75
|
}
|
|
99
76
|
});
|
|
100
77
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExportPDF.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"useExportPDF.js","sourceRoot":"","sources":["../../../../packages/utils/src/useExportPDF/useExportPDF.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,oBAAoB,GAAG,oCAAoC,CAAC;AACrD,QAAA,eAAe,GAAG,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrF,IAAM,QAAQ,GAAG,UAAC,OAAe,EAAE,QAAgB,EAAE,MAA+B;IAClF,OAAO,KAAK,CAAC,uBAAe,EAAE;QAC5B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;QAED,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,OAAO,SAAA;YACP,QAAQ,UAAA;YACR,MAAM,QAAA;SACP,CAAC;KACH,CAAC,CAAC,IAAI,CAAC,UAAC,QAAQ,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,EAAf,CAAe,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,IAAM,SAAS,GAAG,UAAC,OAAa,EAAE,QAAuB;IAAvB,yBAAA,EAAA,uBAAuB;IACvD,IAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAChD,IAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC;IACb,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,MAAM,EAAE,CAAC;AACb,CAAC,CAAC;AAIF,IAAM,YAAY,GAAG,UAAC,OAAe;IACnC,IAAM,SAAS,GAAG,UAAO,QAAgB,EAAE,QAAgB,EAAE,cAAuC;;;;wBAClF,WAAM,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,CAAC,EAAA;;oBAA3D,OAAO,GAAG,SAAiD;oBACjE,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;;;;SAC9B,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utils/src/useFetchBatched/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA4C;AAAnC,2HAAA,OAAO,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchBatched.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"useFetchBatched.js","sourceRoot":"","sources":["../../../../packages/utils/src/useFetchBatched/useFetchBatched.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uEAAiD;AAKjD,IAAM,eAAe,GAAG;IAChB,IAAA,KAAsC,IAAA,yBAAe,GAAE,EAAxC,SAAS,iBAAA,EAAE,OAAO,aAAsB,CAAC;IAE9D,OAAO;QACL,SAAS,WAAA;QACT,YAAY,EAAE,UAAC,aAAgC,EAAE,KAAa,EAAE,MAAc,EAAE,SAAc;YAAd,0BAAA,EAAA,cAAc;YAC5F,IAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAEhD,IAAM,OAAO,GAAG,OAAO,CAAC,kBAAI,IAAI,KAAK,CAAC,KAAK,CAAC,QAAE,GAAG,CAAC,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,cAAM,OAAA,aAAa,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAjE,CAAiE,EAAvE,CAAuE,CAAC,CAAC,CAAC;YAE5I,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,kBAAkB,EAAE,UAAC,aAAgC,EAAE,IAAmB,EAAE,SAAc;YAAd,0BAAA,EAAA,cAAc;YACxF,IAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAEtD,IAAM,OAAO,GAAG,OAAO,CACrB,kBAAI,IAAI,KAAK,CAAC,KAAK,CAAC,QAAE,GAAG,CAAC,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,cAAM,OAAA,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO,EAAE,SAAS,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,EAAzE,CAAyE,EAA/E,CAA+E,CAAC,CAC3H,CAAC;YAEF,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utils/src/useInsightsNavigate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6DAAgD;AAAvC,+HAAA,OAAO,OAAA;AAChB,wDAAsC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LinkProps } from 'react-router-dom';
|
|
2
|
-
declare const useInsightsNavigate: (app: string, forcePreview?: boolean) => (to: LinkProps[
|
|
2
|
+
declare const useInsightsNavigate: (app: string, forcePreview?: boolean) => (to: LinkProps["to"], preview?: boolean) => void;
|
|
3
3
|
export default useInsightsNavigate;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
var react_router_dom_1 = require("react-router-dom");
|
|
7
|
-
var useChrome_1 = __importDefault(require("@redhat-cloud-services/frontend-components/useChrome"));
|
|
8
4
|
var urlPathHelpers_1 = require("../helpers/urlPathHelpers");
|
|
9
5
|
var useInsightsNavigate = function (app, forcePreview) {
|
|
10
6
|
var navigate = (0, react_router_dom_1.useNavigate)();
|
|
11
|
-
var chrome =
|
|
7
|
+
var chrome = window.insights.chrome;
|
|
12
8
|
return function (to, preview) { return navigate((0, urlPathHelpers_1.buildInsightsPath)(chrome, app, to, preview || forcePreview)); };
|
|
13
9
|
};
|
|
14
10
|
exports.default = useInsightsNavigate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInsightsNavigate.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"useInsightsNavigate.js","sourceRoot":"","sources":["../../../../packages/utils/src/useInsightsNavigate/useInsightsNavigate.ts"],"names":[],"mappings":";;AAAA,qDAA0D;AAC1D,4DAA8D;AAE9D,IAAM,mBAAmB,GAAG,UAAC,GAAW,EAAE,YAAsB;IAG9D,IAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAE/B,IAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAEtC,OAAO,UAAC,EAAmB,EAAE,OAAiB,IAAK,OAAA,QAAQ,CAAC,IAAA,kCAAiB,EAAC,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,IAAI,YAAY,CAAC,CAAC,EAArE,CAAqE,CAAC;AAC3H,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utils/src/useInventory/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AAAhC,wHAAA,OAAO,OAAA;AAChB,iDAA+B"}
|
|
@@ -43,8 +43,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g =
|
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
47
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
48
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
49
|
function step(op) {
|
|
50
50
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInventory.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"useInventory.js","sourceRoot":"","sources":["../../../../packages/utils/src/useInventory/useInventory.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4C;AAC5C,+DAAmD;AACnD,uDAA8H;AAE9H,iEAA8F;AAE9F,OAAO,CAAC,KAAK,CAAC,kHAAkH,CAAC,CAAC;AAC3H,IAAM,YAAY,GAAG,UAAC,EAAmD;QAAjD,KAAK,WAAA,EAAE,YAAY,kBAAA,EAAE,aAAa,mBAAA,EAAE,WAAW,iBAAA;IAC5E,IAAI,eAAe,CAAC;IACd,IAAA,KAA4B,IAAA,gBAAQ,EAAC;QACzC,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;KAClB,CAAC,EAHK,SAAS,QAAA,EAAE,YAAY,QAG5B,CAAC;IAEG,IAAA,KAAgD,IAAA,gBAAQ,EAAC;QAC7D,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;QACrB,aAAa,EAAE,IAAI;KACpB,CAAC,EAJK,mBAAmB,QAAA,EAAE,sBAAsB,QAIhD,CAAC;IAEH,IAAA,iBAAS,EAAC;QACR,CAAC;;;;;;wBACK,SAAS,GAAG,KAAK,CAAC;wBAEqE,WAAM,QAAQ,CAAC,aAAa,CAAC;gCACtH,cAAc,gBAAA;gCACd,YAAY,EAAE;oCACZ,KAAK,EAAE,kBAAO;oCACd,SAAS,wBAAA;oCACT,WAAW,0BAAA;oCACX,mBAAmB,mCAAA;oCACnB,SAAS,yBAAA;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AAsB,CAAC,cAAM,OAAA,CAAC;4BAC5B,eAAe,EAAE;gCACf,mBAAmB,qBAAA;gCACnB,OAAO,SAAA;gCACP,eAAe,iBAAA;6BAChB;4BACD,cAAc,gBAAA;4BACd,aAAa,eAAA;yBACd,CAAC,EAR2B,CAQ3B,CAAC,CAAC;;;;aACL,CAAC,EAAE,CAAC;QAEL,OAAO;YACL,IAAI,eAAe,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE,CAAC;gBAC7D,eAAe,EAAE,CAAC;YACpB,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,6BACK,SAAS,GACT,mBAAmB,EACtB;AACJ,CAAC,CAAC;AAzFW,QAAA,YAAY,gBAyFvB;AAEF,kBAAe,oBAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utils/src/usePromiseQueue/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA4C;AAAnC,2HAAA,OAAO,OAAA"}
|
|
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g =
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -51,7 +51,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
53
|
var react_1 = require("react");
|
|
54
|
-
var
|
|
54
|
+
var p_map_1 = __importDefault(require("p-map"));
|
|
55
|
+
function pAll(iterable, options) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
return [2, (0, p_map_1.default)(iterable, function (element) { return element(); }, options)];
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
55
62
|
var DEFAULT_CONCURRENT_PROMISES = 2;
|
|
56
63
|
var usePromiseQueue = function (concurrency) {
|
|
57
64
|
if (concurrency === void 0) { concurrency = DEFAULT_CONCURRENT_PROMISES; }
|
|
@@ -66,7 +73,7 @@ var usePromiseQueue = function (concurrency) {
|
|
|
66
73
|
switch (_a.label) {
|
|
67
74
|
case 0:
|
|
68
75
|
setResults(function (state) { return (__assign(__assign({}, state), { isResolving: true })); });
|
|
69
|
-
return [4, (
|
|
76
|
+
return [4, pAll(fns, {
|
|
70
77
|
concurrency: concurrency,
|
|
71
78
|
})];
|
|
72
79
|
case 1:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePromiseQueue.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"usePromiseQueue.js","sourceRoot":"","sources":["../../../../packages/utils/src/usePromiseQueue/usePromiseQueue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA8C;AAC9C,gDAAsC;AAEtC,SAAe,IAAI,CAAC,QAAsC,EAAE,OAAgB;;;YAC1E,WAAO,IAAA,eAAI,EAAC,QAAQ,EAAE,UAAC,OAAO,IAAK,OAAA,OAAO,EAAE,EAAT,CAAS,EAAE,OAAO,CAAC,EAAC;;;CACxD;AAED,IAAM,2BAA2B,GAAG,CAAC,CAAC;AAStC,IAAM,eAAe,GAAG,UAAC,WAAyC;IAAzC,4BAAA,EAAA,yCAAyC;IAChE,IAAM,YAAY,GAA0B;QAC1C,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE,SAAS;KAC1B,CAAC;IACI,IAAA,KAAwB,IAAA,gBAAQ,EAAC,YAAY,CAAC,EAA7C,OAAO,QAAA,EAAE,UAAU,QAA0B,CAAC;IAErD,IAAM,OAAO,GAAG,IAAA,mBAAW,EACzB,UAAO,GAAQ;;;;;oBACb,UAAU,CAAC,UAAC,KAAK,IAAK,OAAA,uBACjB,KAAK,KACR,WAAW,EAAE,IAAI,IACjB,EAHoB,CAGpB,CAAC,CAAC;oBACiB,WAAM,IAAI,CAAC,GAAG,EAAE;4BACnC,WAAW,aAAA;yBACZ,CAAC,EAAA;;oBAFI,OAAO,GAAQ,SAEnB;oBACF,UAAU,CAAC;wBACT,WAAW,EAAE,KAAK;wBAClB,cAAc,EAAE,OAAO;qBACxB,CAAC,CAAC;oBAEH,WAAO,OAAO,EAAC;;;SAChB,EACD,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,OAAO,CAAC,cAAc;QAC/B,OAAO,SAAA;KACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utils/src/useSuspenseLoader/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,yDAAgE;AAAvD,oIAAA,OAAO,OAAkB;AAClC,sDAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSuspenseLoader.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":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AAC,KAAK,GAAG,KAAK,CAAC;gBAC1B,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,KAAK,CAAC,CAAC;gBACrB,WAAW,EAAE,CAAC;gBACd,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;YACL,MAAM,WAAW,CAAC,OAAO,CAAC;QAC5B,CAAC;QACD,UAAU,EAAE;YAGV,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACxB,WAAW,EAAE,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC;AAID,kBAAe,iBAAiB,CAAC"}
|
package/README.md
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# RedHat Cloud Services frontend components - utils
|
|
2
|
-
|
|
3
|
-
[](https://badge.fury.io/js/%40redhat-cloud-services%2Ffrontend-components-utilities)
|
|
4
|
-
|
|
5
|
-
This package exports common functions to be used in other packages.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
With NPM
|
|
9
|
-
```bash
|
|
10
|
-
npm i -S @redhat-cloud-services/frontend-components-utilities
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
With yarn
|
|
14
|
-
```bash
|
|
15
|
-
yarn add @redhat-cloud-services/frontend-components-utilities
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
This package is dependent on [@redhat-cloud-services/frontend-components](https://www.npmjs.com/package/@redhat-cloud-services/frontend-components) it will automatically installed trough direct dependencies.
|
|
19
|
-
|
|
20
|
-
## Migration guide
|
|
21
|
-
### v2 -> v3
|
|
22
|
-
|
|
23
|
-
### Import path change
|
|
24
|
-
|
|
25
|
-
Assets are no longer under `/files` directory but directly at the root of the build directory.
|
|
26
|
-
|
|
27
|
-
```jsx
|
|
28
|
-
// v2
|
|
29
|
-
import { getRegistry } from '@redhat-cloud-services/frontend-components-utilities/Registry';
|
|
30
|
-
|
|
31
|
-
// v3
|
|
32
|
-
import { getRegistry } from '@redhat-cloud-services/frontend-components-utilities/Registry';
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
#### No UMD build
|
|
36
|
-
|
|
37
|
-
Utils package no longer provides UMD version of the build.
|
|
38
|
-
|
|
39
|
-
#### RowLoader
|
|
40
|
-
|
|
41
|
-
RowLoader component is no longer a part of `helpers` file but is now a stand-alone component. Import path has changed.
|
|
42
|
-
|
|
43
|
-
```jsx
|
|
44
|
-
// v2
|
|
45
|
-
import { RowLoader } from '@redhat-cloud-services/frontend-components-utilities/helpers'
|
|
46
|
-
// v3
|
|
47
|
-
import RowLoader from '@redhat-cloud-services/frontend-components-utilities/RowLoader'
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
#### SCSS files
|
|
51
|
-
|
|
52
|
-
SCSS files are now under `styles` directory.
|
|
53
|
-
|
|
54
|
-
```scss
|
|
55
|
-
/** v2 */
|
|
56
|
-
@import '~@redhat-cloud-services/frontend-components-utilities/styles/all';
|
|
57
|
-
/** v3 */
|
|
58
|
-
@import '~@redhat-cloud-services/frontend-components-utilities/styles/all''
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
#### inventoryDependencies
|
|
63
|
-
|
|
64
|
-
This module is now deprecated. Use a new Inventory component compatible with chrome 2.0.
|
|
65
|
-
|
|
66
|
-
#### parseCvssScore
|
|
67
|
-
|
|
68
|
-
Function `parseCvssScore` has been moved to a stand-alone file. Import path has changed.
|
|
69
|
-
```jsx
|
|
70
|
-
// v2
|
|
71
|
-
import { parseCvssScore } from '@redhat-cloud-services/frontend-components-utilities/helpers'
|
|
72
|
-
// v3
|
|
73
|
-
import parseCvssScore from '@redhat-cloud-services/frontend-components-utilities/parseCvssScore'
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Documentation Links
|
|
77
|
-
|
|
78
|
-
* Utils
|
|
79
|
-
* [redux](doc/redux.md)
|
|
80
|
-
* [routerParams](doc/routerParams.md)
|
|
81
|
-
* [debounce](doc/debounce.md)
|
|
82
|
-
* [cypress](doc/Cypress.md)
|
|
83
|
-
* [RBAC](doc/RBAC.md)
|
|
84
|
-
|
|
85
|
-
Additionaly it exports these utilities
|
|
86
|
-
* AsyncComponent - class to load component via async calls
|
|
87
|
-
* helpers - custom helper functions
|
|
88
|
-
* MiddlewareListener - redux listener on actions, they can fire additional action or be cancelled
|
|
89
|
-
* Registry - reducer registry
|
|
90
|
-
* RouterParams - maps route to props
|
|
91
|
-
* interceptors - to be used with axios clients
|
|
92
|
-
* Styles - custom style functions in sass
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mergeMessages/index.js"],"names":[],"mappings":";AAAA,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
|