Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add detail for archetype reviews in drawer #1475

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,15 @@
"acceptedAppsAndDeps": "Accepted applications and dependencies",
"associatedApplications": "Associated applications",
"associatedArchetypes": "Associated archetypes",
"archetypesReviewed": "Archetypes reviewed",
"add": "Add",
"additionalNotesOrComments": "Additional notes or comments",
"adoptionCandidateDistribution": "Assessment confidence and risk",
"affectedApplications": "Affected applications",
"analysis": "Analysis",
"answer": "Answer",
"application": "Application",
"applicationReview": "Application review",
"application(s)": "Application(s)",
"applicationImports": "Application imports",
"applicationName": "Application name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
IApplicationDetailDrawerProps,
} from "./application-detail-drawer";
import { useFetchReviewById } from "@app/queries/reviews";
import { ReviewedArchetypeItem } from "./reviewed-archetype-item";

export interface IApplicationDetailDrawerAssessmentProps
extends Pick<IApplicationDetailDrawerProps, "application" | "onCloseClick"> {
Expand All @@ -44,6 +45,9 @@ export const ApplicationDetailDrawerAssessment: React.FC<
onCloseClick={onCloseClick}
detailsTabMainContent={
<>
<Title headingLevel="h3" size="md">
{t("terms.archetypes")}
</Title>
<DescriptionList
isHorizontal
isCompact
Expand All @@ -53,7 +57,9 @@ export const ApplicationDetailDrawerAssessment: React.FC<
}}
>
<DescriptionListGroup>
<DescriptionListTerm>{t("terms.archetypes")}</DescriptionListTerm>
<DescriptionListTerm>
{t("terms.associatedArchetypes")}
</DescriptionListTerm>
<DescriptionListDescription>
{application?.archetypes?.length ?? 0 > 0 ? (
<ArchetypeLabels
Expand All @@ -64,6 +70,28 @@ export const ApplicationDetailDrawerAssessment: React.FC<
)}
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>
{t("terms.archetypesReviewed")}
</DescriptionListTerm>
<DescriptionListDescription>
{application?.archetypes?.length ?? 0 > 0 ? (
application?.archetypes?.map((archetypeRef) => (
<ReviewedArchetypeItem
key={archetypeRef.id}
id={archetypeRef.id}
/>
))
) : (
<EmptyTextMessage message={t("terms.none")} />
)}
</DescriptionListDescription>
</DescriptionListGroup>
<TextContent className={spacing.mtLg}>
<Title headingLevel="h3" size="md">
{t("terms.applicationReview")}
</Title>
</TextContent>
<DescriptionListGroup>
<DescriptionListTerm>
{t("terms.proposedAction")}
Expand Down Expand Up @@ -114,16 +142,6 @@ export const ApplicationDetailDrawerAssessment: React.FC<
{application && <ApplicationRisk application={application} />}
</DescriptionListDescription>
</DescriptionListGroup> */}
<DescriptionListGroup>
<DescriptionListTerm>
{t("terms.migrationWave")}
</DescriptionListTerm>
<DescriptionListDescription cy-data="migration-wave">
{application?.migrationWave
? application.migrationWave.name
: t("terms.unassigned")}
</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
<TextContent className={spacing.mtLg}>
<Title headingLevel="h3" size="md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,20 @@ export const ApplicationDetailDrawer: React.FC<
<ApplicationBusinessService
id={application.businessService.id}
/>
) : null}
) : (
t("terms.unassigned")
)}
</Text>
<Title headingLevel="h3" size="md">
{t("terms.migrationWave")}
</Title>
<Text component="small">
{application?.migrationWave
? application.migrationWave.name
: t("terms.unassigned")}
Comment on lines +124 to +130
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this part of the fix for MTA-1382? I don't see anything in the jira about migration waves.

</Text>
</TextContent>

{detailsTabMainContent}
</Tab>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useFetchArchetypeById } from "@app/queries/archetypes";
import { Label } from "@patternfly/react-core";
import React from "react";

export const ReviewedArchetypeItem = ({ id }: { id: number }) => {
const { archetype } = useFetchArchetypeById(id);

if (!archetype) return null;

return (
<Label color="grey" key={id}>
{archetype.name}
{archetype.review ? " (Reviewed)" : " (Not Reviewed)"}
</Label>
);
};
Loading