refactor: 💡 pass @onChange to checkbox components

this enables contextual usage
This commit is contained in:
Randall Morey committed 2021-10-22 18:06:32 -04:00
1 parent 966e18b1d7
commit 6397acb103
9 files changed
+9 -8

No files matched your search

@@ -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)}}" />
@@ -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)
}}
@@ -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)
}}
@@ -27,7 +27,7 @@
<row.headerCell>
<form.checkbox
@label={{user.displayName}}
onChange={{fn this.toggleMember user}}
@onChange={{fn this.toggleMember user}}
/>
{{#if user.accountName}}
{{!
@@ -28,7 +28,7 @@
<form.checkbox
@label={{host.id}}
@description={{host.description}}
onChange={{fn this.toggleHost host}}
@onChange={{fn this.toggleHost host}}
/>
</row.cell>
<row.cell>{{host.name}}</row.cell>
@@ -28,7 +28,7 @@
<row.headerCell>
<form.checkbox
@label={{principal.displayName}}
onChange={{fn this.togglePrincipal principal}}
@onChange={{fn this.togglePrincipal principal}}
/>
{{#if principal.accountName}}
{{!
@@ -27,7 +27,7 @@
<form.checkbox
@label={{credentialLibrary.id}}
@description={{credentialLibrary.description}}
onChange={{fn this.toggleCredentialLibrary credentialLibrary}}
@onChange={{fn this.toggleCredentialLibrary credentialLibrary}}
/>
</row.headerCell>
<row.cell>{{credentialLibrary.name}}</row.cell>
@@ -29,7 +29,7 @@
<form.checkbox
@label={{hostSet.id}}
@description={{hostSet.description}}
onChange={{fn this.toggleHostSet hostSet}}
@onChange={{fn this.toggleHostSet hostSet}}
/>
</row.cell>
<row.cell>{{hostSet.name}}</row.cell>
@@ -29,7 +29,7 @@
<form.checkbox
@label={{account.id}}
@description={{account.description}}
onChange={{fn this.toggleAccount account}}
@onChange={{fn this.toggleAccount account}}
/>
</row.cell>
<row.cell>{{account.accountName}}</row.cell>