Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a DisabledController to replace the DisabledMixin #2181

Closed
wants to merge 6 commits into from

Conversation

Ramon92
Copy link

@Ramon92 Ramon92 commented Feb 2, 2024

What I did

A first step to move away from ClassMixins on components and use controllers
This should improve debugging and tracking back what methods belongs to which controller/Mixin
Properties are then also set by the component making it clear in code what the properties of the component are and no hidden properties added by ClassMixins

  1. Add a DisabledController to replace the DisabledMixin
  • DisabledController has slightly adjusted api compared to the DisabledMixin
  • host requires to have a disabled property
  • Host needs to provide a callback to set the disabled property
  • Same tests as the DisabledMixin to asses the same functionality is still working

Copy link

changeset-bot bot commented Feb 2, 2024

🦋 Changeset detected

Latest commit: e701bf8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lion/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2024

CLA assistant check
All committers have signed the CLA.

@Ramon92 Ramon92 changed the title Feat/add disable controller Add a DisabledController to replace the DisabledMixin Feb 2, 2024
@gerjanvangeest
Copy link
Member

Hi @Ramon92,

Thanks for this contribution. Can you also add it to the ValidateMixin and FormGroupMixin to make sure it works for the full form system?

@Ramon92
Copy link
Author

Ramon92 commented Mar 12, 2024

Hi @Ramon92,

Thanks for this contribution. Can you also add it to the ValidateMixin and FormGroupMixin to make sure it works for the full form system?

Hi @gerjanvangeest
Sorry for the late reply, yes sounds good.
I'll make the changes this month to make it work with the form system.

@gerjanvangeest
Copy link
Member

I'll close this PR due to inactivity.

Also on a side node, the FormGroupMixin needs to be able to access the childs makeRequestToBeDisabled() function. Which cannot be done in a direct way when using a controller. So not sure using a controller for this use case is the best solution.

@Ramon92
Copy link
Author

Ramon92 commented Jun 25, 2024

Apologies, did not find the time after all.
You are right, I stumbled upon that issue, making it pretty hard to detach the mixin to a controller. it is tightly coupled together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants