diff --git a/ui/lib/core/addon/components/replication-page.js b/ui/lib/core/addon/components/replication-page.js index 4ab4f9a20f6a..a808f8111473 100644 --- a/ui/lib/core/addon/components/replication-page.js +++ b/ui/lib/core/addon/components/replication-page.js @@ -32,14 +32,18 @@ export default Component.extend({ layout, store: service(), router: service(), + rm: service('replication-mode'), reindexingDetails: null, didReceiveAttrs() { this._super(arguments); this.getReplicationModeStatus.perform(); }, + replicationMode: computed('rm.mode', function () { + return this.rm.getMode(); + }), getReplicationModeStatus: task(function* () { let resp; - const { replicationMode } = this.model; + const { replicationMode } = this; if (this.isSummaryDashboard) { // the summary dashboard is not mode specific and will error @@ -66,13 +70,13 @@ export default Component.extend({ } return ''; }), - formattedReplicationMode: computed('model.replicationMode', 'isSummaryDashboard', function () { + formattedReplicationMode: computed('replicationMode', 'isSummaryDashboard', function () { // dr or performance 🤯 const { isSummaryDashboard } = this; if (isSummaryDashboard) { return 'Disaster Recovery & Performance'; } - const mode = this.model.replicationMode; + const mode = this.replicationMode; return MODE[mode]; }), clusterMode: computed('model.replicationAttrs', 'isSummaryDashboard', function () { @@ -119,14 +123,14 @@ export default Component.extend({ } return {}; }), - replicationDetails: computed('model.replicationMode', 'isSummaryDashboard', function () { + replicationDetails: computed('replicationMode', 'isSummaryDashboard', function () { const { model } = this; const { isSummaryDashboard } = this; if (isSummaryDashboard) { // Cannot return null return {}; } - const replicationMode = model.replicationMode; + const { replicationMode } = this; return model[replicationMode]; }), isDisabled: computed('replicationDetails.mode', function () { diff --git a/ui/tests/acceptance/replication-nav-test.js b/ui/tests/acceptance/replication-nav-test.js index 5edd37230a71..c30175dd8300 100644 --- a/ui/tests/acceptance/replication-nav-test.js +++ b/ui/tests/acceptance/replication-nav-test.js @@ -17,7 +17,7 @@ const SELECTORS = { title: '[data-test-replication-title]', primaryCluster: '[data-test-value-div="primary_cluster_addr"]', replicationSet: '[data-test-row-value="Replication set"]', - knownSecondariesTitle: '.known-secondaries-card h3', + knownSecondariesTitle: '.secondaries h3', }; module('Acceptance | Enterprise | replication navigation', function (hooks) { setupApplicationTest(hooks); @@ -36,7 +36,7 @@ module('Acceptance | Enterprise | replication navigation', function (hooks) { test('navigate between replication types updates page', async function (assert) { await click(SELECTORS.navReplication); - assert.dom(SELECTORS.title).hasText('Disaster Recovery & Performance primary'); + assert.dom('[data-test-replication-header] h1').hasText('Disaster Recovery & Performance primary'); await click(SELECTORS.navPerformance); // Ensure data is expected for performance