Skip to content

Commit acdb3f3

Browse files
authored
🐛 Add detail for archetype reviews in drawer (#1475)
https://issues.redhat.com/browse/MTA-1382 Signed-off-by: ibolton336 <[email protected]>
1 parent a78bc28 commit acdb3f3

File tree

4 files changed

+59
-12
lines changed

4 files changed

+59
-12
lines changed

client/public/locales/en/translation.json

+2
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,15 @@
216216
"acceptedAppsAndDeps": "Accepted applications and dependencies",
217217
"associatedApplications": "Associated applications",
218218
"associatedArchetypes": "Associated archetypes",
219+
"archetypesReviewed": "Archetypes reviewed",
219220
"add": "Add",
220221
"additionalNotesOrComments": "Additional notes or comments",
221222
"adoptionCandidateDistribution": "Assessment confidence and risk",
222223
"affectedApplications": "Affected applications",
223224
"analysis": "Analysis",
224225
"answer": "Answer",
225226
"application": "Application",
227+
"applicationReview": "Application review",
226228
"application(s)": "Application(s)",
227229
"applicationImports": "Application imports",
228230
"applicationName": "Application name",

client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-assessment.tsx

+29-11
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
IApplicationDetailDrawerProps,
2222
} from "./application-detail-drawer";
2323
import { useFetchReviewById } from "@app/queries/reviews";
24+
import { ReviewedArchetypeItem } from "./reviewed-archetype-item";
2425

2526
export interface IApplicationDetailDrawerAssessmentProps
2627
extends Pick<IApplicationDetailDrawerProps, "application" | "onCloseClick"> {
@@ -44,6 +45,9 @@ export const ApplicationDetailDrawerAssessment: React.FC<
4445
onCloseClick={onCloseClick}
4546
detailsTabMainContent={
4647
<>
48+
<Title headingLevel="h3" size="md">
49+
{t("terms.archetypes")}
50+
</Title>
4751
<DescriptionList
4852
isHorizontal
4953
isCompact
@@ -53,7 +57,9 @@ export const ApplicationDetailDrawerAssessment: React.FC<
5357
}}
5458
>
5559
<DescriptionListGroup>
56-
<DescriptionListTerm>{t("terms.archetypes")}</DescriptionListTerm>
60+
<DescriptionListTerm>
61+
{t("terms.associatedArchetypes")}
62+
</DescriptionListTerm>
5763
<DescriptionListDescription>
5864
{application?.archetypes?.length ?? 0 > 0 ? (
5965
<ArchetypeLabels
@@ -64,6 +70,28 @@ export const ApplicationDetailDrawerAssessment: React.FC<
6470
)}
6571
</DescriptionListDescription>
6672
</DescriptionListGroup>
73+
<DescriptionListGroup>
74+
<DescriptionListTerm>
75+
{t("terms.archetypesReviewed")}
76+
</DescriptionListTerm>
77+
<DescriptionListDescription>
78+
{application?.archetypes?.length ?? 0 > 0 ? (
79+
application?.archetypes?.map((archetypeRef) => (
80+
<ReviewedArchetypeItem
81+
key={archetypeRef.id}
82+
id={archetypeRef.id}
83+
/>
84+
))
85+
) : (
86+
<EmptyTextMessage message={t("terms.none")} />
87+
)}
88+
</DescriptionListDescription>
89+
</DescriptionListGroup>
90+
<TextContent className={spacing.mtLg}>
91+
<Title headingLevel="h3" size="md">
92+
{t("terms.applicationReview")}
93+
</Title>
94+
</TextContent>
6795
<DescriptionListGroup>
6896
<DescriptionListTerm>
6997
{t("terms.proposedAction")}
@@ -114,16 +142,6 @@ export const ApplicationDetailDrawerAssessment: React.FC<
114142
{application && <ApplicationRisk application={application} />}
115143
</DescriptionListDescription>
116144
</DescriptionListGroup> */}
117-
<DescriptionListGroup>
118-
<DescriptionListTerm>
119-
{t("terms.migrationWave")}
120-
</DescriptionListTerm>
121-
<DescriptionListDescription cy-data="migration-wave">
122-
{application?.migrationWave
123-
? application.migrationWave.name
124-
: t("terms.unassigned")}
125-
</DescriptionListDescription>
126-
</DescriptionListGroup>
127145
</DescriptionList>
128146
<TextContent className={spacing.mtLg}>
129147
<Title headingLevel="h3" size="md">

client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,20 @@ export const ApplicationDetailDrawer: React.FC<
117117
<ApplicationBusinessService
118118
id={application.businessService.id}
119119
/>
120-
) : null}
120+
) : (
121+
t("terms.unassigned")
122+
)}
123+
</Text>
124+
<Title headingLevel="h3" size="md">
125+
{t("terms.migrationWave")}
126+
</Title>
127+
<Text component="small">
128+
{application?.migrationWave
129+
? application.migrationWave.name
130+
: t("terms.unassigned")}
121131
</Text>
122132
</TextContent>
133+
123134
{detailsTabMainContent}
124135
</Tab>
125136

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { useFetchArchetypeById } from "@app/queries/archetypes";
2+
import { Label } from "@patternfly/react-core";
3+
import React from "react";
4+
5+
export const ReviewedArchetypeItem = ({ id }: { id: number }) => {
6+
const { archetype } = useFetchArchetypeById(id);
7+
8+
if (!archetype) return null;
9+
10+
return (
11+
<Label color="grey" key={id}>
12+
{archetype.name}
13+
{archetype.review ? " (Reviewed)" : " (Not Reviewed)"}
14+
</Label>
15+
);
16+
};

0 commit comments

Comments
 (0)