Skip to content

Commit

Permalink
fix(advisor-3041): default values for kbadetail to fix the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Fewwy committed Jun 20, 2023
1 parent 7982a9f commit a3066aa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/advisor-components/src/ReportDetails/ReportDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ interface ReportDetailsProps {
report: Report;
kbaDetail: {
publishedTitle: string;
id: string;
view_uri: string;
};
kbaLoading: boolean; // if true, renders skeleton instead of kba link
}

const ReportDetails: React.FC<ReportDetailsProps> = ({ report, kbaDetail, kbaLoading }) => {
const ReportDetails: React.FC<ReportDetailsProps> = ({
report,
kbaDetail = {
publishedTitle: 'N/A',
id: '',
view_uri: '',
},
kbaLoading,
}) => {
const { rule, details, resolution } = report;
const [error, setError] = useState<Error | null>(null);
const { isProd } = useChrome();
Expand Down Expand Up @@ -75,7 +84,7 @@ const ReportDetails: React.FC<ReportDetailsProps> = ({ report, kbaDetail, kbaLoa
<CardBody>{resolution && <TemplateProcessor template={resolution} definitions={details} onError={handleError} />}</CardBody>
</Card>
</StackItem>
{(rule as RuleContentRhel).node_id && (
{kbaDetail.publishedTitle !== 'N/A' && (
<React.Fragment>
<Divider />
<StackItem>
Expand Down

0 comments on commit a3066aa

Please sign in to comment.