This repository was archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 238
feat(ui): Implement Resources listing #8371
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
32320f0
Start implementing Resources page
bdauria 5127085
Merge remote-tracking branch 'origin/master' into skeleton-unified-vi…
bdauria a2aea5b
Add Listing to Resources
bdauria faf3d18
Merge branch 'MON-4789-unified-view' into skeleton-unified-view-page
bdauria a77b594
Implement more columns
bdauria f3d28b4
Finish up Listing columns
bdauria d53e854
Add Downtime Icon
bdauria db10fac
Implement sorting and filtering
bdauria 800ae09
Implement pagination and limit
bdauria 6250d43
Add pagination tests
bdauria 816f19e
Finish up listing tests
bdauria b1c77ac
Fix TypeScript errors
bdauria 826b56d
Remove mock endpoint
bdauria 3bfa7c4
Merge branch 'MON-4789-unified-view' into skeleton-unified-view-page
bdauria e28e836
Update packages
bdauria 63932fd
change API to beta
bdauria 2eb9e74
param made single element instead of array
bdauria 5ac983b
Re-order imports
bdauria a1b12ae
Remove jest config
bdauria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| const resourcesEndpoint = 'monitoring/resources'; | ||
|
|
||
| const buildParam = ({ name, value }): string => { | ||
| return `${name}=${JSON.stringify(value)}`; | ||
| }; | ||
|
|
||
| const buildResourcesEndpoint = ({ state, sort, page, limit }): string => { | ||
| const params = [ | ||
| { | ||
| name: 'state', | ||
| value: state, | ||
| }, | ||
| { name: 'sort_by', value: sort }, | ||
| { name: 'page', value: page }, | ||
| { name: 'limit', value: limit }, | ||
| ] | ||
| .filter(({ value }) => value !== undefined) | ||
| .map(buildParam) | ||
| .join('&'); | ||
|
|
||
| return `${resourcesEndpoint}?${params}`; | ||
| }; | ||
|
|
||
| export { buildResourcesEndpoint }; |
This file contains hidden or 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,19 @@ | ||
| import axios, { AxiosRequestConfig } from 'axios'; | ||
|
|
||
| import { buildResourcesEndpoint } from './endpoint'; | ||
| import { ResourceListing } from '../models'; | ||
|
|
||
| const api = axios.create({ | ||
| baseURL: './api/beta/', | ||
| }); | ||
|
|
||
| const getData = ({ endpoint, requestParams }): Promise<ResourceListing> => | ||
| api.get(endpoint, requestParams).then(({ data }) => data); | ||
|
|
||
| const listResources = ( | ||
| endpointParams, | ||
| requestParams: AxiosRequestConfig = {}, | ||
| ): Promise<ResourceListing> => | ||
| getData({ endpoint: buildResourcesEndpoint(endpointParams), requestParams }); | ||
|
|
||
| export { listResources }; |
This file contains hidden or 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,9 @@ | ||
| import React from 'react'; | ||
|
|
||
| import { SvgIcon } from '@material-ui/core'; | ||
|
|
||
| import { ReactComponent as IconDowntime } from './downtime.icon.svg'; | ||
|
|
||
| const Downtime = (): JSX.Element => <SvgIcon component={IconDowntime} />; | ||
|
|
||
| export default Downtime; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.