@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.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import './errorMessage.scss';
2
3
  export interface IAppErrorObj {
3
4
  title: string;
4
5
  message: string | JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":";AAKA,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;AAqCD,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
+ {"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 defaultErrorMessage = (react_1.default.createElement("p", null,
12
- "Please ",
13
- react_1.default.createElement(SupportFeedbackForm_1.SupportFeedbackForm, { isInline: true }),
14
- " if you continue to see this message."));
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 (((_b = customMessage[errorCode]) === null || _b === void 0 ? void 0 : _b.message) ||
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);
@@ -0,0 +1,3 @@
1
+ .status-portal-button-icon {
2
+ font-size: var(--pf-global--icon--FontSize--sm);
3
+ }
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import './errorMessage.scss';
2
3
  export interface IAppErrorObj {
3
4
  title: string;
4
5
  message: string | JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"errorMessage.d.ts","sourceRoot":"","sources":["../../../src/helperFunctions/errorMessage.tsx"],"names":[],"mappings":";AAKA,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;AAqCD,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
+ {"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 defaultErrorMessage = (React.createElement("p", null,
6
- "Please ",
7
- React.createElement(SupportFeedbackForm, { isInline: true }),
8
- " if you continue to see this message."));
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 (((_b = customMessage[errorCode]) === null || _b === void 0 ? void 0 : _b.message) ||
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);
@@ -0,0 +1,3 @@
1
+ .status-portal-button-icon {
2
+ font-size: var(--pf-global--icon--FontSize--sm);
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/components",
3
- "version": "1.1.22",
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.3",
55
+ "@cee-eng/hydrajs": "4.7.20",
56
56
  "@cee-eng/ui-toolkit": "1.1.6",
57
- "@patternfly/patternfly": "4.102.2",
58
- "@patternfly/react-core": "4.128.2",
59
- "@patternfly/react-table": "4.26.7",
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.3",
83
+ "@cee-eng/hydrajs": "4.7.20",
84
84
  "@cee-eng/ui-toolkit": "1.1.6",
85
- "@patternfly/patternfly": "4.102.2",
86
- "@patternfly/react-core": "4.128.2",
87
- "@patternfly/react-table": "4.26.7",
88
- "@rh-support/api": "0.3.9",
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.17",
91
- "@rh-support/utils": "0.2.15",
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": "95f6b6477203d61a26c97454278664b6023eb2cf"
131
+ "gitHead": "2821a4eb373d262b83d3a512900eb68d1fa22d55"
132
132
  }