Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions ui/app/models/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,8 @@ export default DS.Model.extend({
//otherwise the particular mode will have the relevant mode attr through replication-attributes
mode: attr('string'),
allReplicationDisabled: and('{dr,performance}.replicationDisabled'),

anyReplicationEnabled: or('{dr,performance}.replicationEnabled'),

modeState: computed('dr.{mode,state}', 'performance.{mode,state}', 'replicationMode', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turns out we didn't need this property here!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! Looks like modeState wasn't getting calculated in the cluster? Or was it being calculated but not passed down properly where it was being consumed?

const mode = this.replicationMode;
return this.get(`${mode}.state`);
}),

dr: fragment('replication-attributes'),
performance: fragment('replication-attributes'),
// this service exposes what mode the UI is currently viewing
Expand Down
6 changes: 4 additions & 2 deletions ui/lib/core/addon/components/replication-mode-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export default Component.extend({
clusterIdDisplay: replicationAttr('clusterIdDisplay'),
mode: null,
cluster: null,
modeState: computed('cluster', function() {
return this.cluster.modeState;
modeState: computed('cluster', 'mode', function() {
const { cluster, mode } = this;
const clusterState = cluster[mode].state;
return clusterState;
}),
});