Skip to content

Commit

Permalink
🐛 Fix sorting on application inventory tables
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Turley <[email protected]>
  • Loading branch information
mturley committed Sep 25, 2023
1 parent 70c029b commit 2410175
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -551,7 +557,7 @@ export const ApplicationsTableAnalyze: React.FC = () => {
</ToolbarItem>
</ToolbarContent>
</Toolbar>
<Table {...tableProps} isExpandable aria-label="App analysis table">
<Table {...tableProps} aria-label="App analysis table">
<Thead>
<Tr>
<TableHeaderContentWithControls {...tableControls}>
Expand All @@ -560,6 +566,7 @@ export const ApplicationsTableAnalyze: React.FC = () => {
<Th {...getThProps({ columnKey: "businessService" })} />
<Th {...getThProps({ columnKey: "analysis" })} />
<Th {...getThProps({ columnKey: "tags" })} />
<Th />
</TableHeaderContentWithControls>
</Tr>
</Thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -576,7 +582,7 @@ export const ApplicationsTable: React.FC = () => {
</ToolbarItem>
</ToolbarContent>
</Toolbar>
<Table {...tableProps} isExpandable aria-label="App assessments table">
<Table {...tableProps} aria-label="App assessments table">
<Thead>
<Tr>
<TableHeaderContentWithControls {...tableControls}>
Expand All @@ -586,6 +592,7 @@ export const ApplicationsTable: React.FC = () => {
<Th {...getThProps({ columnKey: "assessment" })} />
<Th {...getThProps({ columnKey: "review" })} />
<Th {...getThProps({ columnKey: "tags" })} />
<Th />
</TableHeaderContentWithControls>
</Tr>
</Thead>
Expand Down

0 comments on commit 2410175

Please sign in to comment.