open-consul/ui-v2/app/initializers/form.js
John Cowen 5eed6dcef6 UI: Move legacy ACLs, KVs and Intentions to use form functionality (#4936)
Change legacy acls, kvs and intentions to use `form`s
2019-05-01 18:21:43 +00:00

26 lines
653 B
JavaScript

import kv from 'consul-ui/forms/kv';
import acl from 'consul-ui/forms/acl';
import token from 'consul-ui/forms/token';
import policy from 'consul-ui/forms/policy';
import intention from 'consul-ui/forms/intention';
export function initialize(application) {
// Service-less injection using private properties at a per-project level
const FormBuilder = application.resolveRegistration('service:form');
const forms = {
kv: kv(),
acl: acl(),
token: token(),
policy: policy(),
intention: intention(),
};
FormBuilder.reopen({
form: function(name) {
return forms[name];
},
});
}
export default {
initialize,
};