Skip to content

Commit

Permalink
Make additional columns sortable and fix slider font
Browse files Browse the repository at this point in the history
Make the Country, Region, Stage, and Sector columns sortable (closes #274)

Fix the font in the floating labels for the sliders (closes #327)
  • Loading branch information
brianlove authored and jmelot committed May 22, 2024
1 parent 634350d commit 022231e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions web/gui-v2/src/components/HeaderSlider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const styles = {
height: 10px;
width: 10px;
}
.MuiSlider-valueLabel {
font-family: GTZirkonLight;
}
`,
};

Expand Down
2 changes: 1 addition & 1 deletion web/gui-v2/src/components/ListView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("ListView", () => {
// Filter by China and verify that the count updates
expect(screen.getByText('Viewing 632 companies')).toBeVisible();
const regionHeader = screen.getByRole('columnheader', { name: /country/i });
await user.click(getByRole(regionHeader, 'button'));
await user.click(getByRole(regionHeader, 'button', { name: /open/i }));
const menu = screen.getByRole('listbox');
await user.click(getByText(menu, 'China'));
expect(screen.getByText('Viewing 43 of 632 companies')).toBeVisible();
Expand Down
2 changes: 2 additions & 0 deletions web/gui-v2/src/components/ListViewTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,8 @@ const ListViewTable = ({
} else {
return 0;
}
} else if ( a?.[sortKey] === null || b?.[sortKey] === null ) {
return 0; // Workaround in case no country/region/etc is available
} else {
return a[sortKey].localeCompare(b[sortKey]) * direction;
}
Expand Down
4 changes: 4 additions & 0 deletions web/gui-v2/src/static_data/table_columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const columnDefinitions = [
css: columnWidth(120),
initialCol: true,
dropdownWidth: 180,
sortable: true,
type: 'dropdown',
tooltip: "Zach_tktk",
},
Expand All @@ -154,6 +155,7 @@ const columnDefinitions = [
css: columnWidth(100),
initialCol: false,
dropdownWidth: 170,
sortable: true,
type: 'dropdown',
tooltip: "Zach_tktk",
},
Expand All @@ -163,13 +165,15 @@ const columnDefinitions = [
css: columnWidth(80),
initialCol: false,
dropdownWidth: 120,
sortable: true,
type: 'dropdown',
tooltip: "Zach_tktk",
},
{
title: "Sector",
key: "sector",
initialCol: false,
sortable: true,
type: 'dropdown',
tooltip: "Zach_tktk",
},
Expand Down

0 comments on commit 022231e

Please sign in to comment.