John Cowen 475b4cd473
ui: Intention "Action change" warning modal (#9108)
* ui: Add a warning dialog if you go to remove permissions from an intention

* ui: Move modal styles next to component, add warning style

* ui: Move back to using the input name for a selector

* ui: Fixup negative "isn't" step so its optional

* Add warning modal to pageobject

* Fixup test for whether to show the warning modal or not

* Intention change action warning acceptence test

* Add a null/undefined Action
2020-11-06 14:57:19 +00:00

40 lines
843 B
JavaScript

export default function(
visitable,
clickable,
isPresent,
submitable,
deletable,
cancelable,
permissionsForm,
permissionsList
) {
return {
scope: 'main',
visit: visitable(['/:dc/intentions/:intention', '/:dc/intentions/create']),
permissions: {
create: {
scope: '[data-test-create-permission]',
click: clickable(),
},
form: permissionsForm(),
list: permissionsList(),
},
warning: {
scope: '[data-test-action-warning]',
resetScope: true,
present: isPresent(),
confirm: {
scope: '[data-test-action-warning-confirm]',
click: clickable(),
},
cancel: {
scope: '[data-test-action-warning-cancel]',
click: clickable(),
},
},
...submitable(),
...cancelable(),
...deletable(),
};
}