From 06d6551cc1f9cab5ec3288e1930a9c03eb341316 Mon Sep 17 00:00:00 2001 From: Scott Dickerson Date: Wed, 15 Nov 2023 15:51:13 -0500 Subject: [PATCH 1/7] :sparkles: Regroup the dependencies table on name only, version/sha shown in details (#1536) Resolves: #1338 Resolves: https://issues.redhat.com/browse/MTA-1585 Depends on hub change https://github.com/konveyor/tackle2-hub/issues/557 / https://github.com/konveyor/tackle2-hub/pull/558. Summary of changes: - The dependency table will show a single row for every named dependency. - Multiple versions will be aggregated as a single row. - Details about multiple versions will be available in the details drawer. - The details view application table will show the application + version, allowing for all versions used to be listed. --------- Signed-off-by: Scott J Dickerson --- client/src/app/api/models.ts | 13 +- .../app/pages/dependencies/dependencies.tsx | 125 ++++++------------ .../dependencies/dependency-apps-table.tsx | 2 - 3 files changed, 49 insertions(+), 91 deletions(-) diff --git a/client/src/app/api/models.ts b/client/src/app/api/models.ts index 5191e8aa8e..09a2e85683 100644 --- a/client/src/app/api/models.ts +++ b/client/src/app/api/models.ts @@ -503,13 +503,10 @@ export interface TrackerProjectIssuetype { } export interface AnalysisDependency { - createTime: string; - name: string; provider: string; - version: string; - sha: string; - applications: number; + name: string; labels: string[]; + applications: number; } export interface AnalysisAppDependency { @@ -519,12 +516,12 @@ export interface AnalysisAppDependency { businessService: string; dependency: { id: number; + provider: string; name: string; version: string; - provider: string; + sha: string; indirect: boolean; - //TODO: Glean from labels somehow - // management?: string; + labels: string[]; }; } diff --git a/client/src/app/pages/dependencies/dependencies.tsx b/client/src/app/pages/dependencies/dependencies.tsx index 648397c7a5..c61e145fd0 100644 --- a/client/src/app/pages/dependencies/dependencies.tsx +++ b/client/src/app/pages/dependencies/dependencies.tsx @@ -79,31 +79,10 @@ export const Dependencies: React.FC = () => { }) + "...", getServerFilterValue: (value) => (value ? [`*${value[0]}*`] : []), }, - { - key: "version", - title: t("terms.version"), - type: FilterType.search, - filterGroup: "Dependency", - placeholderText: - t("actions.filterBy", { - what: t("terms.label").toLowerCase(), - }) + "...", - getServerFilterValue: (value) => (value ? [`*${value[0]}*`] : []), - }, - { - key: "sha", - title: "SHA", - type: FilterType.search, - filterGroup: "Dependency", - placeholderText: - t("actions.filterBy", { - what: t("terms.name").toLowerCase(), - }) + "...", - getServerFilterValue: (value) => (value ? [`*${value[0]}*`] : []), - }, ], initialItemsPerPage: 10, }); + const { result: { data: currentPageItems, total: totalItemCount }, isFetching, @@ -179,8 +158,6 @@ export const Dependencies: React.FC = () => { - - @@ -190,63 +167,49 @@ export const Dependencies: React.FC = () => { isNoData={totalItemCount === 0} numRenderedColumns={numRenderedColumns} > - {currentPageItems?.map((dependency, rowIndex) => { - return ( - - - - - {dependency.name} - - - - - - {dependency.provider} - - - - {dependency?.labels?.map((label) => { - return ; - })} - - - + {currentPageItems?.map((dependency, rowIndex) => ( + + + + {dependency.name} + + + + + + {dependency.provider} + + + + {dependency?.labels?.map((label, index) => ( + + ))} + + + + + ))} + { setActiveItem(null)} - > + /> ); }; diff --git a/client/src/app/pages/dependencies/dependency-apps-table.tsx b/client/src/app/pages/dependencies/dependency-apps-table.tsx index 2107ca18eb..0e58a97e4c 100644 --- a/client/src/app/pages/dependencies/dependency-apps-table.tsx +++ b/client/src/app/pages/dependencies/dependency-apps-table.tsx @@ -106,8 +106,6 @@ export const DependencyAppsTable: React.FC = ({ }, implicitFilters: [ { field: "dep.name", operator: "=", value: dependency.name }, - { field: "dep.version", operator: "=", value: dependency.version }, - { field: "dep.sha", operator: "=", value: dependency.sha }, ], }) ); From d142fdd7dbbc78157ee0138899c72870f4fa0a88 Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Wed, 15 Nov 2023 16:20:04 -0500 Subject: [PATCH 2/7] :sparkles: Add management column for application dependencies table (#1541) - Add management column for application dependencies table - Add parsed label conversion for dependency labels https://github.com/konveyor/tackle2-ui/issues/1339 Depends on https://github.com/konveyor/tackle2-addon-analyzer/pull/62 Signed-off-by: ibolton336 --- .../app/pages/dependencies/dependencies.tsx | 12 ++++-- .../dependencies/dependency-apps-table.tsx | 37 +++++++++++++++---- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/client/src/app/pages/dependencies/dependencies.tsx b/client/src/app/pages/dependencies/dependencies.tsx index c61e145fd0..df9c9d3591 100644 --- a/client/src/app/pages/dependencies/dependencies.tsx +++ b/client/src/app/pages/dependencies/dependencies.tsx @@ -31,6 +31,7 @@ import { useSelectionState } from "@migtools/lib-ui"; import { DependencyAppsDetailDrawer } from "./dependency-apps-detail-drawer"; import { useSharedAffectedApplicationFilterCategories } from "../issues/helpers"; import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; +import { getParsedLabel } from "@app/utils/rules-utils"; export const Dependencies: React.FC = () => { const { t } = useTranslation(); @@ -201,9 +202,14 @@ export const Dependencies: React.FC = () => { - {dependency?.labels?.map((label, index) => ( - - ))} + {dependency?.labels?.map((label) => { + if (getParsedLabel(label).labelType !== "language") + return ( + + ); + })} diff --git a/client/src/app/pages/dependencies/dependency-apps-table.tsx b/client/src/app/pages/dependencies/dependency-apps-table.tsx index 0e58a97e4c..3dda528072 100644 --- a/client/src/app/pages/dependencies/dependency-apps-table.tsx +++ b/client/src/app/pages/dependencies/dependency-apps-table.tsx @@ -1,10 +1,15 @@ import * as React from "react"; import { useTranslation } from "react-i18next"; -import { Toolbar, ToolbarContent, ToolbarItem } from "@patternfly/react-core"; +import { + TextContent, + Toolbar, + ToolbarContent, + ToolbarItem, +} from "@patternfly/react-core"; import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table"; import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; import { useSelectionState } from "@migtools/lib-ui"; -import { AnalysisDependency } from "@app/api/models"; +import { AnalysisAppDependency, AnalysisDependency } from "@app/api/models"; import { useTableControlState, useTableControlProps, @@ -21,6 +26,7 @@ import { FilterToolbar, FilterType } from "@app/components/FilterToolbar"; import { useFetchAppDependencies } from "@app/queries/dependencies"; import { useFetchBusinessServices } from "@app/queries/businessservices"; import { useFetchTagsWithTagItems } from "@app/queries/tags"; +import { getParsedLabel } from "@app/utils/rules-utils"; export interface IDependencyAppsTableProps { dependency: AnalysisDependency; @@ -39,7 +45,7 @@ export const DependencyAppsTable: React.FC = ({ columnNames: { name: "Application", version: "Version", - // management (3rd party or not boolean... parsed from labels) + management: "Management", relationship: "Relationship", }, isFilterEnabled: true, @@ -158,10 +164,10 @@ export const DependencyAppsTable: React.FC = ({ - {/* */} + /> = ({ > {appDependency.dependency.version} - {/* - {appDependency.management} - */} + + = ({ ); }; + +const DependencyManagementColumn = ({ + appDependency, +}: { + appDependency: AnalysisAppDependency; +}) => { + const hasJavaLabel = appDependency.dependency?.labels?.some((label) => { + const labelValue = getParsedLabel(label).labelValue; + return labelValue === "java"; + }); + const isJavaFile = appDependency.dependency.name.endsWith(".jar"); + const isJavaDependency = hasJavaLabel && isJavaFile; + + return {isJavaDependency ? "Managed" : "Embedded"}; +}; From f112198cfddd8ab4e2fc9bc98ddf8c09a5d1cce4 Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Wed, 15 Nov 2023 16:42:42 -0500 Subject: [PATCH 3/7] :bug: Consistent search input ID for QE (#1543) - Requested by QE Signed-off-by: ibolton336 --- client/src/app/components/FilterToolbar/SearchFilterControl.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/components/FilterToolbar/SearchFilterControl.tsx b/client/src/app/components/FilterToolbar/SearchFilterControl.tsx index d34f9b0751..33c782af4e 100644 --- a/client/src/app/components/FilterToolbar/SearchFilterControl.tsx +++ b/client/src/app/components/FilterToolbar/SearchFilterControl.tsx @@ -51,7 +51,7 @@ export const SearchFilterControl = ({ setInputValue(value)} aria-label={`${category.title} filter`} From d83857156a56457f0eee6485b4265c15cf3e6c9f Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Wed, 15 Nov 2023 16:44:38 -0500 Subject: [PATCH 4/7] :sparkles: Add link for jira ticket in drawer view (#1546) - Adds missing link for https://issues.redhat.com/browse/MTA-1539 ![image](https://github.com/konveyor/tackle2-ui/assets/11218376/ebe510fa-c198-4451-9abf-a0fe850e923f) --------- Signed-off-by: ibolton336 --- client/src/app/api/models.ts | 1 + .../application-detail-fields.tsx | 52 ++++++++++++++++++- client/src/app/queries/migration-waves.ts | 3 +- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/client/src/app/api/models.ts b/client/src/app/api/models.ts index 09a2e85683..2f2c071027 100644 --- a/client/src/app/api/models.ts +++ b/client/src/app/api/models.ts @@ -619,6 +619,7 @@ export interface Ticket { reference?: string | null; readonly status?: TicketStatus | null; error?: boolean; + link?: string; } export type Role = "Owner" | "Contributor" | null; 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 index 33acc20d92..fd1a083491 100644 --- 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 @@ -8,12 +8,16 @@ import { Button, Grid, GridItem, + Spinner, } 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"; +import { useFetchTickets } from "@app/queries/tickets"; +import { useDeleteTicketMutation } from "@app/queries/migration-waves"; +import { UnlinkIcon } from "@patternfly/react-icons"; export const ApplicationDetailFields: React.FC<{ application: Application | null; @@ -21,7 +25,11 @@ export const ApplicationDetailFields: React.FC<{ onCloseClick: () => void; }> = ({ application, onEditClick, onCloseClick }) => { const { t } = useTranslation(); - + const { tickets } = useFetchTickets(); + const { mutate: deleteTicket, isLoading } = useDeleteTicketMutation(); + const matchingTicket = tickets?.find( + (ticket) => ticket.application?.id === application?.id + ); return ( <> @@ -143,11 +151,51 @@ export const ApplicationDetailFields: React.FC<{ {t("terms.migrationWave")} - + + Wave name{": "} + + {application?.migrationWave ? application.migrationWave.name : t("terms.unassigned")} +
+ + Ticket{": "} + + + {matchingTicket ? ( + + {matchingTicket?.link} + + ) : ( + t("terms.unassigned") + )} + {matchingTicket?.id ? ( + isLoading ? ( + + ) : ( + - {!isFirstStep && ( + { - )} + }