open-vault/ui/app/routes/vault/cluster/access/method/section.js

30 lines
830 B
JavaScript
Raw Normal View History

import { set } from '@ember/object';
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
2018-04-03 14:16:57 +00:00
import DS from 'ember-data';
export default Route.extend({
wizard: service(),
2018-04-03 14:16:57 +00:00
model(params) {
const { section_name: section } = params;
if (section !== 'configuration') {
const error = new DS.AdapterError();
set(error, 'httpStatus', 404);
2018-04-03 14:16:57 +00:00
throw error;
}
2018-08-28 05:03:55 +00:00
let backend = this.modelFor('vault.cluster.access.method');
this.get('wizard').transitionFeatureMachine(
this.get('wizard.featureState'),
'DETAILS',
backend.get('type')
);
return backend;
2018-04-03 14:16:57 +00:00
},
setupController(controller) {
const { section_name: section } = this.paramsFor(this.routeName);
this._super(...arguments);
controller.set('section', section);
},
});