@redhat-cloud-services/frontend-components-advisor-components 1.0.0
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/README.md +22 -0
- package/RebootRequired/RebootRequired.css +16 -0
- package/RebootRequired/RebootRequired.d.ts +9 -0
- package/RebootRequired/RebootRequired.js +18 -0
- package/RebootRequired/RebootRequired.js.map +1 -0
- package/RebootRequired/RebootRequired.scss +19 -0
- package/RebootRequired/index.d.ts +2 -0
- package/RebootRequired/index.js +20 -0
- package/RebootRequired/index.js.map +1 -0
- package/RebootRequired/package.json +1 -0
- package/RuleDescription/RuleDescription.css +4 -0
- package/RuleDescription/RuleDescription.d.ts +10 -0
- package/RuleDescription/RuleDescription.js +18 -0
- package/RuleDescription/RuleDescription.js.map +1 -0
- package/RuleDescription/RuleDescription.scss +6 -0
- package/RuleDescription/index.d.ts +2 -0
- package/RuleDescription/index.js +20 -0
- package/RuleDescription/index.js.map +1 -0
- package/RuleDescription/package.json +1 -0
- package/RuleDetails/RuleDetails.css +16 -0
- package/RuleDetails/RuleDetails.d.ts +37 -0
- package/RuleDetails/RuleDetails.js +76 -0
- package/RuleDetails/RuleDetails.js.map +1 -0
- package/RuleDetails/RuleDetails.scss +16 -0
- package/RuleDetails/index.d.ts +2 -0
- package/RuleDetails/index.js +20 -0
- package/RuleDetails/index.js.map +1 -0
- package/RuleDetails/package.json +1 -0
- package/RuleRating/RuleRating.css +14 -0
- package/RuleRating/RuleRating.d.ts +12 -0
- package/RuleRating/RuleRating.js +56 -0
- package/RuleRating/RuleRating.js.map +1 -0
- package/RuleRating/RuleRating.scss +14 -0
- package/RuleRating/index.d.ts +2 -0
- package/RuleRating/index.js +20 -0
- package/RuleRating/index.js.map +1 -0
- package/RuleRating/package.json +1 -0
- package/ViewAffectedLink/ViewAffectedLink.d.ts +11 -0
- package/ViewAffectedLink/ViewAffectedLink.js +16 -0
- package/ViewAffectedLink/ViewAffectedLink.js.map +1 -0
- package/ViewAffectedLink/index.d.ts +2 -0
- package/ViewAffectedLink/index.js +20 -0
- package/ViewAffectedLink/index.js.map +1 -0
- package/ViewAffectedLink/package.json +1 -0
- package/common.d.ts +3 -0
- package/common.js +24 -0
- package/common.js.map +1 -0
- package/constants.d.ts +26 -0
- package/constants.js +51 -0
- package/constants.js.map +1 -0
- package/esm/RebootRequired/RebootRequired.css +16 -0
- package/esm/RebootRequired/RebootRequired.js +13 -0
- package/esm/RebootRequired/RebootRequired.js.map +1 -0
- package/esm/RebootRequired/RebootRequired.scss +19 -0
- package/esm/RebootRequired/index.js +3 -0
- package/esm/RebootRequired/index.js.map +1 -0
- package/esm/RuleDescription/RuleDescription.css +4 -0
- package/esm/RuleDescription/RuleDescription.js +13 -0
- package/esm/RuleDescription/RuleDescription.js.map +1 -0
- package/esm/RuleDescription/RuleDescription.scss +6 -0
- package/esm/RuleDescription/index.js +3 -0
- package/esm/RuleDescription/index.js.map +1 -0
- package/esm/RuleDetails/RuleDetails.css +16 -0
- package/esm/RuleDetails/RuleDetails.js +71 -0
- package/esm/RuleDetails/RuleDetails.js.map +1 -0
- package/esm/RuleDetails/RuleDetails.scss +16 -0
- package/esm/RuleDetails/index.js +3 -0
- package/esm/RuleDetails/index.js.map +1 -0
- package/esm/RuleRating/RuleRating.css +14 -0
- package/esm/RuleRating/RuleRating.js +32 -0
- package/esm/RuleRating/RuleRating.js.map +1 -0
- package/esm/RuleRating/RuleRating.scss +14 -0
- package/esm/RuleRating/index.js +3 -0
- package/esm/RuleRating/index.js.map +1 -0
- package/esm/ViewAffectedLink/ViewAffectedLink.js +11 -0
- package/esm/ViewAffectedLink/ViewAffectedLink.js.map +1 -0
- package/esm/ViewAffectedLink/index.js +3 -0
- package/esm/ViewAffectedLink/index.js.map +1 -0
- package/esm/common.js +16 -0
- package/esm/common.js.map +1 -0
- package/esm/constants.js +44 -0
- package/esm/constants.js.map +1 -0
- package/esm/index.js +7 -0
- package/esm/index.js.map +1 -0
- package/esm/types.js +6 -0
- package/esm/types.js.map +1 -0
- package/index.d.ts +6 -0
- package/index.js +19 -0
- package/index.js.map +1 -0
- package/package.json +43 -0
- package/tsconfig.cjs.json +8 -0
- package/types.d.ts +68 -0
- package/types.js +9 -0
- package/types.js.map +1 -0
package/common.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.topicLinks = exports.barDividedList = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var compact_1 = __importDefault(require("lodash/compact"));
|
|
9
|
+
var intersection_1 = __importDefault(require("lodash/intersection"));
|
|
10
|
+
var barDividedList = function (list) {
|
|
11
|
+
return list.map(function (element, index) { return (react_1.default.createElement(react_1.default.Fragment, { key: index },
|
|
12
|
+
element,
|
|
13
|
+
index + 1 !== list.length && react_1.default.createElement("strong", { className: "verticalDivider" }, "\u00A0|\u00A0"))); });
|
|
14
|
+
};
|
|
15
|
+
exports.barDividedList = barDividedList;
|
|
16
|
+
var topicLinks = function (rule, topics, Link) {
|
|
17
|
+
return topics
|
|
18
|
+
? (0, compact_1.default)(topics.map(function (topic) {
|
|
19
|
+
return (0, intersection_1.default)(topic.tag.split(' '), rule.tags.split(' ')).length && (react_1.default.createElement(Link, { key: topic.slug, to: "/topics/".concat(topic.slug) }, "".concat(topic.name)));
|
|
20
|
+
}))
|
|
21
|
+
: [];
|
|
22
|
+
};
|
|
23
|
+
exports.topicLinks = topicLinks;
|
|
24
|
+
//# sourceMappingURL=common.js.map
|
package/common.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["src/common.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAC1B,2DAAqC;AACrC,qEAA+C;AAKxC,IAAM,cAAc,GAAG,UAAC,IAAmB;IAChD,OAAA,IAAI,CAAC,GAAG,CAAC,UAAC,OAAO,EAAE,KAAK,IAAK,OAAA,CAC3B,8BAAC,eAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK;QACvB,OAAO;QACP,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,0CAAQ,SAAS,EAAC,iBAAiB,oBAA4B,CAC9E,CAClB,EAL4B,CAK5B,CAAC;AALF,CAKE,CAAC;AANQ,QAAA,cAAc,kBAMtB;AAEE,IAAM,UAAU,GAAG,UAAC,IAAqB,EAAE,MAAmB,EAAE,IAAS;IAC9E,OAAA,MAAM;QACJ,CAAC,CAAC,IAAA,iBAAO,EACL,MAAM,CAAC,GAAG,CACR,UAAC,KAAK;YACJ,OAAA,IAAA,sBAAY,EAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,CACjE,8BAAC,IAAI,IAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,kBAAW,KAAK,CAAC,IAAI,CAAE,IAAG,UAAG,KAAK,CAAC,IAAI,CAAE,CAAQ,CAC7E;QAFD,CAEC,CACJ,CACF;QACH,CAAC,CAAC,EAAE;AATN,CASM,CAAC;AAVI,QAAA,UAAU,cAUd"}
|
package/constants.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const TOTAL_RISK_LABEL_KEY: {
|
|
2
|
+
1: string;
|
|
3
|
+
2: string;
|
|
4
|
+
3: string;
|
|
5
|
+
4: string;
|
|
6
|
+
};
|
|
7
|
+
declare const LIKELIHOOD_LABEL_KEY: {
|
|
8
|
+
1: string;
|
|
9
|
+
2: string;
|
|
10
|
+
3: string;
|
|
11
|
+
4: string;
|
|
12
|
+
};
|
|
13
|
+
declare const IMPACT_LABEL_KEY: {
|
|
14
|
+
1: string;
|
|
15
|
+
2: string;
|
|
16
|
+
3: string;
|
|
17
|
+
4: string;
|
|
18
|
+
};
|
|
19
|
+
declare const RISK_OF_CHANGE_LABEL_KEY: {
|
|
20
|
+
1: string;
|
|
21
|
+
2: string;
|
|
22
|
+
3: string;
|
|
23
|
+
4: string;
|
|
24
|
+
};
|
|
25
|
+
declare const RuleDetailsMessagesKeys: string[];
|
|
26
|
+
export { TOTAL_RISK_LABEL_KEY, LIKELIHOOD_LABEL_KEY, IMPACT_LABEL_KEY, RISK_OF_CHANGE_LABEL_KEY, RuleDetailsMessagesKeys };
|
package/constants.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuleDetailsMessagesKeys = exports.RISK_OF_CHANGE_LABEL_KEY = exports.IMPACT_LABEL_KEY = exports.LIKELIHOOD_LABEL_KEY = exports.TOTAL_RISK_LABEL_KEY = void 0;
|
|
4
|
+
var TOTAL_RISK_LABEL_KEY = {
|
|
5
|
+
1: 'low',
|
|
6
|
+
2: 'moderate',
|
|
7
|
+
3: 'important',
|
|
8
|
+
4: 'critical',
|
|
9
|
+
};
|
|
10
|
+
exports.TOTAL_RISK_LABEL_KEY = TOTAL_RISK_LABEL_KEY;
|
|
11
|
+
var LIKELIHOOD_LABEL_KEY = {
|
|
12
|
+
1: 'low',
|
|
13
|
+
2: 'medium',
|
|
14
|
+
3: 'high',
|
|
15
|
+
4: 'critical',
|
|
16
|
+
};
|
|
17
|
+
exports.LIKELIHOOD_LABEL_KEY = LIKELIHOOD_LABEL_KEY;
|
|
18
|
+
var IMPACT_LABEL_KEY = {
|
|
19
|
+
1: 'low',
|
|
20
|
+
2: 'medium',
|
|
21
|
+
3: 'high',
|
|
22
|
+
4: 'critical',
|
|
23
|
+
};
|
|
24
|
+
exports.IMPACT_LABEL_KEY = IMPACT_LABEL_KEY;
|
|
25
|
+
var RISK_OF_CHANGE_LABEL_KEY = {
|
|
26
|
+
1: 'veryLow',
|
|
27
|
+
2: 'low',
|
|
28
|
+
3: 'moderate',
|
|
29
|
+
4: 'high',
|
|
30
|
+
};
|
|
31
|
+
exports.RISK_OF_CHANGE_LABEL_KEY = RISK_OF_CHANGE_LABEL_KEY;
|
|
32
|
+
var RuleDetailsMessagesKeys = [
|
|
33
|
+
'systemReboot',
|
|
34
|
+
'viewAffectedSystems',
|
|
35
|
+
'viewAffectedClusters',
|
|
36
|
+
'knowledgebaseArticle',
|
|
37
|
+
'topicRelatedToRule',
|
|
38
|
+
'totalRisk',
|
|
39
|
+
'rulesDetailsTotalRiskBody',
|
|
40
|
+
'likelihoodLevel',
|
|
41
|
+
'likelihoodDescription',
|
|
42
|
+
'impactLevel',
|
|
43
|
+
'impactDescription',
|
|
44
|
+
'ruleHelpful',
|
|
45
|
+
'feedbackThankYou',
|
|
46
|
+
'riskOfChange',
|
|
47
|
+
'riskOfChangeText',
|
|
48
|
+
'riskOfChangeLabel',
|
|
49
|
+
];
|
|
50
|
+
exports.RuleDetailsMessagesKeys = RuleDetailsMessagesKeys;
|
|
51
|
+
//# sourceMappingURL=constants.js.map
|
package/constants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["src/constants.ts"],"names":[],"mappings":";;;AAAA,IAAM,oBAAoB,GAAG;IAC3B,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,WAAW;IACd,CAAC,EAAE,UAAU;CACd,CAAC;AA0CO,oDAAoB;AAxC7B,IAAM,oBAAoB,GAAG;IAC3B,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,UAAU;CACd,CAAC;AAmC6B,oDAAoB;AAjCnD,IAAM,gBAAgB,GAAG;IACvB,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,UAAU;CACd,CAAC;AA4BmD,4CAAgB;AA1BrE,IAAM,wBAAwB,GAAG;IAC/B,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,MAAM;CACV,CAAC;AAqBqE,4DAAwB;AAnB/F,IAAM,uBAAuB,GAAG;IAC9B,cAAc;IACd,qBAAqB;IACrB,sBAAsB;IACtB,sBAAsB;IACtB,oBAAoB;IACpB,WAAW;IACX,2BAA2B;IAC3B,iBAAiB;IACjB,uBAAuB;IACvB,aAAa;IACb,mBAAmB;IACnB,aAAa;IACb,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,mBAAmB;CACpB,CAAC;AAE+F,0DAAuB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.system-reboot-message {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
}
|
|
4
|
+
.system-reboot-message .system-reboot-message__content {
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
.system-reboot-message .reboot-required-icon {
|
|
8
|
+
margin-top: 5px;
|
|
9
|
+
margin-right: var(--pf-global--spacer--sm);
|
|
10
|
+
color: var(--pf-global--palette--red-100);
|
|
11
|
+
}
|
|
12
|
+
.system-reboot-message .no-reboot-required-icon {
|
|
13
|
+
margin-top: 5px;
|
|
14
|
+
margin-right: var(--pf-global--spacer--sm);
|
|
15
|
+
color: var(--pf-global--palette--black-400);
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './RebootRequired.scss';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Text, TextContent, TextVariants } from '@patternfly/react-core';
|
|
4
|
+
import { PowerOffIcon } from '@patternfly/react-icons';
|
|
5
|
+
var RebootRequired = function (_a) {
|
|
6
|
+
var messages = _a.messages, rebootRequired = _a.rebootRequired;
|
|
7
|
+
return (React.createElement("span", { className: "system-reboot-message" },
|
|
8
|
+
React.createElement(PowerOffIcon, { className: rebootRequired ? 'reboot-required-icon' : 'no-reboot-required-icon' }),
|
|
9
|
+
React.createElement(TextContent, { className: "system-reboot-message__content" },
|
|
10
|
+
React.createElement(Text, { component: TextVariants.p }, messages.systemReboot))));
|
|
11
|
+
};
|
|
12
|
+
export default RebootRequired;
|
|
13
|
+
//# sourceMappingURL=RebootRequired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RebootRequired.js","sourceRoot":"","sources":["../../src/RebootRequired/RebootRequired.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AASvD,IAAM,cAAc,GAAkC,UAAC,EAA4B;QAA1B,QAAQ,cAAA,EAAE,cAAc,oBAAA;IAAO,OAAA,CACtF,8BAAM,SAAS,EAAC,uBAAuB;QACrC,oBAAC,YAAY,IAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,yBAAyB,GAAI;QAChG,oBAAC,WAAW,IAAC,SAAS,EAAC,gCAAgC;YACrD,oBAAC,IAAI,IAAC,SAAS,EAAE,YAAY,CAAC,CAAC,IAAG,QAAQ,CAAC,YAAY,CAAQ,CACnD,CACT,CACR;AAPuF,CAOvF,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.system-reboot-message {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
|
|
4
|
+
.system-reboot-message__content {
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.reboot-required-icon {
|
|
9
|
+
margin-top: 5px;
|
|
10
|
+
margin-right: var(--pf-global--spacer--sm);
|
|
11
|
+
color: var(--pf-global--palette--red-100);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.no-reboot-required-icon {
|
|
15
|
+
margin-top: 5px;
|
|
16
|
+
margin-right: var(--pf-global--spacer--sm);
|
|
17
|
+
color: var(--pf-global--palette--black-400);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RebootRequired/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './RuleDescription.scss';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Markdown from 'react-markdown';
|
|
4
|
+
import rehypeRaw from 'rehype-raw';
|
|
5
|
+
import rehypeSanitize from 'rehype-sanitize';
|
|
6
|
+
import { AdvisorProduct } from '../types';
|
|
7
|
+
var RuleDescription = function (_a) {
|
|
8
|
+
var product = _a.product, rule = _a.rule, isDetailsPage = _a.isDetailsPage;
|
|
9
|
+
return (React.createElement(React.Fragment, null, (rule.generic || rule.summary) && (React.createElement("span", { className: product === AdvisorProduct.ocp || isDetailsPage ? 'ins-c-generic__override' : '' },
|
|
10
|
+
React.createElement(Markdown, { rehypePlugins: [rehypeRaw, rehypeSanitize] }, product === AdvisorProduct.ocp || isDetailsPage ? rule.generic : rule.summary)))));
|
|
11
|
+
};
|
|
12
|
+
export default RuleDescription;
|
|
13
|
+
//# sourceMappingURL=RuleDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuleDescription.js","sourceRoot":"","sources":["../../src/RuleDescription/RuleDescription.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAEhC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAmC,MAAM,UAAU,CAAC;AAQ3E,IAAM,eAAe,GAAmC,UAAC,EAAgC;QAA9B,OAAO,aAAA,EAAE,IAAI,UAAA,EAAE,aAAa,mBAAA;IAAO,OAAA,CAC5F,oBAAC,KAAK,CAAC,QAAQ,QACZ,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CACjC,8BAAM,SAAS,EAAE,OAAO,KAAK,cAAc,CAAC,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE;QAC/F,oBAAC,QAAQ,IAAC,aAAa,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,IACjD,OAAO,KAAK,cAAc,CAAC,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CACrE,CACN,CACR,CACc,CAClB;AAV6F,CAU7F,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RuleDescription/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.ins-c-line {
|
|
2
|
+
border: 0.01rem solid var(--pf-global--BorderColor--100);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ins-c-rule-details__stack {
|
|
6
|
+
width: 600px;
|
|
7
|
+
}
|
|
8
|
+
.ins-c-rule-details__stack .pf-c-content {
|
|
9
|
+
font-size: var(--pf-global--FontSize--sm);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.topicsCard {
|
|
13
|
+
background-color: var(--pf-global--BackgroundColor--150);
|
|
14
|
+
box-shadow: none;
|
|
15
|
+
word-break: break-word;
|
|
16
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import './RuleDetails.scss';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Flex, FlexItem, Stack, StackItem, Text, TextContent, TextVariants } from '@patternfly/react-core';
|
|
4
|
+
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
|
|
5
|
+
import InsightsLabel from '@redhat-cloud-services/frontend-components/InsightsLabel';
|
|
6
|
+
import { SeverityLine } from '@redhat-cloud-services/frontend-components-charts/SeverityLine';
|
|
7
|
+
import RebootRequired from '../RebootRequired/RebootRequired';
|
|
8
|
+
import RuleRating from '../RuleRating/RuleRating';
|
|
9
|
+
import { barDividedList, topicLinks } from '../common';
|
|
10
|
+
import { AdvisorProduct } from '../types';
|
|
11
|
+
import { ViewAffectedLink } from '../ViewAffectedLink';
|
|
12
|
+
import { RuleDescription } from '../RuleDescription';
|
|
13
|
+
var RuleDetails = function (_a) {
|
|
14
|
+
var messages = _a.messages, product = _a.product, header = _a.header, rule = _a.rule, isDetailsPage = _a.isDetailsPage, topics = _a.topics, onVoteClick = _a.onVoteClick, showViewAffected = _a.showViewAffected, resolutionRisk = _a.resolutionRisk, resolutionRiskDesc = _a.resolutionRiskDesc, children = _a.children, Link = _a.linkComponent, knowledgebaseUrl = _a.knowledgebaseUrl;
|
|
15
|
+
return (React.createElement(Flex, { flexWrap: { default: 'nowrap' }, direction: { default: isDetailsPage ? 'column' : 'columnReverse', lg: 'row' } },
|
|
16
|
+
React.createElement(FlexItem, null,
|
|
17
|
+
React.createElement(Stack, { hasGutter: true },
|
|
18
|
+
header && React.createElement(StackItem, null, header),
|
|
19
|
+
React.createElement(StackItem, null,
|
|
20
|
+
React.createElement(RuleDescription, { product: product, rule: rule, isDetailsPage: isDetailsPage })),
|
|
21
|
+
knowledgebaseUrl && (React.createElement(StackItem, null,
|
|
22
|
+
React.createElement("a", { rel: "noopener noreferrer", target: "_blank", href: knowledgebaseUrl },
|
|
23
|
+
messages.knowledgebaseArticle,
|
|
24
|
+
"\u00A0",
|
|
25
|
+
React.createElement(ExternalLinkAltIcon, { size: "sm" })))),
|
|
26
|
+
topics && rule.tags && topicLinks(rule, topics, Link).length > 0 && (React.createElement(StackItem, null,
|
|
27
|
+
React.createElement("strong", null, messages.topicRelatedToRule),
|
|
28
|
+
React.createElement("br", null),
|
|
29
|
+
barDividedList(topicLinks(rule, topics, Link)))),
|
|
30
|
+
isDetailsPage && onVoteClick && React.createElement(RuleRating, { messages: messages, ruleId: rule.rule_id, ruleRating: rule.rating, onVoteClick: onVoteClick }),
|
|
31
|
+
!isDetailsPage && showViewAffected && Link && (React.createElement(StackItem, null,
|
|
32
|
+
React.createElement(ViewAffectedLink, { messages: messages, rule: rule, product: product, linkComponent: Link }))))),
|
|
33
|
+
React.createElement(FlexItem, { align: { lg: 'alignRight' } },
|
|
34
|
+
React.createElement(Stack, null,
|
|
35
|
+
children && React.createElement(StackItem, null, children),
|
|
36
|
+
React.createElement(StackItem, null,
|
|
37
|
+
React.createElement(Flex, { className: "ins-c-rule-details__stack", direction: { default: 'column' } },
|
|
38
|
+
React.createElement(FlexItem, { spacer: { default: 'spacerSm' } },
|
|
39
|
+
React.createElement("strong", null, messages.totalRisk)),
|
|
40
|
+
React.createElement(FlexItem, null,
|
|
41
|
+
React.createElement(Flex, { flexWrap: { default: 'nowrap' } },
|
|
42
|
+
React.createElement(FlexItem, null,
|
|
43
|
+
React.createElement(InsightsLabel, { value: rule.total_risk, isCompact: true, className: "pf-m-compact", rest: {} })),
|
|
44
|
+
React.createElement(FlexItem, { className: "ins-c-description-stack-override" },
|
|
45
|
+
React.createElement(Stack, { hasGutter: true },
|
|
46
|
+
React.createElement(StackItem, null,
|
|
47
|
+
React.createElement(TextContent, null,
|
|
48
|
+
React.createElement(Text, { component: TextVariants.p }, messages.rulesDetailsTotalRiskBody))),
|
|
49
|
+
React.createElement(Stack, null,
|
|
50
|
+
React.createElement(StackItem, null,
|
|
51
|
+
React.createElement(SeverityLine, { className: "ins-c-severity-line", title: messages.likelihoodLevel, value: rule.likelihood, tooltipMessage: messages.likelihoodDescription })),
|
|
52
|
+
React.createElement(StackItem, null,
|
|
53
|
+
React.createElement(SeverityLine, { className: "ins-c-severity-line", title: messages.impactLevel, value: rule.impact.impact, tooltipMessage: messages.impactDescription }))))))),
|
|
54
|
+
resolutionRisk && resolutionRiskDesc && (React.createElement(React.Fragment, null,
|
|
55
|
+
React.createElement("span", { className: "ins-c-line" }),
|
|
56
|
+
React.createElement(FlexItem, { spacer: { default: 'spacerSm' } },
|
|
57
|
+
React.createElement("strong", null, messages.riskOfChange)),
|
|
58
|
+
React.createElement(FlexItem, { className: "pf-u-display-inline-flex alignCenterOverride pf-u-pb-sm pf-u-pt-sm" },
|
|
59
|
+
React.createElement(Flex, { flexWrap: { default: 'nowrap' } },
|
|
60
|
+
React.createElement(FlexItem, null,
|
|
61
|
+
React.createElement(InsightsLabel, { text: messages.riskOfChangeLabel, value: resolutionRisk, hideIcon: true, className: "pf-m-compact", rest: {} })),
|
|
62
|
+
React.createElement(FlexItem, { className: "ins-c-description-stack-override" },
|
|
63
|
+
React.createElement(Stack, { hasGutter: true },
|
|
64
|
+
React.createElement(StackItem, null,
|
|
65
|
+
React.createElement(TextContent, null,
|
|
66
|
+
React.createElement(Text, { component: TextVariants.p }, resolutionRiskDesc))),
|
|
67
|
+
product === AdvisorProduct.rhel && (React.createElement(StackItem, null,
|
|
68
|
+
React.createElement(RebootRequired, { messages: messages, rebootRequired: rule.reboot_required })))))))))))))));
|
|
69
|
+
};
|
|
70
|
+
export default RuleDetails;
|
|
71
|
+
//# sourceMappingURL=RuleDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuleDetails.js","sourceRoot":"","sources":["../../src/RuleDetails/RuleDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,MAAM,OAAO,CAAC;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IAAC,SAAS,EAAE,oEAAoE;gCACvF,oBAAC,IAAI,IAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;oCACnC,oBAAC,QAAQ;wCAEP,oBAAC,aAAa,IAAC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,QAAC,SAAS,EAAC,cAAc,EAAC,IAAI,EAAE,EAAE,GAAI,CAC7G;oCACX,oBAAC,QAAQ,IAAC,SAAS,EAAC,kCAAkC;wCACpD,oBAAC,KAAK,IAAC,SAAS;4CACd,oBAAC,SAAS;gDACR,oBAAC,WAAW;oDACV,oBAAC,IAAI,IAAC,SAAS,EAAE,YAAY,CAAC,CAAC,IAAG,kBAAkB,CAAQ,CAChD,CACJ;4CACX,OAAO,KAAK,cAAc,CAAC,IAAI,IAAI,CAClC,oBAAC,SAAS;gDACR,oBAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAG,IAAwB,CAAC,eAAe,GAAI,CACvF,CACb,CACK,CACC,CACN,CACE,CACI,CAClB,CACI,CACG,CACN,CACC,CACN,CACR;AA7GK,CA6GL,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.ins-c-line {
|
|
2
|
+
border: 0.01rem solid var(--pf-global--BorderColor--100);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ins-c-rule-details__stack {
|
|
6
|
+
width: 600px;
|
|
7
|
+
.pf-c-content {
|
|
8
|
+
font-size: var(--pf-global--FontSize--sm);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.topicsCard {
|
|
13
|
+
background-color: var(--pf-global--BackgroundColor--150);
|
|
14
|
+
box-shadow: none;
|
|
15
|
+
word-break: break-word;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RuleDetails/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.ins-c-like {
|
|
2
|
+
color: var(--pf-global--success-color--100);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ins-c-dislike {
|
|
6
|
+
color: var(--pf-global--primary-color--100);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ratingSpanOverride {
|
|
10
|
+
font-size: var(--pf-global--FontSize--sm) !important;
|
|
11
|
+
}
|
|
12
|
+
.ratingSpanOverride button {
|
|
13
|
+
padding: 8px;
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import './RuleRating.scss';
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import debounce from 'lodash/debounce';
|
|
4
|
+
import { Button } from '@patternfly/react-core';
|
|
5
|
+
import { OutlinedThumbsDownIcon, OutlinedThumbsUpIcon, ThumbsDownIcon, ThumbsUpIcon } from '@patternfly/react-icons';
|
|
6
|
+
var RuleRating = function (_a) {
|
|
7
|
+
var messages = _a.messages, ruleId = _a.ruleId, ruleRating = _a.ruleRating, onVoteClick = _a.onVoteClick;
|
|
8
|
+
var _b = useState(ruleRating), rating = _b[0], setRating = _b[1];
|
|
9
|
+
var _c = useState(false), submitted = _c[0], setSubmitted = _c[1];
|
|
10
|
+
var triggerCallback = useCallback(debounce(function (calculatedRating) {
|
|
11
|
+
onVoteClick(ruleId, calculatedRating);
|
|
12
|
+
setSubmitted(false);
|
|
13
|
+
}, 2000), []);
|
|
14
|
+
var updateRuleRating = function (newRating) {
|
|
15
|
+
var calculatedRating = rating === newRating ? 0 : newRating;
|
|
16
|
+
try {
|
|
17
|
+
setSubmitted(true);
|
|
18
|
+
triggerCallback(calculatedRating);
|
|
19
|
+
setRating(calculatedRating);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.error(error);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return (React.createElement("span", { className: "ratingSpanOverride" },
|
|
26
|
+
messages.ruleHelpful,
|
|
27
|
+
React.createElement(Button, { variant: "plain", "aria-label": "thumbs-up", onClick: function () { return updateRuleRating(1); }, ouiaId: "thumbsUp" }, rating === 1 ? React.createElement(ThumbsUpIcon, { className: "ins-c-like", size: "sm" }) : React.createElement(OutlinedThumbsUpIcon, { size: "sm" })),
|
|
28
|
+
React.createElement(Button, { variant: "plain", "aria-label": "thumbs-down", onClick: function () { return updateRuleRating(-1); }, ouiaId: "thumbsDown" }, rating === -1 ? React.createElement(ThumbsDownIcon, { className: "ins-c-dislike", size: "sm" }) : React.createElement(OutlinedThumbsDownIcon, { size: "sm" })),
|
|
29
|
+
submitted && messages.feedbackThankYou));
|
|
30
|
+
};
|
|
31
|
+
export default RuleRating;
|
|
32
|
+
//# sourceMappingURL=RuleRating.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuleRating.js","sourceRoot":"","sources":["../../src/RuleRating/RuleRating.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAYrH,IAAM,UAAU,GAA8B,UAAC,EAA6C;QAA3C,QAAQ,cAAA,EAAE,MAAM,YAAA,EAAE,UAAU,gBAAA,EAAE,WAAW,iBAAA;IAClF,IAAA,KAAsB,QAAQ,CAAC,UAAU,CAAC,EAAzC,MAAM,QAAA,EAAE,SAAS,QAAwB,CAAC;IAC3C,IAAA,KAA4B,QAAQ,CAAC,K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C,cAAc,IAAC,SAAS,EAAC,eAAe,EAAC,IAAI,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,oBAAC,sBAAsB,IAAC,IAAI,EAAC,IAAI,GAAG,CACvG;QACR,SAAS,IAAI,QAAQ,CAAC,gBAAgB,CAClC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.ins-c-like {
|
|
2
|
+
color: var(--pf-global--success-color--100);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ins-c-dislike {
|
|
6
|
+
color: var(--pf-global--primary-color--100);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ratingSpanOverride {
|
|
10
|
+
font-size: var(--pf-global--FontSize--sm) !important;
|
|
11
|
+
button {
|
|
12
|
+
padding: 8px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RuleRating/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AdvisorProduct } from '../types';
|
|
3
|
+
var ViewAffectedLink = function (_a) {
|
|
4
|
+
var _b, _c;
|
|
5
|
+
var messages = _a.messages, product = _a.product, rule = _a.rule, Link = _a.linkComponent;
|
|
6
|
+
return (React.createElement(React.Fragment, null, product === AdvisorProduct.ocp
|
|
7
|
+
? (_b = rule.impacted_clusters_count > 0) !== null && _b !== void 0 ? _b : (React.createElement(Link, { key: "".concat(rule.rule_id, "-link"), to: "/recommendations/".concat(rule.rule_id) }, messages.viewAffectedClusters))
|
|
8
|
+
: (_c = rule.impacted_systems_count > 0) !== null && _c !== void 0 ? _c : (React.createElement(Link, { key: "".concat(rule.rule_id, "-link"), to: "/recommendations/".concat(rule.rule_id) }, messages.viewAffectedSystems))));
|
|
9
|
+
};
|
|
10
|
+
export default ViewAffectedLink;
|
|
11
|
+
//# sourceMappingURL=ViewAffectedLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewAffectedLink.js","sourceRoot":"","sources":["../../src/ViewAffectedLink/ViewAffectedLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAmC,MAAM,UAAU,CAAC;AAS3E,IAAM,gBAAgB,GAAoC,UAAC,EAAgD;;QAA9C,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,IAAI,UAAA,EAAiB,IAAI,mBAAA;IAAO,OAAA,CAC9G,oBAAC,KAAK,CAAC,QAAQ,QACZ,OAAO,KAAK,cAAc,CAAC,GAAG;QAC7B,CAAC,CAAC,MAAC,IAAuB,CAAC,uBAAuB,GAAG,CAAC,mCAAI,CACtD,oBAAC,IAAI,IAAC,GAAG,EAAE,UAAG,IAAI,CAAC,OAAO,UAAO,EAAE,EAAE,EAAE,2BAAoB,IAAI,CAAC,OAAO,CAAE,IACtE,QAAQ,CAAC,oBAAoB,CACzB,CACR;QACH,CAAC,CAAC,MAAC,IAAwB,CAAC,sBAAsB,GAAG,CAAC,mCAAI,CACtD,oBAAC,IAAI,IAAC,GAAG,EAAE,UAAG,IAAI,CAAC,OAAO,UAAO,EAAE,EAAE,EAAE,2BAAoB,IAAI,CAAC,OAAO,CAAE,IACtE,QAAQ,CAAC,mBAAmB,CACxB,CACR,CACU,CAClB,CAAA;CAAA,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ViewAffectedLink/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/esm/common.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import compact from 'lodash/compact';
|
|
3
|
+
import intersection from 'lodash/intersection';
|
|
4
|
+
export var barDividedList = function (list) {
|
|
5
|
+
return list.map(function (element, index) { return (React.createElement(React.Fragment, { key: index },
|
|
6
|
+
element,
|
|
7
|
+
index + 1 !== list.length && React.createElement("strong", { className: "verticalDivider" }, "\u00A0|\u00A0"))); });
|
|
8
|
+
};
|
|
9
|
+
export var topicLinks = function (rule, topics, Link) {
|
|
10
|
+
return topics
|
|
11
|
+
? compact(topics.map(function (topic) {
|
|
12
|
+
return intersection(topic.tag.split(' '), rule.tags.split(' ')).length && (React.createElement(Link, { key: topic.slug, to: "/topics/".concat(topic.slug) }, "".concat(topic.name)));
|
|
13
|
+
}))
|
|
14
|
+
: [];
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAK/C,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,IAAmB;IAChD,OAAA,IAAI,CAAC,GAAG,CAAC,UAAC,OAAO,EAAE,KAAK,IAAK,OAAA,CAC3B,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK;QACvB,OAAO;QACP,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,gCAAQ,SAAS,EAAC,iBAAiB,oBAA4B,CAC9E,CAClB,EAL4B,CAK5B,CAAC;AALF,CAKE,CAAC;AAEL,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC,IAAqB,EAAE,MAAmB,EAAE,IAAS;IAC9E,OAAA,MAAM;QACJ,CAAC,CAAC,OAAO,CACL,MAAM,CAAC,GAAG,CACR,UAAC,KAAK;YACJ,OAAA,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,CACjE,oBAAC,IAAI,IAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,kBAAW,KAAK,CAAC,IAAI,CAAE,IAAG,UAAG,KAAK,CAAC,IAAI,CAAE,CAAQ,CAC7E;QAFD,CAEC,CACJ,CACF;QACH,CAAC,CAAC,EAAE;AATN,CASM,CAAC"}
|
package/esm/constants.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var TOTAL_RISK_LABEL_KEY = {
|
|
2
|
+
1: 'low',
|
|
3
|
+
2: 'moderate',
|
|
4
|
+
3: 'important',
|
|
5
|
+
4: 'critical',
|
|
6
|
+
};
|
|
7
|
+
var LIKELIHOOD_LABEL_KEY = {
|
|
8
|
+
1: 'low',
|
|
9
|
+
2: 'medium',
|
|
10
|
+
3: 'high',
|
|
11
|
+
4: 'critical',
|
|
12
|
+
};
|
|
13
|
+
var IMPACT_LABEL_KEY = {
|
|
14
|
+
1: 'low',
|
|
15
|
+
2: 'medium',
|
|
16
|
+
3: 'high',
|
|
17
|
+
4: 'critical',
|
|
18
|
+
};
|
|
19
|
+
var RISK_OF_CHANGE_LABEL_KEY = {
|
|
20
|
+
1: 'veryLow',
|
|
21
|
+
2: 'low',
|
|
22
|
+
3: 'moderate',
|
|
23
|
+
4: 'high',
|
|
24
|
+
};
|
|
25
|
+
var RuleDetailsMessagesKeys = [
|
|
26
|
+
'systemReboot',
|
|
27
|
+
'viewAffectedSystems',
|
|
28
|
+
'viewAffectedClusters',
|
|
29
|
+
'knowledgebaseArticle',
|
|
30
|
+
'topicRelatedToRule',
|
|
31
|
+
'totalRisk',
|
|
32
|
+
'rulesDetailsTotalRiskBody',
|
|
33
|
+
'likelihoodLevel',
|
|
34
|
+
'likelihoodDescription',
|
|
35
|
+
'impactLevel',
|
|
36
|
+
'impactDescription',
|
|
37
|
+
'ruleHelpful',
|
|
38
|
+
'feedbackThankYou',
|
|
39
|
+
'riskOfChange',
|
|
40
|
+
'riskOfChangeText',
|
|
41
|
+
'riskOfChangeLabel',
|
|
42
|
+
];
|
|
43
|
+
export { TOTAL_RISK_LABEL_KEY, LIKELIHOOD_LABEL_KEY, IMPACT_LABEL_KEY, RISK_OF_CHANGE_LABEL_KEY, RuleDetailsMessagesKeys };
|
|
44
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,IAAM,oBAAoB,GAAG;IAC3B,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,WAAW;IACd,CAAC,EAAE,UAAU;CACd,CAAC;AAEF,IAAM,oBAAoB,GAAG;IAC3B,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,UAAU;CACd,CAAC;AAEF,IAAM,gBAAgB,GAAG;IACvB,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,UAAU;CACd,CAAC;AAEF,IAAM,wBAAwB,GAAG;IAC/B,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,MAAM;CACV,CAAC;AAEF,IAAM,uBAAuB,GAAG;IAC9B,cAAc;IACd,qBAAqB;IACrB,sBAAsB;IACtB,sBAAsB;IACtB,oBAAoB;IACpB,WAAW;IACX,2BAA2B;IAC3B,iBAAiB;IACjB,uBAAuB;IACvB,aAAa;IACb,mBAAmB;IACnB,aAAa;IACb,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,mBAAmB;CACpB,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,CAAC"}
|
package/esm/index.js
ADDED
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
package/esm/types.js
ADDED
package/esm/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB"}
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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("./RuleDetails"), exports);
|
|
14
|
+
__exportStar(require("./RebootRequired"), exports);
|
|
15
|
+
__exportStar(require("./RuleRating"), exports);
|
|
16
|
+
__exportStar(require("./types"), exports);
|
|
17
|
+
__exportStar(require("./common"), exports);
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,+CAA6B;AAC7B,0CAAwB;AACxB,2CAAyB;AACzB,8CAA4B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@redhat-cloud-services/frontend-components-advisor-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Components to be used in Advisor applications and integrations.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "esm/index.js",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "npm run build:js && npm run build:esm && npm run build:css && npm run build:packages",
|
|
12
|
+
"build:js": "tsc -p tsconfig.cjs.json",
|
|
13
|
+
"build:esm": "tsc --module es2015 --target es5",
|
|
14
|
+
"build:css": "node ../../scripts/build-styles.js",
|
|
15
|
+
"build:packages": "node ../../scripts/build-packages.js --forceTypes",
|
|
16
|
+
"start": "concurrently \"npm run build:esm -- --watch\" \"npm run build:js -- --watch\" \"npm run build:css -- --watch\""
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/RedHatInsights/frontend-components.git"
|
|
21
|
+
},
|
|
22
|
+
"author": "",
|
|
23
|
+
"license": "Apache-2.0",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/RedHatInsights/frontend-components/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/RedHatInsights/frontend-components/tree/master/packages/advisor-components#readme",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@patternfly/react-core": ">=4.162.16",
|
|
30
|
+
"@patternfly/react-icons": ">=4.3.5",
|
|
31
|
+
"prop-types": ">=15.6.2",
|
|
32
|
+
"react": ">=16.14.0 || >=17.0.0",
|
|
33
|
+
"react-dom": ">=16.14.0 || >=17.0.0",
|
|
34
|
+
"react-router-dom": "^5.0.0"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@redhat-cloud-services/frontend-components": ">=3.0.0",
|
|
38
|
+
"lodash": "^4.17.21",
|
|
39
|
+
"react-markdown": "^8.0.1",
|
|
40
|
+
"rehype-raw": "^6.1.1",
|
|
41
|
+
"rehype-sanitize": "^5.0.1"
|
|
42
|
+
}
|
|
43
|
+
}
|