Skip to content

Commit

Permalink
Fixed sorting for System List on dashboard and System Status Page | W…
Browse files Browse the repository at this point in the history
…P-228
  • Loading branch information
asimregmi committed Sep 20, 2023
1 parent e1f2d37 commit 83e8a1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
16 changes: 7 additions & 9 deletions client/src/components/SystemStatus/SystemStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ const root = `${ROUTES.WORKBENCH}${ROUTES.SYSTEM_STATUS}`;
const SystemStatusSidebar = ({ systemList }) => {
var sidebarItems = [];

systemList
.sort((a, b) => a.display_name.localeCompare(b.display_name))
.forEach((system) => {
sidebarItems.push({
to: `${root}/${system.hostname}`,
label: `${system.display_name}`,
disabled: false,
hidden: false,
});
systemList.forEach((system) => {
sidebarItems.push({
to: `${root}/${system.hostname}`,
label: `${system.display_name}`,
disabled: false,
hidden: false,
});
});

return <Sidebar sidebarItems={sidebarItems} />;
};
Expand Down
3 changes: 3 additions & 0 deletions client/src/redux/sagas/systemMonitor.sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ function* getSystemMonitor(action) {
const result = yield call(fetchUtil, {
url: '/api/system-monitor/',
});

result.sort((a, b) => a.display_name.localeCompare(b.display_name));

yield put({ type: 'SYSTEM_MONITOR_SUCCESS', payload: result });
} catch (error) {
yield put({
Expand Down

0 comments on commit 83e8a1a

Please sign in to comment.