open-consul/ui-v2/tests/pages/components/policy-selector.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

21 lines
510 B
JavaScript

export default (clickable, deletable, collection, alias, policyForm) => (
scope = '#policies',
createSelector = '[for="new-policy-toggle"]'
) => {
return {
scope: scope,
create: clickable(createSelector),
form: policyForm('#new-policy-toggle + div'),
policies: alias('selectedOptions'),
selectedOptions: collection(
'[data-test-policies] [data-test-tabular-row]',
deletable(
{
expand: clickable('label'),
},
'+ tr'
)
),
};
};