open-consul/ui-v2/tests/pages/components/policy-form.js
John Cowen 52b71aaf96
ui: ACL Policies. Catch all server errors (#5836)
Always show any server errors under Rules, not just invalid HCL
2019-06-04 15:53:10 +01:00

17 lines
403 B
JavaScript

export default (submitable, cancelable, radiogroup, text) => (
scope = '[data-test-policy-form]'
) => {
return {
// this should probably be settable
resetScope: true,
scope: scope,
prefix: 'policy',
...submitable(),
...cancelable(),
...radiogroup('template', ['', 'service-identity'], 'policy'),
rules: {
error: text('[data-test-rules] strong'),
},
};
};