diff --git a/.changelog/9819.txt b/.changelog/9819.txt new file mode 100644 index 0000000000..4b5f6986cc --- /dev/null +++ b/.changelog/9819.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: improve accessibility of modal dialogs +``` diff --git a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs index ee1894d333..cae38aaeee 100644 --- a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/index.hbs @@ -147,7 +147,7 @@ @@ -156,7 +156,7 @@ {{else}} @@ -190,11 +190,11 @@ -{{#if shouldShowPermissionForm}} +

Edit Permission

@@ -225,6 +225,5 @@
-{{/if}} \ No newline at end of file diff --git a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/layout.scss b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/layout.scss index fa9353f06c..b098746a7d 100644 --- a/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/layout.scss +++ b/ui/packages/consul-ui/app/components/consul/intention/form/fieldsets/layout.scss @@ -22,6 +22,6 @@ float: right; } } -.consul-intention-permission-modal [role="dialog"] > div > div { +.consul-intention-permission-modal [role="dialog"] { width: 100%; } diff --git a/ui/packages/consul-ui/app/components/consul/intention/form/index.hbs b/ui/packages/consul-ui/app/components/consul/intention/form/index.hbs index 4860bf5095..193fbf047d 100644 --- a/ui/packages/consul-ui/app/components/consul/intention/form/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/intention/form/index.hbs @@ -34,13 +34,12 @@ as |api|> {{#let api.data as |item|}} {{#if (can 'write intention' item=item)}} -{{#if this.warn}} {{#let (changeset-get item 'Action') as |newAction|}} + as |modal|> +

Set intention to {{newAction}}?

@@ -69,7 +68,6 @@ as |api|>
{{/let}} -{{/if}} {{#let components.AuthForm components.AuthProfile as |AuthForm AuthProfile|}} - - - + +

Log in with a different token

- - + + - - @@ -271,7 +277,9 @@ <:main> - {{yield}} + {{yield (hash + modal=this.modal + )}} <:content-info> diff --git a/ui/packages/consul-ui/app/components/hashicorp-consul/index.js b/ui/packages/consul-ui/app/components/hashicorp-consul/index.js index c65e1efd56..fecd7bcf40 100644 --- a/ui/packages/consul-ui/app/components/hashicorp-consul/index.js +++ b/ui/packages/consul-ui/app/components/hashicorp-consul/index.js @@ -17,4 +17,9 @@ export default class HashiCorpConsul extends Component { this.modal.close(); this.args.onchange(e); } + + @action + keypressClick(e) { + e.target.dispatchEvent(new MouseEvent('click')); + } } diff --git a/ui/packages/consul-ui/app/components/modal-dialog/index.hbs b/ui/packages/consul-ui/app/components/modal-dialog/index.hbs index 8cb052be49..80f1e2fc17 100644 --- a/ui/packages/consul-ui/app/components/modal-dialog/index.hbs +++ b/ui/packages/consul-ui/app/components/modal-dialog/index.hbs @@ -1,51 +1,55 @@ -{{on-window 'resize' (action "resize") }} {{yield}} +