Route renderTemplate Deprecation (#14646)
* removes renderTemplate usages * adds _super to setupController override in oidc-callback route
This commit is contained in:
parent
da93aff7d4
commit
dacb98ec91
|
@ -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'));
|
||||
},
|
||||
});
|
||||
|
|
|
@ -13,10 +13,8 @@ export default Route.extend({
|
|||
let queryParams = { source, namespace, path, code, state };
|
||||
window.opener.postMessage(queryParams, window.origin);
|
||||
},
|
||||
renderTemplate() {
|
||||
this.render(this.templateName, {
|
||||
into: 'application',
|
||||
outlet: 'main',
|
||||
});
|
||||
setupController(controller) {
|
||||
this._super(...arguments);
|
||||
controller.set('pageContainer', document.querySelector('.page-container'));
|
||||
},
|
||||
});
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<div class="splash-page-container section is-flex-v-centered-tablet is-flex-1 is-fullwidth">
|
||||
<div class="columns is-centered is-gapless is-fullwidth">
|
||||
<div class="column is-4-desktop is-6-tablet">
|
||||
<div class="has-text-grey has-bottom-margin-m has-current-color-fill">
|
||||
<LogoEdition />
|
||||
</div>
|
||||
<AlertBanner
|
||||
@type="success"
|
||||
@title="Signing in with your OIDC provider..."
|
||||
@message="This window will close automatically"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1 +1,5 @@
|
|||
<LogoSplash />
|
||||
{{#if this.isCallback}}
|
||||
<OidcCallbackSplash />
|
||||
{{else}}
|
||||
<LogoSplash />
|
||||
{{/if}}
|
|
@ -1,14 +1,3 @@
|
|||
<div class="splash-page-container section is-flex-v-centered-tablet is-flex-1 is-fullwidth">
|
||||
<div class="columns is-centered is-gapless is-fullwidth">
|
||||
<div class="column is-4-desktop is-6-tablet">
|
||||
<div class="has-text-grey has-bottom-margin-m has-current-color-fill">
|
||||
<LogoEdition />
|
||||
</div>
|
||||
<AlertBanner
|
||||
@type="success"
|
||||
@title="Signing in with your OIDC provider..."
|
||||
@message="This window will close automatically"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{#in-element this.pageContainer}}
|
||||
<OidcCallbackSplash />
|
||||
{{/in-element}}
|
|
@ -52,7 +52,9 @@ export default Component.extend({
|
|||
this.onChange(value);
|
||||
},
|
||||
handleKeyUp(name, value) {
|
||||
if (this.onKeyUp) {
|
||||
this.onKeyUp(name, value);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue