-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task/tup 514 merging content layout system status (#266)
* Add hooks for system queue response * New System Monitor Page with Job queue details * View All systems button only renders when a job queue is selected now * Format check * Linting components removing un-used components Added error message table to system queues * Linting * Updated button to system monitor to not reload page * Removed unused imports from tests * Added keys to NavBar to stop console error * TUP 514 System Detail Updates * Select Frontera Nav Item if no system selected * Linting * To change header of sysmon depending if on dash or sysmon page * Linting * feat: support smaller windows (#256) * Task/TUP-457/TUP-514 Add System Queue Details - content layout - phase 2 (#258) * fix: move @import to top of file * fix: bad merge * Changed route from system_monitor to system-status and updated tests * Changed from system_monitor to system-status and updated tests * - Create header component for system status - Created systemdetails prop to be able to use default prop for default system display - Removed unnnecessary styles - Removed app SystemDetail to let System handle all the app side of the system monitor page * Format check * Updated logic on system monitor table * Added styles back to app/tup-ui/pages and removed redundant styles from libs/tup-components * Linting * Updated tests for System Status * Updated tests for System Status including new handler and mock data * Linting * Task/tup 514 merging content layout system status - remove UI cruft (#267) --------- Co-authored-by: Jake Rosenberg <[email protected]> Co-authored-by: Wesley B <[email protected]> Co-authored-by: Wesley Bomar <[email protected]>
- Loading branch information
1 parent
11bf57b
commit cdd8845
Showing
25 changed files
with
498 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.system-section { | ||
display: grid; | ||
} | ||
|
||
.system-section > div > header { | ||
padding-top: var(--global-space--section-top); | ||
padding-left: var(--global-space--section-left); | ||
} | ||
|
||
.system-section nav { | ||
margin-top: -15px; | ||
height: 100%; | ||
min-width: 175px; | ||
padding-top: var(--global-space--section-top); | ||
border-right:var(--global-border-width--normal) solid var(--global-color-primary--light); | ||
} | ||
|
||
.system-section > div > nav { | ||
padding-left: var(--global-space--section-left); | ||
} | ||
|
||
.system-section > div > div { | ||
padding: var(--global-space--section); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import { | ||
PageLayout, | ||
RequireAuth, | ||
SystemNavBar, | ||
SystemDetails, | ||
SystemStatusHeader, | ||
} from '@tacc/tup-components'; | ||
import { useParams } from 'react-router-dom'; | ||
import styles from './Systems.module.css'; | ||
|
||
const Layout: React.FC = () => { | ||
// To get the System name for the Page Header | ||
const { tas_name } = useParams<{ tas_name: string }>(); | ||
return ( | ||
<RequireAuth> | ||
<section className={styles['system-section']}> | ||
<PageLayout | ||
top={<SystemStatusHeader tas_name={tas_name} />} | ||
left={<SystemNavBar tas_name={tas_name} />} | ||
right={<SystemDetails tas_name={tas_name} />} | ||
></PageLayout> | ||
</section> | ||
</RequireAuth> | ||
); | ||
}; | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { default as Systems } from './Systems'; | ||
|
||
export default Systems; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
libs/tup-components/src/system-status/SystemMonitor.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { SystemMonitor } from './SystemMonitor'; | ||
import { server, testRender } from '@tacc/tup-testing'; | ||
import { waitFor } from '@testing-library/react'; | ||
import { screen } from '@testing-library/react'; | ||
import { rest } from 'msw'; | ||
|
||
describe('System Monitor Component', () => { | ||
it('should display an error message if an error is returned', async () => { | ||
server.use( | ||
rest.get('http://localhost:8001/system_monitor', (req, res, ctx) => | ||
res.once(ctx.status(404)) | ||
) | ||
); | ||
testRender(<SystemMonitor />); | ||
await screen.findAllByText(/Unable to gather system information/); | ||
}); | ||
it('should display the title of table on dashboard', async () => { | ||
const { getByTestId, getByText } = testRender(<SystemMonitor />); | ||
await waitFor(() => expect(getByTestId('loading-spinner')).toBeDefined()); | ||
expect(getByText(/System Status/)).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
...src/system_monitor/SystemMonitorCells.tsx → .../src/system-status/SystemMonitorCells.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
libs/tup-components/src/system-status/details/SystemDetails.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@import url('@tacc/core-styles/src/lib/_imports/tools/media-queries.css'); | ||
|
||
.panels { | ||
display: grid; | ||
|
||
/* To reproduce complex layout of design doc */ | ||
@media (--wide-and-above) { | ||
gap: 25px; | ||
grid-template-columns: 0.5fr 0.5fr; | ||
grid-template-rows: auto 1fr; | ||
grid-template-areas: | ||
"monitor avgwait" | ||
"queue avgwait"; | ||
} | ||
/* To reproduce simple layout of narrow screens like CEPv2 */ | ||
@media (--wide-and-below) { | ||
row-gap: 25px; | ||
grid-template-rows: auto 1fr; | ||
grid-template-areas: | ||
"monitor" | ||
"queue"; | ||
/* TODO: When avgwait table exists, show it using something like this: *//* | ||
grid-template-rows: auto 1fr 1fr; | ||
grid-template-areas: | ||
"monitor" | ||
"queue" | ||
"avgwait"; | ||
*/ | ||
} | ||
} | ||
.panels > * { | ||
overflow: auto; /* to force items to stay within their grid cells */ | ||
} | ||
.panels > :nth-child(1) { grid-area: monitor; } | ||
.panels > :nth-child(2) { grid-area: queue; } | ||
.panels > :nth-child(3) { grid-area: avgwait; } |
35 changes: 35 additions & 0 deletions
35
libs/tup-components/src/system-status/details/SystemDetails.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { SystemDetails } from './SystemDetails'; | ||
import { server, testRender } from '@tacc/tup-testing'; | ||
import { waitFor } from '@testing-library/react'; | ||
import { screen } from '@testing-library/react'; | ||
import { rest } from 'msw'; | ||
|
||
describe('System Monitor Component', () => { | ||
it('should display an error message if an error is returned', async () => { | ||
server.use( | ||
rest.get( | ||
'http://localhost:8001/system_monitor/:tas_name', | ||
(req, res, ctx) => res.once(ctx.status(404)) | ||
) | ||
); | ||
testRender(<SystemDetails />); | ||
await screen.findAllByText(/System job queues are unavailable/); | ||
}); | ||
it('should display the headers of the tables', async () => { | ||
server.use( | ||
rest.get( | ||
'http://localhost:8001/system_monitor/:tas_name', | ||
(req, res, ctx) => res.once(ctx.status(200)) | ||
) | ||
); | ||
const { getByText, getAllByText } = testRender(<SystemDetails />); | ||
await waitFor(() => expect(getByText('System Status')).toBeDefined()); | ||
expect(getByText('Load')).toBeDefined(); | ||
expect(getAllByText('Running Jobs')).toBeDefined(); | ||
expect(getAllByText('Waiting Jobs')).toBeDefined(); | ||
expect(getByText('Queue')).toBeDefined(); | ||
expect(getByText('Status')).toBeDefined(); | ||
expect(getByText('Idle Nodes')).toBeDefined(); | ||
}); | ||
}); |
Oops, something went wrong.