Skip to content

Commit 5d60122

Browse files
authoredJul 7, 2023
Merge branch 'master' into pdf-export
2 parents f3f9617 + 4228edd commit 5d60122

File tree

7 files changed

+15
-37
lines changed

7 files changed

+15
-37
lines changed
 

‎packages/advisor-components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components-advisor-components",
3-
"version": "1.0.14",
3+
"version": "1.0.15",
44
"description": "Components to be used in Advisor applications and integrations.",
55
"main": "index.js",
66
"module": "esm/index.js",

‎packages/advisor-components/src/RuleDetails/RuleDetails.scss

-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,3 @@
88
font-size: var(--pf-global--FontSize--sm);
99
}
1010
}
11-
12-
.topicsCard {
13-
background-color: var(--pf-global--BackgroundColor--150);
14-
box-shadow: none;
15-
word-break: break-word;
16-
}

‎packages/advisor-components/src/RuleDetails/RuleDetails.tsx

+6-25
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,13 @@ import { SeverityLine } from '@redhat-cloud-services/frontend-components-charts/
1010

1111
import RebootRequired from '../RebootRequired/RebootRequired';
1212
import RuleRating from '../RuleRating/RuleRating';
13-
import { barDividedList, topicLinks } from '../common';
1413
import { AdvisorProduct, Rating, RuleContentOcp, RuleContentRhel, TopicRhel } from '../types';
15-
import { ViewAffectedLink } from '../ViewAffectedLink';
1614
import { RuleDescription } from '../RuleDescription';
1715

1816
export type Message = React.ReactNode;
1917
export type RuleDetailsMessages = {
2018
systemReboot: Message;
21-
// RHEL
22-
viewAffectedSystems?: Message;
23-
// OCP
24-
viewAffectedClusters?: Message;
2519
knowledgebaseArticle: Message;
26-
topicRelatedToRule: Message;
2720
totalRisk: Message;
2821
rulesDetailsTotalRiskBody: Message;
2922
likelihoodLevel: Message;
@@ -46,16 +39,15 @@ export interface RuleDetailsProps {
4639
header?: React.ReactNode;
4740
isDetailsPage: boolean;
4841
children?: React.ReactNode;
49-
topics?: TopicRhel[];
5042
/**
5143
* onVoteClick - a callback used to update the rating of a particular rule
5244
* @param {string} ruleId - ID (usually in plugin|error_key format) of the rule that needs to be updated
5345
* @param {number} newRating rating (-1, 0, 1)
5446
*/
5547
onVoteClick?: (ruleId: string, calculatedRating: Rating) => unknown;
56-
showViewAffected?: boolean;
57-
linkComponent?: any;
5848
knowledgebaseUrl?: string;
49+
Topics?: React.ReactNode;
50+
ViewAffectedLink?: React.ReactNode;
5951
}
6052

6153
const RuleDetails: React.FC<RuleDetailsProps> = ({
@@ -64,14 +56,13 @@ const RuleDetails: React.FC<RuleDetailsProps> = ({
6456
header,
6557
rule,
6658
isDetailsPage,
67-
topics,
6859
onVoteClick,
69-
showViewAffected,
7060
resolutionRisk,
7161
resolutionRiskDesc,
7262
children,
73-
linkComponent: Link,
7463
knowledgebaseUrl,
64+
Topics,
65+
ViewAffectedLink,
7566
}) => (
7667
<Flex
7768
className="ins-c-rule-details"
@@ -92,23 +83,13 @@ const RuleDetails: React.FC<RuleDetailsProps> = ({
9283
</a>
9384
</StackItem>
9485
)}
95-
{topics && rule.tags && topicLinks(rule as RuleContentRhel, topics, Link).length > 0 && (
96-
<StackItem className="ins-c-rule-details__topics">
97-
<strong>{messages.topicRelatedToRule}</strong>
98-
<br />
99-
{barDividedList(topicLinks(rule as RuleContentRhel, topics, Link))}
100-
</StackItem>
101-
)}
86+
{Topics && <StackItem className="ins-c-rule-details__topics">{Topics}</StackItem>}
10287
{isDetailsPage && onVoteClick && (
10388
<StackItem className="ins-c-rule-details__vote">
10489
<RuleRating messages={messages} ruleId={rule.rule_id} ruleRating={rule.rating} onVoteClick={onVoteClick} />
10590
</StackItem>
10691
)}
107-
{!isDetailsPage && showViewAffected && Link && (
108-
<StackItem className="ins-c-rule-details__view-affected">
109-
<ViewAffectedLink messages={messages} rule={rule} product={product} linkComponent={Link} />
110-
</StackItem>
111-
)}
92+
{ViewAffectedLink && <StackItem className="ins-c-rule-details__view-affected">{ViewAffectedLink}</StackItem>}
11293
</Stack>
11394
</FlexItem>
11495
<FlexItem align={{ lg: 'alignRight' }}>

‎packages/advisor-components/src/ViewAffectedLink/ViewAffectedLink.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import React from 'react';
22

3-
import { RuleDetailsMessages } from '../RuleDetails/RuleDetails';
3+
import { Message } from '../RuleDetails/RuleDetails';
44
import { AdvisorProduct, RuleContentOcp, RuleContentRhel } from '../types';
55

66
interface ViewAffectedLinkProps {
7-
messages: RuleDetailsMessages;
7+
messages: {
8+
viewAffectedClusters: Message;
9+
viewAffectedSystems: Message;
10+
};
811
product: AdvisorProduct;
912
rule: RuleContentOcp | RuleContentRhel;
1013
linkComponent: any;

‎packages/components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components",
3-
"version": "3.11.0",
3+
"version": "3.11.2",
44
"description": "Common components for RedHat Cloud Services project.",
55
"main": "index.js",
66
"module": "esm/index.js",

‎packages/components/src/CullingInfo/CullingInformation.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.ins-c-inventory__culling-warning { color: var(--pf-global--warning-color--100); }
1+
.ins-c-inventory__culling-warning { color: var(--pf-global--warning-color--200); }
22

33
.ins-c-inventory__culling-danger { color: var(--pf-global--danger-color--100); }
44

‎packages/utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components-utilities",
3-
"version": "3.7.1",
3+
"version": "3.7.2",
44
"description": "Util functions for RedHat Cloud Services project.",
55
"main": "index.js",
66
"module": "esm/index.js",

0 commit comments

Comments
 (0)
Please sign in to comment.