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 app details: Include a list of targets the project was checked against #2140

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@
"tagsAssessment": "Assessment Tags",
"tagsCriteria": "Criteria Tags",
"target": "Target",
"targets": "Targets",
"tagCategory": "Tag category",
"tagCategoryDeleted": "Tag category deleted",
"tagCategories": "Tag categories",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import { Paths } from "@app/Paths";
import { useFetchArchetypes } from "@app/queries/archetypes";
import { useFetchAssessments } from "@app/queries/assessments";
import { DecoratedApplication } from "../../applications-table/useDecoratedApplications";
import { TaskStates } from "@app/queries/tasks";
import { TaskStates, useFetchTaskByID } from "@app/queries/tasks";

export interface IApplicationDetailDrawerProps
extends Pick<IPageDrawerContentProps, "onCloseClick"> {
Expand Down Expand Up @@ -182,6 +182,13 @@ const TabDetailsContent: React.FC<{
.filter((fullArchetype) => fullArchetype?.review)
.filter(Boolean);

const { task, isFetching, fetchError, refetch } = useFetchTaskByID(
DvoraShechter1 marked this conversation as resolved.
Show resolved Hide resolved
application.tasks.currentAnalyzer?.id
);
const targets = task?.data?.rules?.labels?.included.filter((t) =>
t.startsWith("konveyor.io/target=")
);

return (
<>
<TextContent className={`${spacing.mtMd} ${spacing.mbMd}`}>
Expand Down Expand Up @@ -303,6 +310,12 @@ const TabDetailsContent: React.FC<{
onEditClick={onEditClick}
onCloseClick={onCloseClick}
/>
<TextContent className={spacing.mtLg}>
Copy link
Member

Choose a reason for hiding this comment

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

Since this is talking about the targets for an analysis, this content should be on the Reports tab.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sjd78, @rszwajko, the information was added to the app details tab according to this issue: #2012
Could you please confirm where it should be added? Thanks

<Title headingLevel="h3" size="md">
{t("terms.targets")}
</Title>
{targets?.map((t) => <Text component="small">{t}</Text>)}
DvoraShechter1 marked this conversation as resolved.
Show resolved Hide resolved
</TextContent>
</>
);
};
Expand Down
Loading