From fbd5e60117674bcfe6091acc2d25d09531fb3eb6 Mon Sep 17 00:00:00 2001 From: Mike Turley Date: Mon, 25 Sep 2023 13:19:05 -0400 Subject: [PATCH] :bug: Fix sorting on application inventory tables, misc cleanup in these tables (#1396) * The `getSortValues` property was missing from these two tables which turned sorting into a noop. * The `isExpandable` prop was present on the analysis table even though it is no longer expandable. * There was a missing empty `` in each of these tables to correspond to the edit-pencil column. (perhaps `hasActionsColumn` is a bad idea since it makes us incorrectly assume the column counts will always be aligned for us?) Signed-off-by: Mike Turley --- .../applications-table-analyze.tsx | 9 ++++++++- .../applications-table-assessment.tsx | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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 37c81d2c77..eaa2b03bd1 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 @@ -198,6 +198,12 @@ export const ApplicationsTableAnalyze: React.FC = () => { }, sortableColumns: ["name", "description", "businessService", "tags"], initialSort: { columnKey: "name", direction: "asc" }, + getSortValues: (app) => ({ + name: app.name, + description: app.description || "", + businessService: app.businessService?.name || "", + tags: app.tags?.length || 0, + }), filterCategories: [ { key: "name", @@ -551,7 +557,7 @@ export const ApplicationsTableAnalyze: React.FC = () => { - +
@@ -560,6 +566,7 @@ export const ApplicationsTableAnalyze: React.FC = () => { 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 c9bfc6cbf7..f641c5ee29 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 @@ -244,6 +244,12 @@ export const ApplicationsTable: React.FC = () => { }, sortableColumns: ["name", "description", "businessService", "tags"], initialSort: { columnKey: "name", direction: "asc" }, + getSortValues: (app) => ({ + name: app.name, + description: app.description || "", + businessService: app.businessService?.name || "", + tags: app.tags?.length || 0, + }), filterCategories: [ { key: "name", @@ -576,7 +582,7 @@ export const ApplicationsTable: React.FC = () => { -
+
+
@@ -586,6 +592,7 @@ export const ApplicationsTable: React.FC = () => {
+