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

Rework dual list #5228

Merged
merged 2 commits into from
Feb 17, 2019
Merged

Conversation

Hyperkid123
Copy link
Contributor

@Hyperkid123 Hyperkid123 commented Feb 7, 2019

Dual list was not proplely updating form state, specifically pristine/dirty states. This was cause due to react refs and async nature of executing events via refs. Proposed solution which adds timeout to manually trigger onBlur and onFocus events is future proof and will probably result in more bugs down the line.

Now the component uses purely React state without any refs which will ensure synchronous behavior.

@Hyperkid123 Hyperkid123 force-pushed the rework-dual-list branch 3 times, most recently from f985806 to 1eccf08 Compare February 7, 2019 16:17
@Hyperkid123
Copy link
Contributor Author

@miq-bot add-reviewer @rvsia
@miq-bot add-reviewer @martinpovolny
@miq-bot add-label enhancement

@Hyperkid123 Hyperkid123 changed the title [WIP] Rework dual list Rework dual list Feb 7, 2019
Copy link
Contributor

@rvsia rvsia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 👍

I made some changes in my catalog-form PR, like adding paddingBottom to lists (because of buttons), could you please converted them here? Thanks!

CTRL+LeftClick on mutliple options doesn't work. 😿

And I think you should implement at least move all to right, it doesn't seem as a big change and it will be probably in the next converted form. 🔢 (MoveAllToLeft is not probably anywhere, it was just a bonus. 🎁 😄 )

@rvsia rvsia mentioned this pull request Feb 8, 2019
4 tasks
@rvsia
Copy link
Contributor

rvsia commented Feb 8, 2019

duallisterror

  • This issue is caused probably when you don't provide any initialValue:
    Warning: Failed prop type: Invalid prop input.valueof typestringsupplied toDualList, expected an array.

I also noticed, that options are added to right and the value is on the left. I think it should be opposite.

@Hyperkid123 Hyperkid123 force-pushed the rework-dual-list branch 2 times, most recently from b9dee64 to bcf0e8f Compare February 11, 2019 13:54
@Hyperkid123
Copy link
Contributor Author

  • This issue is caused probably when you don't provide any initialValue:

Reason why it is not working, is because its expects array of strings. You are comparing array of numbers and strings which will fail. Right now values has to be always strings. If we ever need to changes this to support numbers objects etc, we will write custom equal function. Right now its not needed.

Copy link
Contributor

@rvsia rvsia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in UI and everything looks great! 🥇

@miq-bot
Copy link
Member

miq-bot commented Feb 12, 2019

Checked commits Hyperkid123/manageiq-ui-classic@5fa7864~...54aae3f with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 🍰

@martinpovolny martinpovolny merged commit 66bcb86 into ManageIQ:master Feb 17, 2019
@martinpovolny martinpovolny self-assigned this Feb 17, 2019
@martinpovolny martinpovolny added this to the Sprint 105 Ending Feb 18, 2019 milestone Feb 17, 2019
@Hyperkid123 Hyperkid123 deleted the rework-dual-list branch February 18, 2019 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants