diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index 6942e06e7d..9a3c606662 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -108,6 +108,7 @@ "message": { "applicationsBulkDelete": "The selected application(s) will be deleted.", "delete": "This action cannot be undone.", + "deleteTooltipMessage": "Cannot remove a Job function associated with stakeholder(s)", "discardAssessment": "The assessment(s) for <1>{{applicationName}} will be discarded. Do you wish to continue?", "discardReview": "The review for <1>{{applicationName}} will be discarded. Do you wish to continue?", "leavePage": "Are you sure you want to leave this page? Be sure to save your changes, or they will be lost.", @@ -161,6 +162,10 @@ "medium": "Medium", "small": "Small" }, + "issues": { + "noIssues": "Congratulations! No issues were found", + "issuesFound": "{{minor}} minor, {{critical}} critical" + }, "message": { "archetypeApplicationCount": "{{count}} application", "archetypeApplicationCount_plural": "{{count}} applications", @@ -477,6 +482,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/public/locales/es/translation.json b/client/public/locales/es/translation.json index 2304a0cccb..b0efc5ab41 100644 --- a/client/public/locales/es/translation.json +++ b/client/public/locales/es/translation.json @@ -77,6 +77,7 @@ "message": { "applicationsBulkDelete": "Se eliminarán las aplicacione(s) seleccionadas.", "delete": "Esta acción no puede ser revertida.", + "deleteTooltipMessage": "No se puede eliminar una función de trabajo asociada con partes interesadas", "discardAssessment": "La evaluación para <1>{{applicationName}} será descartada, también los resultados de la revisión. ¿Deseas continuar?", "leavePage": "¿Estás seguro de querer salir de esta página? Asegúrate de guardar tus cambios o estos se perderán.", "pageError": "¡Ups! Algo salió mal.", 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..34f939b98d 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 @@ -34,6 +34,8 @@ import { Ref, Archetype, TaskDashboard, + AnalysisRuleReport, + AnalysisIssueReport, } from "@app/api/models"; import { COLOR_HEX_VALUES_BY_NAME } from "@app/Constants"; import { useFetchFacts } from "@app/queries/facts"; @@ -64,7 +66,8 @@ 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"; +import { useFetchIssueReports } from "@app/queries/issues"; export interface IApplicationDetailDrawerProps extends Pick { @@ -182,6 +185,26 @@ const TabDetailsContent: React.FC<{ .filter((fullArchetype) => fullArchetype?.review) .filter(Boolean); + const issueReportsQuery = useFetchIssueReports(application.id); + const { + result: { data, total: totalReportCount }, + isFetching: isFetchingReports, + fetchError: reportsFetchError, + } = issueReportsQuery; + const currentPageReports = data as ( + | AnalysisRuleReport + | AnalysisIssueReport + )[]; + const minor = currentPageReports.filter((u) => u.effort === 1).length; + const critical = currentPageReports.filter((u) => u.effort > 1).length; + + 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 ( <> @@ -194,6 +217,17 @@ const TabDetailsContent: React.FC<{ Issues + + {application.tasks.currentAnalyzer === undefined || + application.tasks.currentAnalyzer.state === "Failed" + ? t("terms.unassigned") + : currentPageReports.length === 0 + ? t("issues.noIssues") + : t("issues.issuesFound", { + minor: minor, + critical: critical, + })} + + + + {t("terms.Targets")} + + {targets?.map((t) => {t})} + ); }; diff --git a/client/src/app/pages/controls/job-functions/job-functions.tsx b/client/src/app/pages/controls/job-functions/job-functions.tsx index d6b76d6e2f..5de6341ae1 100644 --- a/client/src/app/pages/controls/job-functions/job-functions.tsx +++ b/client/src/app/pages/controls/job-functions/job-functions.tsx @@ -16,7 +16,6 @@ import { import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table"; import { AppPlaceholder } from "@app/components/AppPlaceholder"; -import { AppTableActionButtons } from "@app/components/AppTableActionButtons"; import { ConditionalRender } from "@app/components/ConditionalRender"; import { ConfirmDialog } from "@app/components/ConfirmDialog"; import { getAxiosErrorMessage } from "@app/utils/utils"; @@ -37,6 +36,7 @@ import { import { useLocalTableControls } from "@app/hooks/table-controls"; import { CubesIcon } from "@patternfly/react-icons"; import { RBAC, RBAC_TYPE, controlsWriteScopes } from "@app/rbac"; +import { ControlTableActionButtons } from "../ControlTableActionButtons"; export const JobFunctions: React.FC = () => { const { t } = useTranslation(); @@ -215,9 +215,9 @@ export const JobFunctions: React.FC = () => { {jobFunction.name} - setCreateUpdateModalState(jobFunction)} onDelete={() => deleteRow(jobFunction)} />