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 4b98a5636..9ae1466bf 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 @@ -41,7 +41,6 @@ import { useFetchIdentities } from "@app/queries/identities"; import { useSetting } from "@app/queries/settings"; import { getKindIdByRef } from "@app/utils/model-utils"; import DownloadButton from "./components/download-button"; -import { useFetchApplications } from "@app/queries/applications"; import CheckCircleIcon from "@patternfly/react-icons/dist/esm/icons/check-circle-icon"; import ExclamationCircleIcon from "@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon"; import { ApplicationFacts } from "./application-facts"; @@ -78,7 +77,6 @@ export const ApplicationDetailDrawer: React.FC< const isTaskRunning = task?.state === "Running"; const { identities } = useFetchIdentities(); - const { data: applications } = useFetchApplications(); const { facts, isFetching } = useFetchFacts(application?.id); const [taskIdToView, setTaskIdToView] = React.useState(); @@ -91,9 +89,6 @@ export const ApplicationDetailDrawer: React.FC< const notAvailable = ; - const updatedApplication = applications?.find( - (app) => app.id === application?.id - ); const enableDownloadSetting = useSetting("download.html.enabled"); return ( @@ -102,302 +97,311 @@ export const ApplicationDetailDrawer: React.FC< onCloseClick={onCloseClick} focusKey={application?.id} pageKey="app-inventory" + header={ + + + {t("terms.name")} + + + {application?.name} + + + } > - - - {t("terms.name")} - - - {application?.name} - - - setActiveTabKey(tabKey as TabKey)} - className={spacing.mtLg} - > - {t("terms.details")}} +
+ setActiveTabKey(tabKey as TabKey)} + className={spacing.mtLg} > - - {application?.description} - - {application ? ( - <> - - - Issues - - - - - Dependencies - - - - ) : null} - - - {t("terms.effort")} - - - - {application?.effort !== 0 && application?.effort !== undefined - ? application?.effort - : t("terms.unassigned")} - - - - <> - - {t("terms.archetypes")} - - - - - {t("terms.associatedArchetypes")} - - - {application?.archetypes?.length ?? 0 > 0 ? ( - - ) : ( - - )} - - - - - {t("terms.archetypesReviewed")} - - - {application?.archetypes?.length ?? 0 > 0 ? ( - application?.archetypes?.map((archetypeRef) => ( - - )) - ) : ( - - )} - - - - + {t("terms.details")}} + > + + {application?.description} + + {application ? ( + <> + + + Issues + + + + + Dependencies + + + + ) : null} + - {t("terms.riskFromApplication")} + {t("terms.effort")} - - + + + {application?.effort !== 0 && + application?.effort !== undefined + ? application?.effort + : t("terms.unassigned")} + - - - - - Tags}> - {application && isTaskRunning ? ( - - - - {t("message.taskInProgressForTags")} - + <> + + {t("terms.archetypes")} + + + + + {t("terms.associatedArchetypes")} + + + {application?.archetypes?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + {t("terms.archetypesReviewed")} + + + {application?.archetypes?.length ?? 0 > 0 ? ( + application?.archetypes?.map((archetypeRef) => ( + + )) + ) : ( + + )} + + + + + + {t("terms.riskFromApplication")} + + + - - ) : null} + + + - {application ? : null} - + Tags}> + {application && isTaskRunning ? ( + + + + {t("message.taskInProgressForTags")} + + + + + ) : null} - {t("terms.reports")}} - > - - - Credentials - - {matchingSourceCredsRef && matchingMavenCredsRef ? ( - - - Source and Maven - - ) : matchingMavenCredsRef ? ( - - - Maven - - ) : matchingSourceCredsRef ? ( - - - Source - - ) : ( - notAvailable - )} - - Analysis - - {task?.state === "Succeeded" && application ? ( - <> - - - Details - - - + + + Download + + setTaskIdToView(task.id)} - className={spacing.ml_0} - style={{ margin: "0", padding: "0" }} + position="top" > - View analysis details - - - - Download - - - - HTML - - - {" | "} - - + HTML + + + {" | "} + - YAML - - - - - - - - ) : task?.state === "Failed" ? ( - task ? ( - <> - + + YAML + + + + + + - ) : ( - - - Failed - - ) - ) : ( - <> - {task ? ( - + ) : task?.state === "Failed" ? ( + task ? ( + <> + + ) : ( - notAvailable - )} - + + + Failed + + ) + ) : ( + <> + {task ? ( + + ) : ( + notAvailable + )} + + )} + + title={`Analysis details for ${application?.name}`} + fetch={getTaskById} + documentId={taskIdToView} + onClose={() => { + setTaskIdToView(undefined); + }} + /> + + {!isFetching && !!facts.length && ( + )} - - title={`Analysis details for ${application?.name}`} - fetch={getTaskById} - documentId={taskIdToView} - onClose={() => { - setTaskIdToView(undefined); - }} - /> - - {!isFetching && !!facts.length && } - - {t("terms.reviews")}} - > - - - + + {t("terms.reviews")}} + > + + + +
); }; diff --git a/client/src/app/pages/archetypes/components/archetype-detail-drawer.tsx b/client/src/app/pages/archetypes/components/archetype-detail-drawer.tsx index 5b3410215..b8bde1f2a 100644 --- a/client/src/app/pages/archetypes/components/archetype-detail-drawer.tsx +++ b/client/src/app/pages/archetypes/components/archetype-detail-drawer.tsx @@ -76,146 +76,147 @@ const ArchetypeDetailDrawer: React.FC = ({ } > - setActiveTabKey(tabKey as TabKey)} - > - {t("terms.details")}} +
+ setActiveTabKey(tabKey as TabKey)} > - - - - {t("terms.description")} - - - {archetype?.description || ( - - )} - - - - - - {t("terms.applications")} - - - {archetype?.applications?.length ?? 0 > 0 ? ( - - ) : ( - - )} - - - - - - {t("terms.tagsCriteria")} - - - {archetype?.criteria?.length ?? 0 > 0 ? ( - - ) : ( - - )} - - - - - - {t("terms.tagsArchetype")} - - - {manualTags.length > 0 ? ( - - ) : ( - - )} - - - - - - {t("terms.tagsAssessment")} - - - {assessmentTags.length > 0 ? ( - - ) : ( - - )} - - - - - - {t("terms.maintainers")} - - - - - - {t("terms.stakeholder(s)")} - - - - {archetype?.stakeholders?.length ?? 0 > 0 ? ( - - ) : ( - - )} - - - - - - - - {t("terms.stakeholderGroup(s)")} - - - - {archetype?.stakeholderGroups?.length ?? 0 > 0 ? ( - - ) : ( - - )} - - - - - - - {t("terms.comments")} - - {archetype?.comments || ( - - )} - - - - - - {t("terms.riskFromArchetype")} - - - - - - - {t("terms.review")}} - > - - - - + {t("terms.details")}} + > + + + + {t("terms.description")} + + + {archetype?.description || ( + + )} + + + + + + {t("terms.applications")} + + + {archetype?.applications?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + + {t("terms.tagsCriteria")} + + + {archetype?.criteria?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + + {t("terms.tagsArchetype")} + + + {manualTags.length > 0 ? ( + + ) : ( + + )} + + + + + + {t("terms.tagsAssessment")} + + + {assessmentTags.length > 0 ? ( + + ) : ( + + )} + + + + + + {t("terms.maintainers")} + + + + + + {t("terms.stakeholder(s)")} + + + + {archetype?.stakeholders?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + + + + {t("terms.stakeholderGroup(s)")} + + + + {archetype?.stakeholderGroups?.length ?? 0 > 0 ? ( + + ) : ( + + )} + + + + + + + {t("terms.comments")} + + {archetype?.comments || ( + + )} + + + + + + {t("terms.riskFromArchetype")} + + + + + + + {t("terms.review")}} + > + + + +
{/* TODO: action buttons -- primary: "Close", link: "Edit archetype" */} );