John Cowen 077d70ff44
ui: Previously we were passing through 'fake' events, revert to real.. (#5810)
Previously we were creating a fake event and amending the name of the
fake event, this meant that other `event.target` properties weren't
being passed through (in this instance `checked`) this changes the
approach to not use fake events, and allows you to overwrite the name
that the form uses for `handleEvent`
2019-05-08 17:12:16 +01:00

17 lines
566 B
JavaScript

export default function(visitable, submitable, deletable, cancelable, clickable, tokenList) {
return {
visit: visitable(['/:dc/acls/policies/:policy', '/:dc/acls/policies/create']),
...submitable({}, 'form > div'),
...cancelable({}, 'form > div'),
...deletable({}, 'form > div'),
tokens: tokenList(),
validDatacenters: clickable('[name="policy[isScoped]"]'),
datacenter: clickable('[name="policy[Datacenters]"]'),
deleteModal: {
resetScope: true,
scope: '[data-test-delete-modal]',
...deletable({}),
},
};
}