From 19157a2f6937da7b2fbf3865007939e297abc7bb Mon Sep 17 00:00:00 2001 From: DvoraShechter1 Date: Mon, 28 Oct 2024 10:09:50 +0200 Subject: [PATCH 1/4] Add app details: Include a list of targets the project was checked against Signed-off-by: DvoraShechter1 --- .../application-detail-drawer.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx index 882578b58e..1b49e68117 100644 --- a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx +++ b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx @@ -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 { @@ -182,6 +182,13 @@ const TabDetailsContent: React.FC<{ .filter((fullArchetype) => fullArchetype?.review) .filter(Boolean); + const { task, isFetching, fetchError, refetch } = useFetchTaskByID( + application.tasks.currentAnalyzer?.id + ); + const targets = task?.data?.rules?.labels?.included.filter((t) => + t.startsWith("konveyor.io/target=") + ); + return ( <> @@ -303,6 +310,12 @@ const TabDetailsContent: React.FC<{ onEditClick={onEditClick} onCloseClick={onCloseClick} /> + + + Targets + + {targets?.map((t) => {t})} + ); }; From fdff1cd1304f2c09efc7306c615b27b71416db8c Mon Sep 17 00:00:00 2001 From: DvoraShechter1 Date: Mon, 28 Oct 2024 10:09:50 +0200 Subject: [PATCH 2/4] Add app details: Include a list of targets the project was checked against Signed-off-by: DvoraShechter1 --- .../application-detail-drawer.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx index 882578b58e..1b49e68117 100644 --- a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx +++ b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx @@ -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 { @@ -182,6 +182,13 @@ const TabDetailsContent: React.FC<{ .filter((fullArchetype) => fullArchetype?.review) .filter(Boolean); + const { task, isFetching, fetchError, refetch } = useFetchTaskByID( + application.tasks.currentAnalyzer?.id + ); + const targets = task?.data?.rules?.labels?.included.filter((t) => + t.startsWith("konveyor.io/target=") + ); + return ( <> @@ -303,6 +310,12 @@ const TabDetailsContent: React.FC<{ onEditClick={onEditClick} onCloseClick={onCloseClick} /> + + + Targets + + {targets?.map((t) => {t})} + ); }; From c49b608db656be3f52f1a3ab497e25a4c694c6cd Mon Sep 17 00:00:00 2001 From: sarinailinger Date: Mon, 28 Oct 2024 15:34:55 +0200 Subject: [PATCH 3/4] Translation support Signed-off-by: sarinailinger --- client/public/locales/en/translation.json | 1 + .../application-detail-drawer/application-detail-drawer.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index 6942e06e7d..c0a6eb3dd3 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -477,6 +477,7 @@ "tagsAssessment": "Assessment Tags", "tagsCriteria": "Criteria Tags", "target": "Target", + "targets": "Targets", "tagCategory": "Tag category", "tagCategoryDeleted": "Tag category deleted", "tagCategories": "Tag categories", diff --git a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx index 1b49e68117..a01bff258a 100644 --- a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx +++ b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx @@ -312,7 +312,7 @@ const TabDetailsContent: React.FC<{ /> - Targets + {t("terms.targets")} {targets?.map((t) => {t})} From b8399caf6b83e3a6f7202f8656f35f7f2f08aa04 Mon Sep 17 00:00:00 2001 From: DvoraShechter1 Date: Thu, 31 Oct 2024 10:06:06 +0200 Subject: [PATCH 4/4] Refactored useFetchTaskByID to only define used variables; added key attribute to mapped components and 'Not available' message for empty analysis. Signed-off-by: DvoraShechter1 --- .../application-detail-drawer.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx index a01bff258a..81b8299b4c 100644 --- a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx +++ b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer.tsx @@ -182,9 +182,7 @@ const TabDetailsContent: React.FC<{ .filter((fullArchetype) => fullArchetype?.review) .filter(Boolean); - const { task, isFetching, fetchError, refetch } = useFetchTaskByID( - application.tasks.currentAnalyzer?.id - ); + const { task } = useFetchTaskByID(application.tasks.currentAnalyzer?.id); const targets = task?.data?.rules?.labels?.included.filter((t) => t.startsWith("konveyor.io/target=") ); @@ -314,7 +312,13 @@ const TabDetailsContent: React.FC<{ {t("terms.targets")} - {targets?.map((t) => {t})} + {targets?.map((t) => ( + + {t} + + ))} + {targets?.length == 0 || + (!targets && )} );