appuniversum / ember-appuniversum

Ember addon wrapping the appuniversum components.
https://appuniversum.github.io/ember-appuniversum
MIT License
14 stars 10 forks source link

Addition of various functionality for the toggle-switch component #385

Closed brenner-company closed 1 year ago

brenner-company commented 1 year ago

Within Kaleidos we could use the following functionality for the AuToggleSwitch component:

Together with some general adjustments:

Is this something that can be added to the component? If yes, I can surely help with that.

brenner-company commented 1 year ago

Example of the loading state functionality, currently implemented within Kaleidos:

CleanShot 2023-03-06 at 15 50 03

Windvis commented 1 year ago

👍 for most of the bullets, but I'm not sure I'm a fan of adding a loading state here. That seems like a very niche use-case since usually switching the toggle doesn't start an async action.

I think it might be better to support something like this instead?

<AuToggleSwitch>
  {{#if this.isRunning}}
    <AuLoader />
  {{else}}
    Te handtekenen
  {{/if}}
</AuToggleSwitch>

(Pseudocode, but you get the idea)

If the pattern also becomes more common in other Appuniversum apps, we can then add it to the component itself.

brenner-company commented 1 year ago

👍 for most of the bullets, but I'm not sure I'm a fan of adding a loading state here. That seems like a very niche use-case since usually switching the toggle doesn't start an async action.

I think it might be better to support something like this instead?

<AuToggleSwitch>
  {{#if this.isRunning}}
    <AuLoader />
  {{else}}
    Te handtekenen
  {{/if}}
</AuToggleSwitch>

(Pseudocode, but you get the idea)

If the pattern also becomes more common in other Appuniversum apps, we can then add it to the component itself.

That is totally ok for us 👍 We thought the 'issue' was already more common within other apps.

I'll start on a PR for the remaining items today or tomorrow.