-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: add simple transfer component #1626
base: master
Are you sure you want to change the base?
Conversation
8970f50
to
8979083
Compare
8979083
to
ae1cd24
Compare
ad1d137
to
726d5ac
Compare
115f74b
to
c227ff9
Compare
🚀 Deployed on https://pr-1626--dhis2-ui.netlify.app |
Great job on the docs & demos! Once merged it should automatically be deployed to the developer portal as well and show up at the web components section there. I cannot review the rest of the PR so I won't leave a review here :) |
Can we replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good to me!
I think the 4 buttons could use a aria-label
to describe what they're doing, using i18n
so we have proper translations
> | ||
{options.map((option, index) => { | ||
return ( | ||
<Fragment key={option.value}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore, I guess
@amcgee yes we can do that. I think in the meeting we discussed marking the current transfer as deprecated first, to give some time for people to move if they need to. I'm happy with both solutions. If we want to go for the second one, i won't merge but will figure out how to mark it as deprecated first, and can add it to this PR. What do you think is best? |
I agree with @amcgee here to upgrade the old one instead of introducing a new component as a replacement. Having both is more confusing for developers than a breaking change upgrade. One small addition to this page could be enough: https://developers.dhis2.org/design/help/migrating |
My opinion on this is: I wouldn't be worried about devs being confused as long as we clarify things in the docs. But I'd be worried about forcing library users to be forced to do work when they want a completely different change. Especially with a proper deprecation notice, devs would know that they're using the wrong component if they chose the old one due to confusion. |
So I rechecked the docs, and it seems there are functional changes to this component and the transfer component. But as you indicated the Transfer component will be deprecated, we'd need to write a migration guide away from the transfer component as well. In that case, an override is not needed and it can be released as-is (per this PR). |
Implements LIBS-574
Storybook demos here.
Description
Adds an accessible version of the transfer component.
This component differs from the transfer component because in this new version the transfer option ui can not be customised. This choice implies that the new component was be rewritten using a select with options, providing accessibility for free and also simplifying the code.
Either than that, there should be almost no difference between the old and the new component. I say almost, because the color of an option when highlighted also changed. Now we use the default color for select/options, where customisation is not even possible (unless with very weird hacks).
Checklist
Screenshots