mirror of
https://github.com/status-im/consul.git
synced 2025-01-15 00:04:47 +00:00
33d0383779
This PR uses the excellent a11y-dialog to implement our modal functionality across the UI. This package covers all our a11y needs - overlay click and ESC to close, controlling aria-* attributes, focus trap and restore. It's also very small (1.6kb) and has good DOM and JS APIs and also seems to be widely used and well tested. There is one downside to using this, and that is: We made use of a very handy characteristic of the relationship between HTML labels and inputs in order to implement our modals previously. Adding a for="id" attribute to a label meant you can control an <input id="id" /> from anywhere else in the page without having to pass javascript objects around. It's just based on using the same string for the for attribute and the id attribute. This allowed us to easily open our login dialog with CSS from anywhere within the UI without having to manage passing around a javascript object/function/method in order to open the dialog. We've PRed #9813 which includes an approach which would make passing around JS modal object easier to do. But in the meantime we've added a little 'hack' here using an additional <input /> element and a change listener which allows us to keep this label/input characteristic of our old modals. I'd originally thought this would be a temporary amend in order to wait on #9813 but the more I think about it, the more I think its quite a nice thing to keep - so longer term we may/may not keep this.
25 lines
1.1 KiB
Gherkin
25 lines
1.1 KiB
Gherkin
@setupApplicationTest
|
|
Feature: dc / intentions / permissions / create: Intention Permission Create
|
|
Scenario:
|
|
Given 1 datacenter model with the value "datacenter"
|
|
When I visit the intention page for yaml
|
|
---
|
|
dc: datacenter
|
|
---
|
|
Then the url should be /datacenter/intentions/create
|
|
And the title should be "New Intention - Consul"
|
|
# Specifically set L7
|
|
And I click ".value-"
|
|
|
|
And I click the permissions.create object
|
|
And I click the permissions.form.Action.option.Deny object
|
|
And I click the permissions.form.PathType object
|
|
And I click the permissions.form.PathType.option.PrefixedBy object
|
|
And I fillIn the permissions.form.Path object with value "/path"
|
|
And I fillIn the permissions.form.Headers.form.Name object with value "Name"
|
|
And I fillIn the permissions.form.Headers.form.Value object with value "/path/name"
|
|
And I click the permissions.form.Headers.form.submit object
|
|
And I see 1 of the permissions.form.Headers.list.intentionPermissionHeaders objects
|
|
And I click the permissions.form.submit object
|
|
And I see 1 of the permissions.list.intentionPermissions objects
|