-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replication Primary Dashboard: handle errors (#8845)
* use h3 instead of code elements * use correct property names for StateDisplay * WIP * remove todo * move cluster states into a map; make status menu icon match cluster state * show error in state card using the same state map in the cluster model * whitespace * move cluster-states into a helper and update usage * use circle success icon for stream-wals because that is the ideal state * more refactoring of cluster state display * use new cluster-states helper * whitespace * use clusterStates helper in replication secondary card * remove extra import * add default values for when state isn't recognized * make sure that state exists before getting state details from clusterStates helper * be more strict when state cannot be found * use brace expansion to fix linting error * add tests for error states * fix text wrapping issue on secondary cards; make titles match mocks * use unknown if metric isn't foudn * remove extra border on selectable card when there is an error * use outline square in status menu for error
- Loading branch information
Noelle Daley
authored
Apr 28, 2020
1 parent
2f78a9a
commit 36f0a80
Showing
18 changed files
with
293 additions
and
200 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
import { clusterStates } from 'core/helpers/cluster-states'; | ||
import layout from '../templates/components/replication-dashboard'; | ||
|
||
const MERKLE_STATES = { sync: 'merkle-sync', diff: 'merkle-diff' }; | ||
|
||
export default Component.extend({ | ||
layout, | ||
data: null, | ||
isSyncing: computed('data', function() { | ||
if (this.dr.state === MERKLE_STATES.sync || this.dr.state === MERKLE_STATES.diff) { | ||
return true; | ||
dr: computed('data', function() { | ||
let dr = this.data.dr; | ||
if (!dr) { | ||
return false; | ||
} | ||
return dr; | ||
}), | ||
isSyncing: computed('dr', function() { | ||
const { state } = this.dr; | ||
return state && clusterStates([state]).isSyncing; | ||
}), | ||
}); |
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
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,69 @@ | ||
import { helper as buildHelper } from '@ember/component/helper'; | ||
|
||
// A hash of cluster states to ensure that the status menu and replication dashboards | ||
// display states and glyphs consistently | ||
// this includes states for the primary vault cluster and the connection_state | ||
|
||
export const CLUSTER_STATES = { | ||
running: { | ||
glyph: 'check-circle-outline', | ||
isOk: true, | ||
isSyncing: false, | ||
}, | ||
ready: { | ||
glyph: 'check-circle-outline', | ||
isOk: true, | ||
isSyncing: false, | ||
}, | ||
'stream-wals': { | ||
glyph: 'check-circle-outline', | ||
display: 'Streaming', | ||
isOk: true, | ||
isSyncing: false, | ||
}, | ||
'merkle-diff': { | ||
glyph: 'android-sync', | ||
display: 'Determining sync status', | ||
isOk: true, | ||
isSyncing: true, | ||
}, | ||
connecting: { | ||
glyph: 'android-sync', | ||
display: 'Streaming', | ||
isOk: true, | ||
isSyncing: true, | ||
}, | ||
'merkle-sync': { | ||
glyph: 'android-sync', | ||
display: 'Syncing', | ||
isOk: true, | ||
isSyncing: true, | ||
}, | ||
idle: { | ||
glyph: 'cancel-square-outline', | ||
isOk: false, | ||
isSyncing: false, | ||
}, | ||
transient_failure: { | ||
glyph: 'cancel-circle-outline', | ||
isOk: false, | ||
isSyncing: false, | ||
}, | ||
shutdown: { | ||
glyph: 'cancel-circle-outline', | ||
isOk: false, | ||
isSyncing: false, | ||
}, | ||
}; | ||
|
||
export function clusterStates([state]) { | ||
const defaultDisplay = { | ||
glyph: '', | ||
display: '', | ||
isOk: null, | ||
isSyncing: null, | ||
}; | ||
return CLUSTER_STATES[state] || defaultDisplay; | ||
} | ||
|
||
export default buildHelper(clusterStates); |
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
Oops, something went wrong.