UI: Ember deprecations - replication engine transitionTo (#25686)

* Replace transitionToRoute on replication-mode controller (tests passing)

* Fix create config toolbar link

* Replace transitionToRoute in replication controllers

* Replace some transitionTo in routes

* replace route transitionTo + stabilize tests

* Last transition + test fixes

* stabilize DR primary test
This commit is contained in:
Chelsea Shaw
2024-02-28 12:14:13 -06:00
committed by GitHub
parent 638f9ddae6
commit 9da2868d4b
13 changed files with 62 additions and 32 deletions

View File

@@ -9,26 +9,27 @@ import Controller from '@ember/controller';
import { task, timeout } from 'ember-concurrency';
export default Controller.extend({
router: service(),
rm: service('replication-mode'),
replicationMode: alias('rm.mode'),
waitForNewClusterToInit: task(function* (replicationMode) {
// waiting for the newly enabled cluster to init
// this ensures we don't hit a capabilities-self error, called in the model of the mode/index route
yield timeout(1000);
return this.transitionToRoute('mode', replicationMode);
this.router.transitionTo('vault.cluster.replication.mode', replicationMode);
}),
actions: {
onEnable(replicationMode, mode) {
if (replicationMode == 'dr' && mode === 'secondary') {
return this.transitionToRoute('vault.cluster');
this.router.transitionTo('vault.cluster');
} else if (replicationMode === 'dr') {
return this.transitionToRoute('mode', replicationMode);
this.router.transitionTo('vault.cluster.replication.mode', replicationMode);
} else {
this.waitForNewClusterToInit.perform(replicationMode);
}
},
onDisable() {
return this.transitionToRoute('index');
this.router.transitionTo('vault.cluster.replication.index');
},
},
});