-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chartGraph): convert graph data, add error/loading states (#40)
* parse the Redux date and sockets inputs and generate chart data and tooltips * add error state and zeroed array * loading skeletor * graphHelpers, rhelGraphCard replace translate refs * rhelGraphCard, consolidate logic * update integration snapshots * graphHelpers, minor UTC correction, snapshot corrections * dateHelpers, initial date defaults, prep for additional date functions * helpers, index layout * rhelGraphCard, replace default startDate, endDate props with helper
- Loading branch information
Showing
14 changed files
with
571 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{ | ||
"curiosity-graph": { | ||
"heading": "Daily CPU socket usage", | ||
"dropdownDefault": "Last 30 Days" | ||
"dropdownDefault": "Last 30 Days", | ||
"socketsOn": "sockets on", | ||
"fromPrevious": "from previous day" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/common/__tests__/__snapshots__/dateHelpers.test.js.snap
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,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`DateHelpers should have specific functions: dateHelpers 1`] = ` | ||
Object { | ||
"defaultDateTime": Object { | ||
"end": null, | ||
"start": null, | ||
}, | ||
} | ||
`; |
76 changes: 75 additions & 1 deletion
76
src/common/__tests__/__snapshots__/graphHelpers.test.js.snap
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,7 @@ | ||
import { dateHelpers } from '../dateHelpers'; | ||
|
||
describe('DateHelpers', () => { | ||
it('should have specific functions', () => { | ||
expect(dateHelpers).toMatchSnapshot('dateHelpers'); | ||
}); | ||
}); |
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,21 @@ | ||
import moment from 'moment/moment'; | ||
import { helpers } from './helpers'; | ||
|
||
const defaultDateTime = (helpers.TEST_MODE && { | ||
start: null, | ||
end: null | ||
}) || { | ||
start: moment() | ||
.utc() | ||
.startOf('day') | ||
.subtract(30, 'days'), | ||
end: moment() | ||
.utc() | ||
.endOf('day') | ||
}; | ||
|
||
const dateHelpers = { | ||
defaultDateTime | ||
}; | ||
|
||
export { dateHelpers as default, dateHelpers, defaultDateTime }; |
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,5 @@ | ||
import { helpers } from './helpers'; | ||
import { dateHelpers } from './dateHelpers'; | ||
import { graphHelpers } from './graphHelpers'; | ||
|
||
export { helpers as default, helpers, dateHelpers, graphHelpers }; |
Oops, something went wrong.