Skip to content

Commit

Permalink
🐛 Refactoring to follow up PR #1573 comments (#1578)
Browse files Browse the repository at this point in the history
Followup changes to #1573:
  - Simplify the assessment risk query
  - Simplify the header for reports / identified risk card header
  - Fixup layout of the review page assessment summary card

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
  • Loading branch information
sjd78 authored Dec 1, 2023
1 parent 85ac7b4 commit d2ea8c1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 31 deletions.
20 changes: 3 additions & 17 deletions client/src/app/pages/reports/reports.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import {
Bullseye,
Card,
CardBody,
CardHeader,
CardTitle,
Flex,
FlexItem,
MenuToggle,
PageSection,
PageSectionVariants,
Select,
SelectOption,
Split,
SplitItem,
Stack,
StackItem,
Text,
Expand Down Expand Up @@ -220,19 +216,9 @@ export const Reports: React.FC = () => {
<StackItem>
<Card>
<CardHeader>
<CardTitle>
<Split style={{ marginTop: -3 }}>
<SplitItem>
<Bullseye>
<TextContent>
<Text component="h3">
{t("terms.identifiedRisks")}
</Text>
</TextContent>
</Bullseye>
</SplitItem>
</Split>
</CardTitle>
<TextContent>
<Text component="h3">{t("terms.identifiedRisks")}</Text>
</TextContent>
</CardHeader>
<CardBody>
<IdentifiedRisksTable />
Expand Down
24 changes: 13 additions & 11 deletions client/src/app/pages/review/review-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,19 @@ const ReviewPage: React.FC = () => {
<Text component="h3">{t("terms.assessmentSummary")}</Text>
</TextContent>
</CardHeader>
<AssessmentLandscape
questionnaire={null}
assessmentRefs={
application?.assessments || archetype?.assessments
}
/>
<IdentifiedRisksTable
assessmentRefs={
application?.assessments || archetype?.assessments
}
/>
<CardBody>
<AssessmentLandscape
questionnaire={null}
assessmentRefs={
application?.assessments || archetype?.assessments
}
/>
<IdentifiedRisksTable
assessmentRefs={
application?.assessments || archetype?.assessments
}
/>
</CardBody>
</Card>
</PageSection>
)}
Expand Down
4 changes: 1 addition & 3 deletions client/src/app/queries/assessments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,7 @@ export const useFetchAssessmentsWithArchetypeApplications = () => {
),
].map((archetypeId) => ({
queryKey: ["archetype", archetypeId],
queryFn: () =>
archetypeId ? getArchetypeById(archetypeId) : undefined,
enabled: !!archetypeId,
queryFn: () => getArchetypeById(archetypeId),
})) || [],
});

Expand Down

0 comments on commit d2ea8c1

Please sign in to comment.