@rh-support/components 1.1.22 → 1.1.25
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/lib/cjs/helperFunctions/errorMessage.d.ts +1 -0
- package/lib/cjs/helperFunctions/errorMessage.d.ts.map +1 -1
- package/lib/cjs/helperFunctions/errorMessage.js +14 -7
- package/lib/cjs/helperFunctions/errorMessage.scss +3 -0
- package/lib/esm/helperFunctions/errorMessage.d.ts +1 -0
- package/lib/esm/helperFunctions/errorMessage.d.ts.map +1 -1
- package/lib/esm/helperFunctions/errorMessage.js +14 -7
- package/lib/esm/helperFunctions/errorMessage.scss +3 -0
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAC;AAS7B,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACxC;AAsDD,iBAAS,wBAAwB,CAAC,KAAK,KAAA,EAAE,aAAa,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,CAwCxF;AAED,iBAAS,iBAAiB,CAAC,KAAK,KAAA,EAAE,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAIjE;AAED,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -4,14 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.errorMessageTitle = exports.formattedApiErrorMessage = void 0;
|
|
7
|
+
require("./errorMessage.scss");
|
|
8
|
+
var react_core_1 = require("@patternfly/react-core");
|
|
9
|
+
var external_link_alt_icon_1 = __importDefault(require("@patternfly/react-icons/dist/js/icons/external-link-alt-icon"));
|
|
7
10
|
var isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
8
11
|
var react_1 = __importDefault(require("react"));
|
|
9
12
|
var SupportFeedbackForm_1 = require("../SupportFeedbackForm");
|
|
10
13
|
var defaultTitle = "Sorry, we're experiencing an error";
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
var errorMessageButtonLabel = 'contact us';
|
|
15
|
+
var defaultErrorMessage = (react_1.default.createElement("p", { className: "pf-u-mb-0" },
|
|
16
|
+
"Try refreshing the page. Please ",
|
|
17
|
+
react_1.default.createElement(SupportFeedbackForm_1.SupportFeedbackForm, { isInline: true, buttonLabel: errorMessageButtonLabel }),
|
|
18
|
+
" if the problem persists.",
|
|
19
|
+
react_1.default.createElement("br", null),
|
|
20
|
+
react_1.default.createElement(react_core_1.Button, { variant: "link", component: "a", href: "https://status.redhat.com/", "data-tracking-id": "redirect-status-portal-button", target: "_blank", icon: react_1.default.createElement(external_link_alt_icon_1.default, { className: "status-portal-button-icon" }), iconPosition: "right", className: "pf-u-pl-0", isInline: true, "aria-label": "View status page" }, "View status page"),
|
|
21
|
+
' '));
|
|
15
22
|
var defaultErrorObj = {
|
|
16
23
|
500: {
|
|
17
24
|
title: defaultTitle,
|
|
@@ -36,7 +43,7 @@ var defaultErrorObj = {
|
|
|
36
43
|
};
|
|
37
44
|
// the error argument need a better typing here. We want to make sure that user is passing an error object and not an error string
|
|
38
45
|
function formattedApiErrorMessage(error, customMessage) {
|
|
39
|
-
var _a, _b;
|
|
46
|
+
var _a, _b, _c;
|
|
40
47
|
var errorCode = parseInt((error === null || error === void 0 ? void 0 : error.code) || (error === null || error === void 0 ? void 0 : error.status)) || '';
|
|
41
48
|
if (!customMessage)
|
|
42
49
|
customMessage = {};
|
|
@@ -46,7 +53,7 @@ function formattedApiErrorMessage(error, customMessage) {
|
|
|
46
53
|
return ((_a = customMessage[errorCode]) === null || _a === void 0 ? void 0 : _a.message) || defaultErrorMessage;
|
|
47
54
|
}
|
|
48
55
|
else if (errorCode === 403) {
|
|
49
|
-
if (customMessage[errorCode].message) {
|
|
56
|
+
if ((_b = customMessage[errorCode]) === null || _b === void 0 ? void 0 : _b.message) {
|
|
50
57
|
return customMessage[errorCode].message;
|
|
51
58
|
}
|
|
52
59
|
else if ((error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : error.detailMessage)) {
|
|
@@ -64,7 +71,7 @@ function formattedApiErrorMessage(error, customMessage) {
|
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
73
|
else if (errorCode === 404) {
|
|
67
|
-
return (((
|
|
74
|
+
return (((_c = customMessage[errorCode]) === null || _c === void 0 ? void 0 : _c.message) ||
|
|
68
75
|
(error === null || error === void 0 ? void 0 : error.message) ||
|
|
69
76
|
(error === null || error === void 0 ? void 0 : error.detailMessage) ||
|
|
70
77
|
defaultErrorObj[errorCode].message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAC;AAS7B,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACxC;AAsDD,iBAAS,wBAAwB,CAAC,KAAK,KAAA,EAAE,aAAa,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,CAwCxF;AAED,iBAAS,iBAAiB,CAAC,KAAK,KAAA,EAAE,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAIjE;AAED,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import './errorMessage.scss';
|
|
2
|
+
import { Button } from '@patternfly/react-core';
|
|
3
|
+
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
1
4
|
import isEmpty from 'lodash/isEmpty';
|
|
2
5
|
import React from 'react';
|
|
3
6
|
import { SupportFeedbackForm } from '../SupportFeedbackForm';
|
|
4
7
|
const defaultTitle = "Sorry, we're experiencing an error";
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
const errorMessageButtonLabel = 'contact us';
|
|
9
|
+
const defaultErrorMessage = (React.createElement("p", { className: "pf-u-mb-0" },
|
|
10
|
+
"Try refreshing the page. Please ",
|
|
11
|
+
React.createElement(SupportFeedbackForm, { isInline: true, buttonLabel: errorMessageButtonLabel }),
|
|
12
|
+
" if the problem persists.",
|
|
13
|
+
React.createElement("br", null),
|
|
14
|
+
React.createElement(Button, { variant: "link", component: "a", href: "https://status.redhat.com/", "data-tracking-id": "redirect-status-portal-button", target: "_blank", icon: React.createElement(ExternalLinkAltIcon, { className: "status-portal-button-icon" }), iconPosition: "right", className: "pf-u-pl-0", isInline: true, "aria-label": "View status page" }, "View status page"),
|
|
15
|
+
' '));
|
|
9
16
|
const defaultErrorObj = {
|
|
10
17
|
500: {
|
|
11
18
|
title: defaultTitle,
|
|
@@ -30,7 +37,7 @@ const defaultErrorObj = {
|
|
|
30
37
|
};
|
|
31
38
|
// the error argument need a better typing here. We want to make sure that user is passing an error object and not an error string
|
|
32
39
|
function formattedApiErrorMessage(error, customMessage) {
|
|
33
|
-
var _a, _b;
|
|
40
|
+
var _a, _b, _c;
|
|
34
41
|
const errorCode = parseInt((error === null || error === void 0 ? void 0 : error.code) || (error === null || error === void 0 ? void 0 : error.status)) || '';
|
|
35
42
|
if (!customMessage)
|
|
36
43
|
customMessage = {};
|
|
@@ -40,7 +47,7 @@ function formattedApiErrorMessage(error, customMessage) {
|
|
|
40
47
|
return ((_a = customMessage[errorCode]) === null || _a === void 0 ? void 0 : _a.message) || defaultErrorMessage;
|
|
41
48
|
}
|
|
42
49
|
else if (errorCode === 403) {
|
|
43
|
-
if (customMessage[errorCode].message) {
|
|
50
|
+
if ((_b = customMessage[errorCode]) === null || _b === void 0 ? void 0 : _b.message) {
|
|
44
51
|
return customMessage[errorCode].message;
|
|
45
52
|
}
|
|
46
53
|
else if ((error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : error.detailMessage)) {
|
|
@@ -58,7 +65,7 @@ function formattedApiErrorMessage(error, customMessage) {
|
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
else if (errorCode === 404) {
|
|
61
|
-
return (((
|
|
68
|
+
return (((_c = customMessage[errorCode]) === null || _c === void 0 ? void 0 : _c.message) ||
|
|
62
69
|
(error === null || error === void 0 ? void 0 : error.message) ||
|
|
63
70
|
(error === null || error === void 0 ? void 0 : error.detailMessage) ||
|
|
64
71
|
defaultErrorObj[errorCode].message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"description": "Contains all reusabel components for support app",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"prepublishOnly": "npm run build"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@cee-eng/hydrajs": "4.7.
|
|
55
|
+
"@cee-eng/hydrajs": "4.7.20",
|
|
56
56
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
57
|
-
"@patternfly/patternfly": "4.
|
|
58
|
-
"@patternfly/react-core": "4.
|
|
59
|
-
"@patternfly/react-table": "4.
|
|
57
|
+
"@patternfly/patternfly": "4.176.2",
|
|
58
|
+
"@patternfly/react-core": "4.194.0",
|
|
59
|
+
"@patternfly/react-table": "4.63.0",
|
|
60
60
|
"@rh-support/api": "0.3.9",
|
|
61
61
|
"@rh-support/types": "0.1.21",
|
|
62
62
|
"@rh-support/user-permissions": "0.1.46",
|
|
@@ -80,15 +80,15 @@
|
|
|
80
80
|
"use-deep-compare-effect": "^1.6.1"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@cee-eng/hydrajs": "4.7.
|
|
83
|
+
"@cee-eng/hydrajs": "4.7.20",
|
|
84
84
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
85
|
-
"@patternfly/patternfly": "4.
|
|
86
|
-
"@patternfly/react-core": "4.
|
|
87
|
-
"@patternfly/react-table": "4.
|
|
88
|
-
"@rh-support/api": "0.3.
|
|
85
|
+
"@patternfly/patternfly": "4.176.2",
|
|
86
|
+
"@patternfly/react-core": "4.194.0",
|
|
87
|
+
"@patternfly/react-table": "4.63.0",
|
|
88
|
+
"@rh-support/api": "0.3.10",
|
|
89
89
|
"@rh-support/types": "0.2.0",
|
|
90
|
-
"@rh-support/user-permissions": "0.2.
|
|
91
|
-
"@rh-support/utils": "0.2.
|
|
90
|
+
"@rh-support/user-permissions": "0.2.19",
|
|
91
|
+
"@rh-support/utils": "0.2.17",
|
|
92
92
|
"@storybook/addon-a11y": "^5.3.19",
|
|
93
93
|
"@storybook/addon-actions": "^5.3.19",
|
|
94
94
|
"@storybook/addon-docs": "^5.3.19",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"not ie <= 11",
|
|
129
129
|
"not op_mini all"
|
|
130
130
|
],
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "2821a4eb373d262b83d3a512900eb68d1fa22d55"
|
|
132
132
|
}
|