diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index be1447e111..ea942eeb76 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -236,6 +236,7 @@ "applicationImports": "Application imports", "applicationName": "Application name", "archetypeName": "Archetype name", + "applicationInformation": "Application information", "applications": "Applications", "archetype": "Archetype", "archetypes": "Archetypes", @@ -248,6 +249,7 @@ "assessmentSummary": "Assessment summary", "autoTagging": "Automated Tagging", "binary": "Binary", + "branch": "Branch", "binaryArtifact": "Artifact", "binaryGroup": "Group", "binaryPackaging": "Packaging", @@ -360,6 +362,7 @@ "reviewComments": "Review comments", "risk": "Risk", "riskFromApplication": "Application risk", + "rootPath": "Root path", "scheduled": "Scheduled", "select": "Select", "settingsAllowApps": "Allow reviewing applications without running an assessment first", diff --git a/client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx b/client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx index 745e106ccf..b57a170f21 100644 --- a/client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx +++ b/client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx @@ -770,6 +770,9 @@ export const ApplicationsTableAnalyze: React.FC = () => { application={activeItem} applications={applications} onCloseClick={clearActiveItem} + onEditClick={() => { + setSaveApplicationModalState(activeItem); + }} task={activeItem ? getTask(activeItem) : null} /> diff --git a/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx b/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx index ce716b58c9..29c7cffc02 100644 --- a/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx +++ b/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx @@ -791,6 +791,7 @@ export const ApplicationsTable: React.FC = () => { setSaveApplicationModalState(activeItem)} task={activeItem ? getTask(activeItem) : null} /> { task: Task | undefined | null; } export const ApplicationDetailDrawerAnalysis: React.FC< IApplicationDetailDrawerAnalysisProps -> = ({ application, applications, onCloseClick, task }) => { +> = ({ application, applications, onCloseClick, task, onEditClick }) => { const { t } = useTranslation(); const { identities } = useFetchIdentities(); @@ -69,16 +69,7 @@ export const ApplicationDetailDrawerAnalysis: React.FC< task={task} application={updatedApplication || null} onCloseClick={onCloseClick} - detailsTabMainContent={ - - - {t("terms.comments")} - - - {application?.comments || notAvailable} - - - } + onEditClick={onEditClick} reportsTabContent={ diff --git a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-assessment.tsx b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-assessment.tsx index 67218dfc44..acd1a79ed4 100644 --- a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-assessment.tsx +++ b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-drawer-assessment.tsx @@ -8,7 +8,6 @@ import { TextContent, Text, Title, - Label, } from "@patternfly/react-core"; import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; @@ -24,13 +23,16 @@ import { RiskLabel } from "@app/components/RiskLabel"; import { LabelsFromItems } from "@app/components/labels-from-items/labels-from-items"; export interface IApplicationDetailDrawerAssessmentProps - extends Pick<IApplicationDetailDrawerProps, "application" | "onCloseClick"> { + extends Pick< + IApplicationDetailDrawerProps, + "application" | "onCloseClick" | "onEditClick" + > { task: Task | undefined | null; } export const ApplicationDetailDrawerAssessment: React.FC< IApplicationDetailDrawerAssessmentProps -> = ({ application, onCloseClick, task }) => { +> = ({ application, onCloseClick, task, onEditClick }) => { const { t } = useTranslation(); return ( @@ -38,7 +40,8 @@ export const ApplicationDetailDrawerAssessment: React.FC< application={application} task={task} onCloseClick={onCloseClick} - detailsTabMainContent={ + onEditClick={onEditClick} + detailTabContent={ <> <Title headingLevel="h3" size="md"> {t("terms.archetypes")} @@ -88,14 +91,6 @@ export const ApplicationDetailDrawerAssessment: React.FC< <Text component="small" cy-data="comments"> <RiskLabel risk={application?.risk || "unknown"} /> </Text> - <Title headingLevel="h3" size="md"> - {t("terms.commentsFromApplication")} - - - {application?.comments || ( - - )} - } 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 3627375c33..7050a0f029 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 @@ -24,18 +24,19 @@ import { getDependenciesUrlFilteredByAppName, getIssuesSingleAppSelectedLocation, } from "@app/pages/issues/helpers"; -import { ApplicationBusinessService } from "../application-business-service"; import { ApplicationTags } from "../application-tags"; +import { ApplicationDetailFields } from "./application-detail-fields"; export interface IApplicationDetailDrawerProps extends Pick { application: Application | null; task: Task | undefined | null; applications?: Application[]; - detailsTabMainContent: React.ReactNode; + detailTabContent?: React.ReactNode; reportsTabContent?: React.ReactNode; factsTabContent?: React.ReactNode; reviewsTabContent?: React.ReactNode; + onEditClick: () => void; } enum TabKey { @@ -50,9 +51,10 @@ export const ApplicationDetailDrawer: React.FC< IApplicationDetailDrawerProps > = ({ onCloseClick, + onEditClick, application, task, - detailsTabMainContent, + detailTabContent = null, reportsTabContent = null, factsTabContent = null, reviewsTabContent = null, @@ -112,35 +114,24 @@ export const ApplicationDetailDrawer: React.FC< ) : null} - - {t("terms.businessService")} - - - {application?.businessService ? ( - - ) : ( - t("terms.unassigned") - )} - - - {t("terms.migrationWave")} - - - {application?.migrationWave - ? application.migrationWave.name - : t("terms.unassigned")} - {t("terms.effort")} - {application?.effort ?? t("terms.unassigned")} + + {application?.effort !== 0 && application?.effort !== undefined + ? application?.effort + : t("terms.unassigned")} + - {detailsTabMainContent} + {detailTabContent} + Tags}> diff --git a/client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx new file mode 100644 index 0000000000..9f8e4f9d22 --- /dev/null +++ b/client/src/app/pages/applications/components/application-detail-drawer/application-detail-fields.tsx @@ -0,0 +1,161 @@ +import React from "react"; +import { useTranslation } from "react-i18next"; +import { + Title, + TextContent, + Text, + TextVariants, + Button, + Grid, + GridItem, +} from "@patternfly/react-core"; +import { Application } from "@app/api/models"; +import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; +import { ApplicationBusinessService } from "../application-business-service"; +import { EmptyTextMessage } from "@app/components/EmptyTextMessage"; +import { EditIcon } from "@patternfly/react-icons"; + +export const ApplicationDetailFields: React.FC<{ + application: Application | null; + onEditClick: () => void; + onCloseClick: () => void; +}> = ({ application, onEditClick, onCloseClick }) => { + const { t } = useTranslation(); + + return ( + <> + + + + + {t("terms.applicationInformation")} + + + +