2018-09-25 16:28:26 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2018-07-05 18:28:12 +00:00
|
|
|
import ClusterRouteBase from './cluster-route-base';
|
2018-07-20 21:48:25 +00:00
|
|
|
import config from 'vault/config/environment';
|
2018-07-05 18:28:12 +00:00
|
|
|
|
|
|
|
export default ClusterRouteBase.extend({
|
2018-09-25 16:28:26 +00:00
|
|
|
queryParams: {
|
|
|
|
authMethod: {
|
|
|
|
replace: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
flashMessages: service(),
|
|
|
|
version: service(),
|
|
|
|
wizard: service(),
|
2018-07-05 18:28:12 +00:00
|
|
|
beforeModel() {
|
2018-08-16 17:48:24 +00:00
|
|
|
return this._super().then(() => {
|
|
|
|
return this.get('version').fetchFeatures();
|
|
|
|
});
|
2018-07-05 18:28:12 +00:00
|
|
|
},
|
|
|
|
model() {
|
2018-08-16 17:48:24 +00:00
|
|
|
return this._super(...arguments);
|
2018-07-05 18:28:12 +00:00
|
|
|
},
|
|
|
|
resetController(controller) {
|
|
|
|
controller.set('wrappedToken', '');
|
|
|
|
controller.set('authMethod', '');
|
|
|
|
},
|
2018-07-20 21:48:25 +00:00
|
|
|
|
|
|
|
afterModel() {
|
|
|
|
if (config.welcomeMessage) {
|
|
|
|
this.get('flashMessages').stickyInfo(config.welcomeMessage);
|
|
|
|
}
|
|
|
|
},
|
2018-08-28 05:03:55 +00:00
|
|
|
activate() {
|
|
|
|
this.get('wizard').set('initEvent', 'LOGIN');
|
|
|
|
this.get('wizard').transitionTutorialMachine(this.get('wizard.currentState'), 'TOLOGIN');
|
|
|
|
},
|
|
|
|
actions: {
|
|
|
|
willTransition(transition) {
|
|
|
|
if (transition.targetName !== this.routeName) {
|
|
|
|
this.get('wizard').transitionTutorialMachine(this.get('wizard.currentState'), 'INITDONE');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2018-07-05 18:28:12 +00:00
|
|
|
});
|