Route renderTemplate Deprecation (#14646)

* removes renderTemplate usages

* adds _super to setupController override in oidc-callback route
This commit is contained in:
Jordan Reimer
2022-03-22 13:43:43 -06:00
committed by GitHub
parent fa1cd1c2dd
commit b8062bdcae
6 changed files with 31 additions and 40 deletions

View File

@@ -1,25 +1,9 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
export default Route.extend({
router: service(),
init() {
setupController(controller) {
this._super(...arguments);
this.router.on('routeWillChange', (transition) => {
this.set('myTargetRouteName', transition.to.name);
});
},
renderTemplate() {
let targetName = this.myTargetRouteName;
let isCallback =
targetName === 'vault.cluster.oidc-callback' || targetName === 'vault.cluster.oidc-callback-namespace';
if (isCallback) {
this.render('vault/cluster/oidc-callback', {
into: 'application',
outlet: 'main',
});
} else {
this._super(...arguments);
}
const targetRoute = location.pathname || '';
controller.set('isCallback', targetRoute.includes('oidc/callback'));
},
});