From 6397acb103cb143ddd7ae71a6d1056c8584e7b70 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 22 Oct 2021 18:06:32 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20pass=20@onChange=20t?= =?UTF-8?q?o=20checkbox=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this enables contextual usage --- addons/rose/addon/components/rose/form/checkbox/index.hbs | 1 + ui/admin/app/components/form/auth-method/oidc/index.hbs | 2 +- ui/admin/app/components/form/credential-store/index.hbs | 2 +- ui/admin/app/components/form/group/add-members/index.hbs | 2 +- ui/admin/app/components/form/host-set/add-hosts/index.hbs | 2 +- ui/admin/app/components/form/role/add-principals/index.hbs | 2 +- .../components/form/target/add-credential-libraries/index.hbs | 2 +- ui/admin/app/components/form/target/add-host-sets/index.hbs | 2 +- ui/admin/app/components/form/user/add-accounts/index.hbs | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/addons/rose/addon/components/rose/form/checkbox/index.hbs b/addons/rose/addon/components/rose/form/checkbox/index.hbs index d9b655458..c8f759924 100644 --- a/addons/rose/addon/components/rose/form/checkbox/index.hbs +++ b/addons/rose/addon/components/rose/form/checkbox/index.hbs @@ -6,6 +6,7 @@ id={{this.id}} name={{@name}} disabled={{@disabled}} + onChange={{@onChange}} @type="checkbox" @checked={{if @checked true false}} aria-describedby="{{if @helperText (concat 'helper-text-' this.id)}} {{if @error (concat 'errors-' this.id)}}" /> diff --git a/ui/admin/app/components/form/auth-method/oidc/index.hbs b/ui/admin/app/components/form/auth-method/oidc/index.hbs index 75f421880..1e5cf26d8 100644 --- a/ui/admin/app/components/form/auth-method/oidc/index.hbs +++ b/ui/admin/app/components/form/auth-method/oidc/index.hbs @@ -81,7 +81,7 @@ @label={{t 'form.disable_discovered_config_validation.label'}} @helperText={{t 'form.disable_discovered_config_validation.help'}} @checked={{@model.attributes.disable_discovered_config_validation}} - onChange={{fn + @onChange={{fn (mut @model.attributes.disable_discovered_config_validation) (if @model.attributes.disable_discovered_config_validation false true) }} diff --git a/ui/admin/app/components/form/credential-store/index.hbs b/ui/admin/app/components/form/credential-store/index.hbs index 4da5e3ad3..8f8850784 100644 --- a/ui/admin/app/components/form/credential-store/index.hbs +++ b/ui/admin/app/components/form/credential-store/index.hbs @@ -145,7 +145,7 @@ @label={{t 'resources.credential-store.form.tls_skip_verify.label'}} @helperText={{t 'resources.credential-store.form.tls_skip_verify.help'}} @checked={{@model.attributes.tls_skip_verify}} - onChange={{fn + @onChange={{fn (mut @model.attributes.tls_skip_verify) (if @model.attributes.tls_skip_verify false true) }} diff --git a/ui/admin/app/components/form/group/add-members/index.hbs b/ui/admin/app/components/form/group/add-members/index.hbs index 9a2767a7c..49d5233cb 100644 --- a/ui/admin/app/components/form/group/add-members/index.hbs +++ b/ui/admin/app/components/form/group/add-members/index.hbs @@ -27,7 +27,7 @@ {{#if user.accountName}} {{! diff --git a/ui/admin/app/components/form/host-set/add-hosts/index.hbs b/ui/admin/app/components/form/host-set/add-hosts/index.hbs index 9f5a0fcd1..9eaa01c32 100644 --- a/ui/admin/app/components/form/host-set/add-hosts/index.hbs +++ b/ui/admin/app/components/form/host-set/add-hosts/index.hbs @@ -28,7 +28,7 @@ {{host.name}} diff --git a/ui/admin/app/components/form/role/add-principals/index.hbs b/ui/admin/app/components/form/role/add-principals/index.hbs index af5e73e3d..403de7679 100644 --- a/ui/admin/app/components/form/role/add-principals/index.hbs +++ b/ui/admin/app/components/form/role/add-principals/index.hbs @@ -28,7 +28,7 @@ {{#if principal.accountName}} {{! diff --git a/ui/admin/app/components/form/target/add-credential-libraries/index.hbs b/ui/admin/app/components/form/target/add-credential-libraries/index.hbs index d07c27884..ce0c51912 100644 --- a/ui/admin/app/components/form/target/add-credential-libraries/index.hbs +++ b/ui/admin/app/components/form/target/add-credential-libraries/index.hbs @@ -27,7 +27,7 @@ {{credentialLibrary.name}} diff --git a/ui/admin/app/components/form/target/add-host-sets/index.hbs b/ui/admin/app/components/form/target/add-host-sets/index.hbs index 1885700fd..ca5c7a3e4 100644 --- a/ui/admin/app/components/form/target/add-host-sets/index.hbs +++ b/ui/admin/app/components/form/target/add-host-sets/index.hbs @@ -29,7 +29,7 @@ {{hostSet.name}} diff --git a/ui/admin/app/components/form/user/add-accounts/index.hbs b/ui/admin/app/components/form/user/add-accounts/index.hbs index 03f00ded9..1e9dd1380 100644 --- a/ui/admin/app/components/form/user/add-accounts/index.hbs +++ b/ui/admin/app/components/form/user/add-accounts/index.hbs @@ -29,7 +29,7 @@ {{account.accountName}}