@rh-support/components 1.1.81 → 1.1.84
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/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/cjs/ErrorBoundary/ErrorBoundary.js +4 -3
- package/lib/cjs/TopContentSearch/TopContentSearch.d.ts.map +1 -1
- package/lib/cjs/TopContentSearch/TopContentSearch.js +1 -2
- package/lib/cjs/index.d.ts +0 -2
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +0 -2
- package/lib/esm/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/esm/ErrorBoundary/ErrorBoundary.js +3 -2
- package/lib/esm/TopContentSearch/TopContentSearch.d.ts.map +1 -1
- package/lib/esm/TopContentSearch/TopContentSearch.js +1 -2
- package/lib/esm/index.d.ts +0 -2
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +0 -2
- package/package.json +4 -6
- package/lib/cjs/Input/Input.css +0 -4
- package/lib/cjs/Input/Input.d.ts +0 -21
- package/lib/cjs/Input/Input.d.ts.map +0 -1
- package/lib/cjs/Input/Input.js +0 -101
- package/lib/cjs/Input/index.d.ts +0 -2
- package/lib/cjs/Input/index.d.ts.map +0 -1
- package/lib/cjs/Input/index.js +0 -13
- package/lib/cjs/ProductOnlySelector/ProductOnlyDropdownSelector.d.ts +0 -11
- package/lib/cjs/ProductOnlySelector/ProductOnlyDropdownSelector.d.ts.map +0 -1
- package/lib/cjs/ProductOnlySelector/ProductOnlyDropdownSelector.js +0 -71
- package/lib/cjs/ProductOnlySelector/ProductOnlySelector.d.ts +0 -8
- package/lib/cjs/ProductOnlySelector/ProductOnlySelector.d.ts.map +0 -1
- package/lib/cjs/ProductOnlySelector/ProductOnlySelector.js +0 -164
- package/lib/cjs/ProductOnlySelector/README.md +0 -0
- package/lib/cjs/ProductOnlySelector/index.d.ts +0 -3
- package/lib/cjs/ProductOnlySelector/index.d.ts.map +0 -1
- package/lib/cjs/ProductOnlySelector/index.js +0 -14
- package/lib/cjs/ProductOnlySelector/productOnlySelector.css +0 -156
- package/lib/esm/Input/Input.css +0 -4
- package/lib/esm/Input/Input.d.ts +0 -21
- package/lib/esm/Input/Input.d.ts.map +0 -1
- package/lib/esm/Input/Input.js +0 -48
- package/lib/esm/Input/index.d.ts +0 -2
- package/lib/esm/Input/index.d.ts.map +0 -1
- package/lib/esm/Input/index.js +0 -1
- package/lib/esm/ProductOnlySelector/ProductOnlyDropdownSelector.d.ts +0 -11
- package/lib/esm/ProductOnlySelector/ProductOnlyDropdownSelector.d.ts.map +0 -1
- package/lib/esm/ProductOnlySelector/ProductOnlyDropdownSelector.js +0 -29
- package/lib/esm/ProductOnlySelector/ProductOnlySelector.d.ts +0 -8
- package/lib/esm/ProductOnlySelector/ProductOnlySelector.d.ts.map +0 -1
- package/lib/esm/ProductOnlySelector/ProductOnlySelector.js +0 -79
- package/lib/esm/ProductOnlySelector/README.md +0 -0
- package/lib/esm/ProductOnlySelector/index.d.ts +0 -3
- package/lib/esm/ProductOnlySelector/index.d.ts.map +0 -1
- package/lib/esm/ProductOnlySelector/index.js +0 -2
- package/lib/esm/ProductOnlySelector/productOnlySelector.css +0 -156
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAkC,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjG,UAAU,MAAM;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACtC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5D;AAED,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,kBAAkB,EAAE;YAChB,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;QACF,aAAa,EAAE;YACX,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL;CACJ;AAED,qBAAa,aAAc,SAAQ,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;gBAC5C,KAAK,KAAA;IAKjB,MAAM,CAAC,wBAAwB;;;IAK/B,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,KAAA;IAiBzC,MAAM;CAcT"}
|
|
@@ -46,7 +46,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.ErrorBoundary = void 0;
|
|
49
|
-
var
|
|
49
|
+
var hydrajs_1 = require("@cee-eng/hydrajs");
|
|
50
|
+
var utils_1 = require("@rh-support/utils");
|
|
50
51
|
var react_1 = __importStar(require("react"));
|
|
51
52
|
var ErrorBoundaryFallbackComponent_1 = require("./ErrorBoundaryFallbackComponent");
|
|
52
53
|
var ErrorBoundary = /** @class */ (function (_super) {
|
|
@@ -61,7 +62,7 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
61
62
|
return { hasError: true };
|
|
62
63
|
};
|
|
63
64
|
ErrorBoundary.prototype.componentDidCatch = function (error, errorInfo) {
|
|
64
|
-
if (
|
|
65
|
+
if (hydrajs_1.Env.isLocalEnv())
|
|
65
66
|
return;
|
|
66
67
|
var onError = this.props.onError;
|
|
67
68
|
if (typeof onError === 'function') {
|
|
@@ -74,7 +75,7 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
74
75
|
window.sessionjs.reportProblem(error, {
|
|
75
76
|
tags: {
|
|
76
77
|
portal_app: window.app || this.props.sentryAppName || 'Portal Case Management',
|
|
77
|
-
package_version:
|
|
78
|
+
package_version: utils_1.getAppVersion(),
|
|
78
79
|
},
|
|
79
80
|
});
|
|
80
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentSearch.d.ts","sourceRoot":"","sources":["../../../src/TopContentSearch/TopContentSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"TopContentSearch.d.ts","sourceRoot":"","sources":["../../../src/TopContentSearch/TopContentSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAQ5F,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,UAAU,MAAM;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,2BAA2B,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACzD,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;CAC3E;AAED,eAAO,MAAM,gBAAgB,eAAgB,MAAM,WASlD,CAAC;AAOF,wBAAgB,gBAAgB,CAAC,EAC7B,cAAmB,EACnB,2BAA6C,EAC7C,QAAQ,EACR,cAAc,EACd,mBAA2B,GAC9B,EAAE,MAAM,eA0GR"}
|
|
@@ -88,7 +88,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
88
88
|
exports.TopContentSearch = exports.getTopContentUrl = void 0;
|
|
89
89
|
require("./topContentSearch.scss");
|
|
90
90
|
var react_core_1 = require("@patternfly/react-core");
|
|
91
|
-
var api_1 = require("@rh-support/api");
|
|
92
91
|
var utils_1 = require("@rh-support/utils");
|
|
93
92
|
var js_worker_search_1 = __importStar(require("js-worker-search"));
|
|
94
93
|
var debounce_1 = __importDefault(require("lodash/debounce"));
|
|
@@ -102,7 +101,7 @@ var getTopContentUrl = function (contentUrl) {
|
|
|
102
101
|
// this adds the access.redhat.com to make them valid urls, otherwise the top content edit functionality won't work
|
|
103
102
|
// for product/versions that already have data not created by users.
|
|
104
103
|
if (contentUrl.startsWith('/')) {
|
|
105
|
-
return "https://" +
|
|
104
|
+
return "https://" + utils_1.getAccessHostname() + contentUrl;
|
|
106
105
|
}
|
|
107
106
|
return contentUrl;
|
|
108
107
|
};
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export * from './ProgressBar';
|
|
|
4
4
|
export * from './DropDownList';
|
|
5
5
|
export * from './ErrorBoundary';
|
|
6
6
|
export * from './ErrorPages';
|
|
7
|
-
export * from './ProductOnlySelector';
|
|
8
7
|
export * from './LoginModal';
|
|
9
8
|
export * from './Table';
|
|
10
9
|
export * from './MarkdownEditor';
|
|
@@ -12,7 +11,6 @@ export * from './InlineEdit';
|
|
|
12
11
|
export * from './CoverSpinner';
|
|
13
12
|
export * from './hooks';
|
|
14
13
|
export * from './Functional';
|
|
15
|
-
export * from './Input';
|
|
16
14
|
export * from './ToastNotification';
|
|
17
15
|
export * from './CustomContentLoader';
|
|
18
16
|
export * from './LanguageSelector';
|
package/lib/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -16,7 +16,6 @@ __exportStar(require("./ProgressBar"), exports);
|
|
|
16
16
|
__exportStar(require("./DropDownList"), exports);
|
|
17
17
|
__exportStar(require("./ErrorBoundary"), exports);
|
|
18
18
|
__exportStar(require("./ErrorPages"), exports);
|
|
19
|
-
__exportStar(require("./ProductOnlySelector"), exports);
|
|
20
19
|
__exportStar(require("./LoginModal"), exports);
|
|
21
20
|
__exportStar(require("./Table"), exports);
|
|
22
21
|
__exportStar(require("./MarkdownEditor"), exports);
|
|
@@ -24,7 +23,6 @@ __exportStar(require("./InlineEdit"), exports);
|
|
|
24
23
|
__exportStar(require("./CoverSpinner"), exports);
|
|
25
24
|
__exportStar(require("./hooks"), exports);
|
|
26
25
|
__exportStar(require("./Functional"), exports);
|
|
27
|
-
__exportStar(require("./Input"), exports);
|
|
28
26
|
__exportStar(require("./ToastNotification"), exports);
|
|
29
27
|
__exportStar(require("./CustomContentLoader"), exports);
|
|
30
28
|
__exportStar(require("./LanguageSelector"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAkC,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjG,UAAU,MAAM;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACtC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5D;AAED,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,kBAAkB,EAAE;YAChB,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;QACF,aAAa,EAAE;YACX,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL;CACJ;AAED,qBAAa,aAAc,SAAQ,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;gBAC5C,KAAK,KAAA;IAKjB,MAAM,CAAC,wBAAwB;;;IAK/B,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,KAAA;IAiBzC,MAAM;CAcT"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Env } from '@cee-eng/hydrajs';
|
|
2
|
+
import { getAppVersion } from '@rh-support/utils';
|
|
2
3
|
import React, { Component } from 'react';
|
|
3
4
|
import { ErrorBoundaryFallbackComponent } from './ErrorBoundaryFallbackComponent';
|
|
4
5
|
export class ErrorBoundary extends Component {
|
|
@@ -11,7 +12,7 @@ export class ErrorBoundary extends Component {
|
|
|
11
12
|
return { hasError: true };
|
|
12
13
|
}
|
|
13
14
|
componentDidCatch(error, errorInfo) {
|
|
14
|
-
if (isLocalEnv())
|
|
15
|
+
if (Env.isLocalEnv())
|
|
15
16
|
return;
|
|
16
17
|
const { onError } = this.props;
|
|
17
18
|
if (typeof onError === 'function') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentSearch.d.ts","sourceRoot":"","sources":["../../../src/TopContentSearch/TopContentSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"TopContentSearch.d.ts","sourceRoot":"","sources":["../../../src/TopContentSearch/TopContentSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAQ5F,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,UAAU,MAAM;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,2BAA2B,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACzD,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;CAC3E;AAED,eAAO,MAAM,gBAAgB,eAAgB,MAAM,WASlD,CAAC;AAOF,wBAAgB,gBAAgB,CAAC,EAC7B,cAAmB,EACnB,2BAA6C,EAC7C,QAAQ,EACR,cAAc,EACd,mBAA2B,GAC9B,EAAE,MAAM,eA0GR"}
|
|
@@ -9,8 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import './topContentSearch.scss';
|
|
11
11
|
import { SearchInput } from '@patternfly/react-core';
|
|
12
|
-
import { getAccessHostname } from '@rh-support/
|
|
13
|
-
import { dtmTrackEvent } from '@rh-support/utils';
|
|
12
|
+
import { dtmTrackEvent, getAccessHostname } from '@rh-support/utils';
|
|
14
13
|
import SearchApi, { INDEX_MODES } from 'js-worker-search';
|
|
15
14
|
import debounce from 'lodash/debounce';
|
|
16
15
|
import flatMap from 'lodash/flatMap';
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export * from './ProgressBar';
|
|
|
4
4
|
export * from './DropDownList';
|
|
5
5
|
export * from './ErrorBoundary';
|
|
6
6
|
export * from './ErrorPages';
|
|
7
|
-
export * from './ProductOnlySelector';
|
|
8
7
|
export * from './LoginModal';
|
|
9
8
|
export * from './Table';
|
|
10
9
|
export * from './MarkdownEditor';
|
|
@@ -12,7 +11,6 @@ export * from './InlineEdit';
|
|
|
12
11
|
export * from './CoverSpinner';
|
|
13
12
|
export * from './hooks';
|
|
14
13
|
export * from './Functional';
|
|
15
|
-
export * from './Input';
|
|
16
14
|
export * from './ToastNotification';
|
|
17
15
|
export * from './CustomContentLoader';
|
|
18
16
|
export * from './LanguageSelector';
|
package/lib/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -4,7 +4,6 @@ export * from './ProgressBar';
|
|
|
4
4
|
export * from './DropDownList';
|
|
5
5
|
export * from './ErrorBoundary';
|
|
6
6
|
export * from './ErrorPages';
|
|
7
|
-
export * from './ProductOnlySelector';
|
|
8
7
|
export * from './LoginModal';
|
|
9
8
|
export * from './Table';
|
|
10
9
|
export * from './MarkdownEditor';
|
|
@@ -12,7 +11,6 @@ export * from './InlineEdit';
|
|
|
12
11
|
export * from './CoverSpinner';
|
|
13
12
|
export * from './hooks';
|
|
14
13
|
export * from './Functional';
|
|
15
|
-
export * from './Input';
|
|
16
14
|
export * from './ToastNotification';
|
|
17
15
|
export * from './CustomContentLoader';
|
|
18
16
|
export * from './LanguageSelector';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.84",
|
|
4
4
|
"description": "Contains all reusabel components for support app",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"@patternfly/patternfly": "4.196.7",
|
|
58
58
|
"@patternfly/react-core": "4.202.16",
|
|
59
59
|
"@patternfly/react-table": "4.71.16",
|
|
60
|
-
"@rh-support/api": "0.3.9",
|
|
61
60
|
"@rh-support/types": "0.1.21",
|
|
62
61
|
"@rh-support/user-permissions": "0.1.46",
|
|
63
62
|
"@rh-support/utils": "0.1.45",
|
|
@@ -85,10 +84,9 @@
|
|
|
85
84
|
"@patternfly/patternfly": "4.196.7",
|
|
86
85
|
"@patternfly/react-core": "4.202.16",
|
|
87
86
|
"@patternfly/react-table": "4.71.16",
|
|
88
|
-
"@rh-support/api": "0.3.25",
|
|
89
87
|
"@rh-support/types": "0.2.0",
|
|
90
|
-
"@rh-support/user-permissions": "0.2.
|
|
91
|
-
"@rh-support/utils": "0.2.
|
|
88
|
+
"@rh-support/user-permissions": "0.2.68",
|
|
89
|
+
"@rh-support/utils": "0.2.50",
|
|
92
90
|
"@storybook/addon-a11y": "^5.3.19",
|
|
93
91
|
"@storybook/addon-actions": "^5.3.19",
|
|
94
92
|
"@storybook/addon-docs": "^5.3.19",
|
|
@@ -128,5 +126,5 @@
|
|
|
128
126
|
"not ie <= 11",
|
|
129
127
|
"not op_mini all"
|
|
130
128
|
],
|
|
131
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "d1025a2463c9e2bac873dd764a02518fbb5b5e47"
|
|
132
130
|
}
|
package/lib/cjs/Input/Input.css
DELETED
package/lib/cjs/Input/Input.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import '@patternfly/patternfly/components/Button/button.css';
|
|
2
|
-
import './Input.css';
|
|
3
|
-
import { IDClassNameProps } from '@rh-support/types/shared';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
interface IProps extends IDClassNameProps {
|
|
6
|
-
ariaLabel?: string;
|
|
7
|
-
isDisabled?: boolean;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
onChange: (input: string) => void;
|
|
10
|
-
debounce?: number;
|
|
11
|
-
hasToggleIcon?: boolean;
|
|
12
|
-
icon?: JSX.Element;
|
|
13
|
-
isSpaceAllowed?: boolean;
|
|
14
|
-
isRequired?: boolean;
|
|
15
|
-
maxLength?: number;
|
|
16
|
-
type?: string;
|
|
17
|
-
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
18
|
-
}
|
|
19
|
-
export declare const Input: (props: IProps) => JSX.Element;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,qDAAqD,CAAC;AAC7D,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,UAAU,MAAO,SAAQ,gBAAgB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;CACnF;AACD,eAAO,MAAM,KAAK,UAAW,MAAM,gBAiElC,CAAC"}
|
package/lib/cjs/Input/Input.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
33
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
34
|
-
if (!m) return o;
|
|
35
|
-
var i = m.call(o), r, ar = [], e;
|
|
36
|
-
try {
|
|
37
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
38
|
-
}
|
|
39
|
-
catch (error) { e = { error: error }; }
|
|
40
|
-
finally {
|
|
41
|
-
try {
|
|
42
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
43
|
-
}
|
|
44
|
-
finally { if (e) throw e.error; }
|
|
45
|
-
}
|
|
46
|
-
return ar;
|
|
47
|
-
};
|
|
48
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
49
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
50
|
-
};
|
|
51
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
exports.Input = void 0;
|
|
53
|
-
require("@patternfly/patternfly/components/Button/button.css");
|
|
54
|
-
require("./Input.css");
|
|
55
|
-
var react_core_1 = require("@patternfly/react-core");
|
|
56
|
-
var lodash_1 = require("lodash");
|
|
57
|
-
var debounce_1 = __importDefault(require("lodash/debounce"));
|
|
58
|
-
var react_1 = __importStar(require("react"));
|
|
59
|
-
var Input = function (props) {
|
|
60
|
-
var classname = 'input-container';
|
|
61
|
-
var _a = __read(react_1.useState(''), 2), input = _a[0], setInput = _a[1];
|
|
62
|
-
var onMultiSelect = function () { return null; };
|
|
63
|
-
var onClear = function () {
|
|
64
|
-
setInput('');
|
|
65
|
-
props.onChange('');
|
|
66
|
-
setIsInputValid('');
|
|
67
|
-
};
|
|
68
|
-
var _b = __read(react_1.useState(false), 2), isSpaceAllowedLocal = _b[0], setIsSpaceAllowedLocal = _b[1];
|
|
69
|
-
var _c = __read(react_1.useState(''), 2), isInputValid = _c[0], setIsInputValid = _c[1];
|
|
70
|
-
var validityCheck = function (event) {
|
|
71
|
-
props.isSpaceAllowed ? setIsSpaceAllowedLocal(true) : setIsSpaceAllowedLocal(false);
|
|
72
|
-
var diabledCheckForSpaceAllowed = isSpaceAllowedLocal
|
|
73
|
-
? lodash_1.isEmpty(event.target.value)
|
|
74
|
-
: lodash_1.isEmpty(event.target.value.trim());
|
|
75
|
-
if (diabledCheckForSpaceAllowed) {
|
|
76
|
-
var isValid = 'error';
|
|
77
|
-
return isValid;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
var isValid = 'success';
|
|
81
|
-
return isValid;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
var onChange = function (event) {
|
|
85
|
-
var isValid = validityCheck(event);
|
|
86
|
-
setIsInputValid(isValid);
|
|
87
|
-
debounce_1.default(function (e) {
|
|
88
|
-
if (props.isSpaceAllowed) {
|
|
89
|
-
setInput(e.target.value);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
setInput(e.target.value.trim());
|
|
93
|
-
}
|
|
94
|
-
props.onChange(e.target.value);
|
|
95
|
-
}, props.debounce || 300)(__assign({}, event));
|
|
96
|
-
event.preventDefault();
|
|
97
|
-
return [];
|
|
98
|
-
};
|
|
99
|
-
return (react_1.default.createElement(react_core_1.Select, { id: props.id, "data-tracking-id": "custom-input-component", className: props.className ? classname + " " + props.className : classname, variant: react_core_1.SelectVariant.typeahead, typeAheadAriaLabel: props.ariaLabel, type: props.type, onToggle: onMultiSelect, onSelect: onMultiSelect, onClear: onClear, onFilter: onChange, selections: input, isOpen: false, placeholderText: props.placeholder, isDisabled: props.isDisabled, toggleIcon: props.hasToggleIcon && props.icon, required: props.isRequired, maxLength: props.maxLength, children: props.children, validated: isInputValid }));
|
|
100
|
-
};
|
|
101
|
-
exports.Input = Input;
|
package/lib/cjs/Input/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Input/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
package/lib/cjs/Input/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./Input"), exports);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ISEProduct } from '@cee-eng/hydrajs/@types/models/product';
|
|
3
|
-
interface IProps {
|
|
4
|
-
products: Partial<ISEProduct>[];
|
|
5
|
-
selectedProduct: Partial<ISEProduct>;
|
|
6
|
-
onProductChange: (product: Partial<ISEProduct>) => any;
|
|
7
|
-
htmlForId: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function ProductOnlyDropdownSelector(props: IProps): JSX.Element;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=ProductOnlyDropdownSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProductOnlyDropdownSelector.d.ts","sourceRoot":"","sources":["../../../src/ProductOnlySelector/ProductOnlyDropdownSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AASpE,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eAyCxD"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
22
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
23
|
-
if (!m) return o;
|
|
24
|
-
var i = m.call(o), r, ar = [], e;
|
|
25
|
-
try {
|
|
26
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27
|
-
}
|
|
28
|
-
catch (error) { e = { error: error }; }
|
|
29
|
-
finally {
|
|
30
|
-
try {
|
|
31
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
32
|
-
}
|
|
33
|
-
finally { if (e) throw e.error; }
|
|
34
|
-
}
|
|
35
|
-
return ar;
|
|
36
|
-
};
|
|
37
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
-
};
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.ProductOnlyDropdownSelector = void 0;
|
|
42
|
-
var utils_1 = require("@rh-support/utils");
|
|
43
|
-
var isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
44
|
-
var react_1 = __importStar(require("react"));
|
|
45
|
-
var react_i18next_1 = require("react-i18next");
|
|
46
|
-
var DropDownList_1 = require("../DropDownList");
|
|
47
|
-
function ProductOnlyDropdownSelector(props) {
|
|
48
|
-
var t = react_i18next_1.useTranslation().t;
|
|
49
|
-
var _a = __read(react_1.useState(false), 2), isProductInValid = _a[0], setIsProductInValid = _a[1];
|
|
50
|
-
var onProductChange = function (option) {
|
|
51
|
-
props.onProductChange(option.value);
|
|
52
|
-
validateProduct(option);
|
|
53
|
-
};
|
|
54
|
-
var onProductClear = function () {
|
|
55
|
-
var defaultSelectedProduct = {
|
|
56
|
-
featuredVersion: '',
|
|
57
|
-
product: '',
|
|
58
|
-
versions: [],
|
|
59
|
-
isTopProduct: false,
|
|
60
|
-
isEntitledProduct: true,
|
|
61
|
-
};
|
|
62
|
-
props.onProductChange(defaultSelectedProduct);
|
|
63
|
-
validateProduct(utils_1.toOption(defaultSelectedProduct, { labelKey: 'product' }));
|
|
64
|
-
};
|
|
65
|
-
var validateProduct = function (selectedItem) {
|
|
66
|
-
setIsProductInValid(isEmpty_1.default(selectedItem) || isEmpty_1.default(selectedItem.label));
|
|
67
|
-
};
|
|
68
|
-
return (react_1.default.createElement("label", { htmlFor: props.htmlForId, className: "product-btn-flex" },
|
|
69
|
-
react_1.default.createElement(DropDownList_1.Dropdown, { className: "product-dropdown product-only", id: "products-only", placeholder: t('Select another product'), list: props.products ? utils_1.toOptions(props.products, { labelKey: 'product' }) : [], title: t("Select another product"), selectedItem: utils_1.toOption(props.selectedProduct, { labelKey: 'product' }), isInValid: isProductInValid, onChange: onProductChange, onOuterClick: validateProduct, searchable: true, onClearSelection: onProductClear })));
|
|
70
|
-
}
|
|
71
|
-
exports.ProductOnlyDropdownSelector = ProductOnlyDropdownSelector;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import './productOnlySelector.css';
|
|
3
|
-
interface IProps {
|
|
4
|
-
onProductChange: (product: string) => any;
|
|
5
|
-
}
|
|
6
|
-
export declare function ProductOnlySelector(props: IProps): JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=ProductOnlySelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProductOnlySelector.d.ts","sourceRoot":"","sources":["../../../src/ProductOnlySelector/ProductOnlySelector.tsx"],"names":[],"mappings":";AAAA,OAAO,2BAA2B,CAAC;AAkBnC,UAAU,MAAM;IACZ,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;CAC7C;AAeD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAmFhD"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
31
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
32
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
34
|
-
function step(op) {
|
|
35
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
36
|
-
while (_) try {
|
|
37
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
38
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
39
|
-
switch (op[0]) {
|
|
40
|
-
case 0: case 1: t = op; break;
|
|
41
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
42
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
43
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
44
|
-
default:
|
|
45
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
46
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
47
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
48
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
49
|
-
if (t[2]) _.ops.pop();
|
|
50
|
-
_.trys.pop(); continue;
|
|
51
|
-
}
|
|
52
|
-
op = body.call(thisArg, _);
|
|
53
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
54
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
58
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
59
|
-
if (!m) return o;
|
|
60
|
-
var i = m.call(o), r, ar = [], e;
|
|
61
|
-
try {
|
|
62
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
63
|
-
}
|
|
64
|
-
catch (error) { e = { error: error }; }
|
|
65
|
-
finally {
|
|
66
|
-
try {
|
|
67
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
68
|
-
}
|
|
69
|
-
finally { if (e) throw e.error; }
|
|
70
|
-
}
|
|
71
|
-
return ar;
|
|
72
|
-
};
|
|
73
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
74
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
75
|
-
to[j] = from[i];
|
|
76
|
-
return to;
|
|
77
|
-
};
|
|
78
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
79
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
80
|
-
};
|
|
81
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
82
|
-
exports.ProductOnlySelector = void 0;
|
|
83
|
-
require("./productOnlySelector.css");
|
|
84
|
-
var hydrajs_1 = require("@cee-eng/hydrajs");
|
|
85
|
-
var utils_1 = require("@rh-support/utils");
|
|
86
|
-
var isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
87
|
-
var react_1 = __importStar(require("react"));
|
|
88
|
-
var react_i18next_1 = require("react-i18next");
|
|
89
|
-
var AlertMessage_1 = require("../AlertMessage");
|
|
90
|
-
var LoadingIndicator_1 = require("../LoadingIndicator");
|
|
91
|
-
var ProductOnlyDropdownSelector_1 = require("./ProductOnlyDropdownSelector");
|
|
92
|
-
var initialProductResponse = {
|
|
93
|
-
topProducts: [],
|
|
94
|
-
otherProducts: [],
|
|
95
|
-
productsResult: [],
|
|
96
|
-
};
|
|
97
|
-
var defaultSelectedProduct = {
|
|
98
|
-
featuredVersion: '',
|
|
99
|
-
product: '',
|
|
100
|
-
versions: [],
|
|
101
|
-
isTopProduct: false,
|
|
102
|
-
isEntitledProduct: true,
|
|
103
|
-
};
|
|
104
|
-
function ProductOnlySelector(props) {
|
|
105
|
-
var _this = this;
|
|
106
|
-
var t = react_i18next_1.useTranslation().t;
|
|
107
|
-
var _a = __read(react_1.useState(utils_1.getApiResourceObject(initialProductResponse)), 2), allProducts = _a[0], setAllProducts = _a[1];
|
|
108
|
-
react_1.useEffect(function () {
|
|
109
|
-
var fetchProducts = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
110
|
-
var response, allProducts_1, e_1;
|
|
111
|
-
return __generator(this, function (_a) {
|
|
112
|
-
switch (_a.label) {
|
|
113
|
-
case 0:
|
|
114
|
-
_a.trys.push([0, 2, , 3]);
|
|
115
|
-
setAllProducts(utils_1.getApiResourceObject(initialProductResponse, true));
|
|
116
|
-
return [4 /*yield*/, hydrajs_1.products.getSEProductsList()];
|
|
117
|
-
case 1:
|
|
118
|
-
response = _a.sent();
|
|
119
|
-
allProducts_1 = utils_1.handleProductSearchResponse(response);
|
|
120
|
-
setAllProducts(utils_1.getApiResourceObject(allProducts_1));
|
|
121
|
-
return [3 /*break*/, 3];
|
|
122
|
-
case 2:
|
|
123
|
-
e_1 = _a.sent();
|
|
124
|
-
setAllProducts(utils_1.getApiResourceObject(initialProductResponse, false, true, e_1.message));
|
|
125
|
-
return [3 /*break*/, 3];
|
|
126
|
-
case 3: return [2 /*return*/];
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}); };
|
|
130
|
-
if (utils_1.haventLoadedMetadata(allProducts, function (data) { return isEmpty_1.default(data.productsResult); }))
|
|
131
|
-
fetchProducts();
|
|
132
|
-
}, [allProducts]);
|
|
133
|
-
var productChanged = function (product) {
|
|
134
|
-
props.onProductChange(product);
|
|
135
|
-
};
|
|
136
|
-
var productClicked = function (selectedProduct) { return function () {
|
|
137
|
-
productChanged(selectedProduct);
|
|
138
|
-
}; };
|
|
139
|
-
function onProductChangeForOtherProducts(selectedProduct) {
|
|
140
|
-
productChanged(selectedProduct.product);
|
|
141
|
-
}
|
|
142
|
-
function renderItem(id, selectedProduct) {
|
|
143
|
-
if (Array.isArray(selectedProduct)) {
|
|
144
|
-
return (react_1.default.createElement(ProductOnlyDropdownSelector_1.ProductOnlyDropdownSelector, { htmlForId: id, key: id, products: selectedProduct, selectedProduct: defaultSelectedProduct, onProductChange: onProductChangeForOtherProducts }));
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
var uniqueID = selectedProduct.product.replace(/\s+/g, '-').replace('.', '').toLowerCase();
|
|
148
|
-
return (react_1.default.createElement("button", { key: uniqueID, className: "btn product-btn product-btn-flex", onClick: productClicked(selectedProduct.product) }, selectedProduct.product));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
152
|
-
react_1.default.createElement(LoadingIndicator_1.LoadingIndicator, { show: allProducts.isFetching, size: "lg" }),
|
|
153
|
-
react_1.default.createElement(AlertMessage_1.AlertMessage, { variant: AlertMessage_1.AlertType.DANGER, className: "push-top", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
154
|
-
!isEmpty_1.default(allProducts.data.topProducts) && (react_1.default.createElement("div", null,
|
|
155
|
-
react_1.default.createElement("h2", null,
|
|
156
|
-
react_1.default.createElement(react_i18next_1.Trans, null, "Troubleshoot a product issue")),
|
|
157
|
-
react_1.default.createElement("div", { className: "product-dropdown rh-l-grid rh-m-gutters rh-m-all-6-col-on-sm push-top-narrow", "data-cp-grid": "md-2-cols" }, __spreadArray(__spreadArray([], __read(allProducts.data.topProducts)), [allProducts.data.otherProducts]).map(function (item, i) {
|
|
158
|
-
if (Array.isArray(item) && item.length === 0) {
|
|
159
|
-
return null;
|
|
160
|
-
}
|
|
161
|
-
return renderItem("product-selector-" + i, item);
|
|
162
|
-
}))))));
|
|
163
|
-
}
|
|
164
|
-
exports.ProductOnlySelector = ProductOnlySelector;
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ProductOnlySelector/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./ProductOnlySelector"), exports);
|
|
14
|
-
__exportStar(require("./ProductOnlyDropdownSelector"), exports);
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
.subheading {
|
|
2
|
-
font-weight: 600;
|
|
3
|
-
font-size: 13.5px;
|
|
4
|
-
color: #333;
|
|
5
|
-
letter-spacing: 0.25px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
h3.subheading-sm {
|
|
9
|
-
font-size: 14px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
h2 {
|
|
13
|
-
margin-bottom: 4px;
|
|
14
|
-
margin-top: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
h2 label {
|
|
18
|
-
margin-bottom: 0;
|
|
19
|
-
font-weight: 600;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
a[target='_blank']::after {
|
|
23
|
-
content: ' ' !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
a[target='_blank'].show-target::after {
|
|
27
|
-
content: '\27' !important;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
button.btn-app {
|
|
31
|
-
padding: 6px 30px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.pull-top-x-wide {
|
|
35
|
-
margin-top: -110px !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.push-top-x-wide {
|
|
39
|
-
margin-top: 75px !important;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* product selector */
|
|
43
|
-
|
|
44
|
-
.product-btn,
|
|
45
|
-
.product-box {
|
|
46
|
-
-ms-flex: 1 0 82%;
|
|
47
|
-
flex: 1 0 82%;
|
|
48
|
-
width: 100%;
|
|
49
|
-
padding: 1em 1.2em 1.1em;
|
|
50
|
-
background-color: #ededed;
|
|
51
|
-
border: none;
|
|
52
|
-
border-left: 2px solid #06c;
|
|
53
|
-
font-size: 0.93rem;
|
|
54
|
-
text-align: left;
|
|
55
|
-
font-weight: 500;
|
|
56
|
-
line-height: 1.45;
|
|
57
|
-
color: #252525;
|
|
58
|
-
text-transform: capitalize;
|
|
59
|
-
-webkit-font-smoothing: subpixel-antialiased;
|
|
60
|
-
letter-spacing: 0.3px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.product-btn-flex {
|
|
64
|
-
-ms-flex: 1 0 82%;
|
|
65
|
-
flex: 1 0 82%;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.product-btn:hover,
|
|
69
|
-
.product-btn:focus,
|
|
70
|
-
.product-btn:hover + .v-dropdown .btn-dropdown,
|
|
71
|
-
.product-btn:focus + .v-dropdown .btn-dropdown,
|
|
72
|
-
.v-dropdown .btn-dropdown:hover,
|
|
73
|
-
.v-dropdown .btn-dropdown:focus {
|
|
74
|
-
background-color: #007cbc;
|
|
75
|
-
border: none;
|
|
76
|
-
color: #fff;
|
|
77
|
-
outline: none;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.product-btn:hover,
|
|
81
|
-
.product-btn:focus {
|
|
82
|
-
border-left: 2px solid #007cbc;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.v-dropdown .btn-dropdown:hover,
|
|
86
|
-
.v-dropdown .btn-dropdown:focus {
|
|
87
|
-
border-left: 1px solid #007cbc;
|
|
88
|
-
transition-duration: 0.3s;
|
|
89
|
-
transition-property: border;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.product-btn:focus {
|
|
93
|
-
outline: none;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.product-btn:hover + .v-dropdown .btn-dropdown,
|
|
97
|
-
.product-btn:focus + .v-dropdown .btn-dropdown {
|
|
98
|
-
border-left: 1px solid #ededed !important;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@media (min-width: 768px) {
|
|
102
|
-
.product-btn-flex {
|
|
103
|
-
-ms-flex: 1 0 78%;
|
|
104
|
-
flex: 1 0 78%;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.v-dropdown {
|
|
108
|
-
-ms-flex: 1 0 22%;
|
|
109
|
-
flex: 1 0 22%;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.version-text {
|
|
113
|
-
text-transform: uppercase;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.v-dropdown .btn-dropdown .prodversion {
|
|
117
|
-
margin-left: 0.3em;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/* selected product + search */
|
|
122
|
-
|
|
123
|
-
.product-selected {
|
|
124
|
-
margin-top: 0;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.product-selected .searchField {
|
|
128
|
-
border-color: #ccc;
|
|
129
|
-
height: 42px;
|
|
130
|
-
padding-top: 4.5px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.product-selected span.icon-remove {
|
|
134
|
-
float: right;
|
|
135
|
-
position: relative;
|
|
136
|
-
right: -0.5em;
|
|
137
|
-
top: -0.5em;
|
|
138
|
-
padding: 0.5em;
|
|
139
|
-
font-size: 1.2em;
|
|
140
|
-
line-height: 1.38;
|
|
141
|
-
cursor: pointer;
|
|
142
|
-
height: 100%;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.product-selected .selectedProduct {
|
|
146
|
-
padding: 0.8em;
|
|
147
|
-
color: #333;
|
|
148
|
-
text-align: left;
|
|
149
|
-
background-color: #f0f0f0;
|
|
150
|
-
word-wrap: break-word;
|
|
151
|
-
margin-bottom: 25px;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.product-only .downshift-search input {
|
|
155
|
-
padding: 1em 0.75em;
|
|
156
|
-
}
|
package/lib/esm/Input/Input.css
DELETED
package/lib/esm/Input/Input.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import '@patternfly/patternfly/components/Button/button.css';
|
|
2
|
-
import './Input.css';
|
|
3
|
-
import { IDClassNameProps } from '@rh-support/types/shared';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
interface IProps extends IDClassNameProps {
|
|
6
|
-
ariaLabel?: string;
|
|
7
|
-
isDisabled?: boolean;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
onChange: (input: string) => void;
|
|
10
|
-
debounce?: number;
|
|
11
|
-
hasToggleIcon?: boolean;
|
|
12
|
-
icon?: JSX.Element;
|
|
13
|
-
isSpaceAllowed?: boolean;
|
|
14
|
-
isRequired?: boolean;
|
|
15
|
-
maxLength?: number;
|
|
16
|
-
type?: string;
|
|
17
|
-
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
18
|
-
}
|
|
19
|
-
export declare const Input: (props: IProps) => JSX.Element;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,qDAAqD,CAAC;AAC7D,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,UAAU,MAAO,SAAQ,gBAAgB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;CACnF;AACD,eAAO,MAAM,KAAK,UAAW,MAAM,gBAiElC,CAAC"}
|
package/lib/esm/Input/Input.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import '@patternfly/patternfly/components/Button/button.css';
|
|
2
|
-
import './Input.css';
|
|
3
|
-
import { Select, SelectVariant } from '@patternfly/react-core';
|
|
4
|
-
import { isEmpty } from 'lodash';
|
|
5
|
-
import debounce from 'lodash/debounce';
|
|
6
|
-
import React, { useState } from 'react';
|
|
7
|
-
export const Input = (props) => {
|
|
8
|
-
const classname = 'input-container';
|
|
9
|
-
const [input, setInput] = useState('');
|
|
10
|
-
const onMultiSelect = () => null;
|
|
11
|
-
const onClear = () => {
|
|
12
|
-
setInput('');
|
|
13
|
-
props.onChange('');
|
|
14
|
-
setIsInputValid('');
|
|
15
|
-
};
|
|
16
|
-
const [isSpaceAllowedLocal, setIsSpaceAllowedLocal] = useState(false);
|
|
17
|
-
const [isInputValid, setIsInputValid] = useState('');
|
|
18
|
-
const validityCheck = (event) => {
|
|
19
|
-
props.isSpaceAllowed ? setIsSpaceAllowedLocal(true) : setIsSpaceAllowedLocal(false);
|
|
20
|
-
const diabledCheckForSpaceAllowed = isSpaceAllowedLocal
|
|
21
|
-
? isEmpty(event.target.value)
|
|
22
|
-
: isEmpty(event.target.value.trim());
|
|
23
|
-
if (diabledCheckForSpaceAllowed) {
|
|
24
|
-
let isValid = 'error';
|
|
25
|
-
return isValid;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
let isValid = 'success';
|
|
29
|
-
return isValid;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const onChange = (event) => {
|
|
33
|
-
const isValid = validityCheck(event);
|
|
34
|
-
setIsInputValid(isValid);
|
|
35
|
-
debounce((e) => {
|
|
36
|
-
if (props.isSpaceAllowed) {
|
|
37
|
-
setInput(e.target.value);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
setInput(e.target.value.trim());
|
|
41
|
-
}
|
|
42
|
-
props.onChange(e.target.value);
|
|
43
|
-
}, props.debounce || 300)(Object.assign({}, event));
|
|
44
|
-
event.preventDefault();
|
|
45
|
-
return [];
|
|
46
|
-
};
|
|
47
|
-
return (React.createElement(Select, { id: props.id, "data-tracking-id": "custom-input-component", className: props.className ? `${classname} ${props.className}` : classname, variant: SelectVariant.typeahead, typeAheadAriaLabel: props.ariaLabel, type: props.type, onToggle: onMultiSelect, onSelect: onMultiSelect, onClear: onClear, onFilter: onChange, selections: input, isOpen: false, placeholderText: props.placeholder, isDisabled: props.isDisabled, toggleIcon: props.hasToggleIcon && props.icon, required: props.isRequired, maxLength: props.maxLength, children: props.children, validated: isInputValid }));
|
|
48
|
-
};
|
package/lib/esm/Input/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Input/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
package/lib/esm/Input/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Input';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ISEProduct } from '@cee-eng/hydrajs/@types/models/product';
|
|
3
|
-
interface IProps {
|
|
4
|
-
products: Partial<ISEProduct>[];
|
|
5
|
-
selectedProduct: Partial<ISEProduct>;
|
|
6
|
-
onProductChange: (product: Partial<ISEProduct>) => any;
|
|
7
|
-
htmlForId: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function ProductOnlyDropdownSelector(props: IProps): JSX.Element;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=ProductOnlyDropdownSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProductOnlyDropdownSelector.d.ts","sourceRoot":"","sources":["../../../src/ProductOnlySelector/ProductOnlyDropdownSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AASpE,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eAyCxD"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { toOption, toOptions } from '@rh-support/utils';
|
|
2
|
-
import isEmpty from 'lodash/isEmpty';
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { Dropdown } from '../DropDownList';
|
|
6
|
-
export function ProductOnlyDropdownSelector(props) {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
const [isProductInValid, setIsProductInValid] = useState(false);
|
|
9
|
-
const onProductChange = (option) => {
|
|
10
|
-
props.onProductChange(option.value);
|
|
11
|
-
validateProduct(option);
|
|
12
|
-
};
|
|
13
|
-
const onProductClear = () => {
|
|
14
|
-
const defaultSelectedProduct = {
|
|
15
|
-
featuredVersion: '',
|
|
16
|
-
product: '',
|
|
17
|
-
versions: [],
|
|
18
|
-
isTopProduct: false,
|
|
19
|
-
isEntitledProduct: true,
|
|
20
|
-
};
|
|
21
|
-
props.onProductChange(defaultSelectedProduct);
|
|
22
|
-
validateProduct(toOption(defaultSelectedProduct, { labelKey: 'product' }));
|
|
23
|
-
};
|
|
24
|
-
const validateProduct = (selectedItem) => {
|
|
25
|
-
setIsProductInValid(isEmpty(selectedItem) || isEmpty(selectedItem.label));
|
|
26
|
-
};
|
|
27
|
-
return (React.createElement("label", { htmlFor: props.htmlForId, className: "product-btn-flex" },
|
|
28
|
-
React.createElement(Dropdown, { className: `product-dropdown product-only`, id: "products-only", placeholder: t('Select another product'), list: props.products ? toOptions(props.products, { labelKey: 'product' }) : [], title: t(`Select another product`), selectedItem: toOption(props.selectedProduct, { labelKey: 'product' }), isInValid: isProductInValid, onChange: onProductChange, onOuterClick: validateProduct, searchable: true, onClearSelection: onProductClear })));
|
|
29
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import './productOnlySelector.css';
|
|
3
|
-
interface IProps {
|
|
4
|
-
onProductChange: (product: string) => any;
|
|
5
|
-
}
|
|
6
|
-
export declare function ProductOnlySelector(props: IProps): JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=ProductOnlySelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProductOnlySelector.d.ts","sourceRoot":"","sources":["../../../src/ProductOnlySelector/ProductOnlySelector.tsx"],"names":[],"mappings":";AAAA,OAAO,2BAA2B,CAAC;AAkBnC,UAAU,MAAM;IACZ,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;CAC7C;AAeD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAmFhD"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import './productOnlySelector.css';
|
|
11
|
-
import { products } from '@cee-eng/hydrajs';
|
|
12
|
-
import { getApiResourceObject, handleProductSearchResponse, haventLoadedMetadata, } from '@rh-support/utils';
|
|
13
|
-
import isEmpty from 'lodash/isEmpty';
|
|
14
|
-
import React, { useEffect, useState } from 'react';
|
|
15
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
16
|
-
import { AlertMessage, AlertType } from '../AlertMessage';
|
|
17
|
-
import { LoadingIndicator } from '../LoadingIndicator';
|
|
18
|
-
import { ProductOnlyDropdownSelector } from './ProductOnlyDropdownSelector';
|
|
19
|
-
const initialProductResponse = {
|
|
20
|
-
topProducts: [],
|
|
21
|
-
otherProducts: [],
|
|
22
|
-
productsResult: [],
|
|
23
|
-
};
|
|
24
|
-
const defaultSelectedProduct = {
|
|
25
|
-
featuredVersion: '',
|
|
26
|
-
product: '',
|
|
27
|
-
versions: [],
|
|
28
|
-
isTopProduct: false,
|
|
29
|
-
isEntitledProduct: true,
|
|
30
|
-
};
|
|
31
|
-
export function ProductOnlySelector(props) {
|
|
32
|
-
const { t } = useTranslation();
|
|
33
|
-
const [allProducts, setAllProducts] = useState(getApiResourceObject(initialProductResponse));
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
const fetchProducts = () => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
try {
|
|
37
|
-
setAllProducts(getApiResourceObject(initialProductResponse, true));
|
|
38
|
-
const response = yield products.getSEProductsList();
|
|
39
|
-
const allProducts = handleProductSearchResponse(response);
|
|
40
|
-
setAllProducts(getApiResourceObject(allProducts));
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
setAllProducts(getApiResourceObject(initialProductResponse, false, true, e.message));
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
if (haventLoadedMetadata(allProducts, (data) => isEmpty(data.productsResult)))
|
|
47
|
-
fetchProducts();
|
|
48
|
-
}, [allProducts]);
|
|
49
|
-
const productChanged = (product) => {
|
|
50
|
-
props.onProductChange(product);
|
|
51
|
-
};
|
|
52
|
-
const productClicked = (selectedProduct) => () => {
|
|
53
|
-
productChanged(selectedProduct);
|
|
54
|
-
};
|
|
55
|
-
function onProductChangeForOtherProducts(selectedProduct) {
|
|
56
|
-
productChanged(selectedProduct.product);
|
|
57
|
-
}
|
|
58
|
-
function renderItem(id, selectedProduct) {
|
|
59
|
-
if (Array.isArray(selectedProduct)) {
|
|
60
|
-
return (React.createElement(ProductOnlyDropdownSelector, { htmlForId: id, key: id, products: selectedProduct, selectedProduct: defaultSelectedProduct, onProductChange: onProductChangeForOtherProducts }));
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
const uniqueID = selectedProduct.product.replace(/\s+/g, '-').replace('.', '').toLowerCase();
|
|
64
|
-
return (React.createElement("button", { key: uniqueID, className: "btn product-btn product-btn-flex", onClick: productClicked(selectedProduct.product) }, selectedProduct.product));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return (React.createElement(React.Fragment, null,
|
|
68
|
-
React.createElement(LoadingIndicator, { show: allProducts.isFetching, size: "lg" }),
|
|
69
|
-
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "push-top", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
70
|
-
!isEmpty(allProducts.data.topProducts) && (React.createElement("div", null,
|
|
71
|
-
React.createElement("h2", null,
|
|
72
|
-
React.createElement(Trans, null, "Troubleshoot a product issue")),
|
|
73
|
-
React.createElement("div", { className: "product-dropdown rh-l-grid rh-m-gutters rh-m-all-6-col-on-sm push-top-narrow", "data-cp-grid": "md-2-cols" }, [...allProducts.data.topProducts, allProducts.data.otherProducts].map((item, i) => {
|
|
74
|
-
if (Array.isArray(item) && item.length === 0) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
return renderItem(`product-selector-${i}`, item);
|
|
78
|
-
}))))));
|
|
79
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ProductOnlySelector/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC"}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
.subheading {
|
|
2
|
-
font-weight: 600;
|
|
3
|
-
font-size: 13.5px;
|
|
4
|
-
color: #333;
|
|
5
|
-
letter-spacing: 0.25px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
h3.subheading-sm {
|
|
9
|
-
font-size: 14px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
h2 {
|
|
13
|
-
margin-bottom: 4px;
|
|
14
|
-
margin-top: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
h2 label {
|
|
18
|
-
margin-bottom: 0;
|
|
19
|
-
font-weight: 600;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
a[target='_blank']::after {
|
|
23
|
-
content: ' ' !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
a[target='_blank'].show-target::after {
|
|
27
|
-
content: '\27' !important;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
button.btn-app {
|
|
31
|
-
padding: 6px 30px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.pull-top-x-wide {
|
|
35
|
-
margin-top: -110px !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.push-top-x-wide {
|
|
39
|
-
margin-top: 75px !important;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* product selector */
|
|
43
|
-
|
|
44
|
-
.product-btn,
|
|
45
|
-
.product-box {
|
|
46
|
-
-ms-flex: 1 0 82%;
|
|
47
|
-
flex: 1 0 82%;
|
|
48
|
-
width: 100%;
|
|
49
|
-
padding: 1em 1.2em 1.1em;
|
|
50
|
-
background-color: #ededed;
|
|
51
|
-
border: none;
|
|
52
|
-
border-left: 2px solid #06c;
|
|
53
|
-
font-size: 0.93rem;
|
|
54
|
-
text-align: left;
|
|
55
|
-
font-weight: 500;
|
|
56
|
-
line-height: 1.45;
|
|
57
|
-
color: #252525;
|
|
58
|
-
text-transform: capitalize;
|
|
59
|
-
-webkit-font-smoothing: subpixel-antialiased;
|
|
60
|
-
letter-spacing: 0.3px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.product-btn-flex {
|
|
64
|
-
-ms-flex: 1 0 82%;
|
|
65
|
-
flex: 1 0 82%;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.product-btn:hover,
|
|
69
|
-
.product-btn:focus,
|
|
70
|
-
.product-btn:hover + .v-dropdown .btn-dropdown,
|
|
71
|
-
.product-btn:focus + .v-dropdown .btn-dropdown,
|
|
72
|
-
.v-dropdown .btn-dropdown:hover,
|
|
73
|
-
.v-dropdown .btn-dropdown:focus {
|
|
74
|
-
background-color: #007cbc;
|
|
75
|
-
border: none;
|
|
76
|
-
color: #fff;
|
|
77
|
-
outline: none;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.product-btn:hover,
|
|
81
|
-
.product-btn:focus {
|
|
82
|
-
border-left: 2px solid #007cbc;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.v-dropdown .btn-dropdown:hover,
|
|
86
|
-
.v-dropdown .btn-dropdown:focus {
|
|
87
|
-
border-left: 1px solid #007cbc;
|
|
88
|
-
transition-duration: 0.3s;
|
|
89
|
-
transition-property: border;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.product-btn:focus {
|
|
93
|
-
outline: none;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.product-btn:hover + .v-dropdown .btn-dropdown,
|
|
97
|
-
.product-btn:focus + .v-dropdown .btn-dropdown {
|
|
98
|
-
border-left: 1px solid #ededed !important;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@media (min-width: 768px) {
|
|
102
|
-
.product-btn-flex {
|
|
103
|
-
-ms-flex: 1 0 78%;
|
|
104
|
-
flex: 1 0 78%;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.v-dropdown {
|
|
108
|
-
-ms-flex: 1 0 22%;
|
|
109
|
-
flex: 1 0 22%;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.version-text {
|
|
113
|
-
text-transform: uppercase;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.v-dropdown .btn-dropdown .prodversion {
|
|
117
|
-
margin-left: 0.3em;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/* selected product + search */
|
|
122
|
-
|
|
123
|
-
.product-selected {
|
|
124
|
-
margin-top: 0;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.product-selected .searchField {
|
|
128
|
-
border-color: #ccc;
|
|
129
|
-
height: 42px;
|
|
130
|
-
padding-top: 4.5px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.product-selected span.icon-remove {
|
|
134
|
-
float: right;
|
|
135
|
-
position: relative;
|
|
136
|
-
right: -0.5em;
|
|
137
|
-
top: -0.5em;
|
|
138
|
-
padding: 0.5em;
|
|
139
|
-
font-size: 1.2em;
|
|
140
|
-
line-height: 1.38;
|
|
141
|
-
cursor: pointer;
|
|
142
|
-
height: 100%;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.product-selected .selectedProduct {
|
|
146
|
-
padding: 0.8em;
|
|
147
|
-
color: #333;
|
|
148
|
-
text-align: left;
|
|
149
|
-
background-color: #f0f0f0;
|
|
150
|
-
word-wrap: break-word;
|
|
151
|
-
margin-bottom: 25px;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.product-only .downshift-search input {
|
|
155
|
-
padding: 1em 0.75em;
|
|
156
|
-
}
|