mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-22 11:11:26 +01:00
* use alias for router injection * update @router declarations in engine files * fix remaining pki router imports * dynamically set router based on owner * address replication routers * update markdown docs * use non-deprecated import for getOwner * revert out of scope changes * add transition-to test
28 lines
718 B
TypeScript
28 lines
718 B
TypeScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Route from '@ember/routing/route';
|
|
import { service } from '@ember/service';
|
|
|
|
import type RouterService from '@ember/routing/router-service';
|
|
import type FlagService from 'vault/services/flags';
|
|
|
|
export default class SyncSecretsRoute extends Route {
|
|
@service('app-router') declare readonly router: RouterService;
|
|
@service declare readonly flags: FlagService;
|
|
|
|
model() {
|
|
return {
|
|
activatedFeatures: this.flags.activatedFlags,
|
|
};
|
|
}
|
|
|
|
afterModel(model: { activatedFeatures: Array<string> }) {
|
|
if (!model.activatedFeatures) {
|
|
this.router.transitionTo('vault.cluster.sync.secrets.overview');
|
|
}
|
|
}
|
|
}
|