@@ -10,20 +10,13 @@ import { SeverityLine } from '@redhat-cloud-services/frontend-components-charts/
10
10
11
11
import RebootRequired from '../RebootRequired/RebootRequired' ;
12
12
import RuleRating from '../RuleRating/RuleRating' ;
13
- import { barDividedList , topicLinks } from '../common' ;
14
13
import { AdvisorProduct , Rating , RuleContentOcp , RuleContentRhel , TopicRhel } from '../types' ;
15
- import { ViewAffectedLink } from '../ViewAffectedLink' ;
16
14
import { RuleDescription } from '../RuleDescription' ;
17
15
18
16
export type Message = React . ReactNode ;
19
17
export type RuleDetailsMessages = {
20
18
systemReboot : Message ;
21
- // RHEL
22
- viewAffectedSystems ?: Message ;
23
- // OCP
24
- viewAffectedClusters ?: Message ;
25
19
knowledgebaseArticle : Message ;
26
- topicRelatedToRule : Message ;
27
20
totalRisk : Message ;
28
21
rulesDetailsTotalRiskBody : Message ;
29
22
likelihoodLevel : Message ;
@@ -46,16 +39,15 @@ export interface RuleDetailsProps {
46
39
header ?: React . ReactNode ;
47
40
isDetailsPage : boolean ;
48
41
children ?: React . ReactNode ;
49
- topics ?: TopicRhel [ ] ;
50
42
/**
51
43
* onVoteClick - a callback used to update the rating of a particular rule
52
44
* @param {string } ruleId - ID (usually in plugin|error_key format) of the rule that needs to be updated
53
45
* @param {number } newRating rating (-1, 0, 1)
54
46
*/
55
47
onVoteClick ?: ( ruleId : string , calculatedRating : Rating ) => unknown ;
56
- showViewAffected ?: boolean ;
57
- linkComponent ?: any ;
58
48
knowledgebaseUrl ?: string ;
49
+ Topics ?: React . ReactNode ;
50
+ ViewAffectedLink ?: React . ReactNode ;
59
51
}
60
52
61
53
const RuleDetails : React . FC < RuleDetailsProps > = ( {
@@ -64,14 +56,13 @@ const RuleDetails: React.FC<RuleDetailsProps> = ({
64
56
header,
65
57
rule,
66
58
isDetailsPage,
67
- topics,
68
59
onVoteClick,
69
- showViewAffected,
70
60
resolutionRisk,
71
61
resolutionRiskDesc,
72
62
children,
73
- linkComponent : Link ,
74
63
knowledgebaseUrl,
64
+ Topics,
65
+ ViewAffectedLink,
75
66
} ) => (
76
67
< Flex
77
68
className = "ins-c-rule-details"
@@ -92,23 +83,13 @@ const RuleDetails: React.FC<RuleDetailsProps> = ({
92
83
</ a >
93
84
</ StackItem >
94
85
) }
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 > }
102
87
{ isDetailsPage && onVoteClick && (
103
88
< StackItem className = "ins-c-rule-details__vote" >
104
89
< RuleRating messages = { messages } ruleId = { rule . rule_id } ruleRating = { rule . rating } onVoteClick = { onVoteClick } />
105
90
</ StackItem >
106
91
) }
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 > }
112
93
</ Stack >
113
94
</ FlexItem >
114
95
< FlexItem align = { { lg : 'alignRight' } } >
0 commit comments