mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 19:47:54 +00:00
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:
@@ -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');
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user