Skip to content
New issue

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

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

Already on GitHub? # to your account

fix-bug #559 unpredictable state of tableAction.reorder's function #611

Merged
merged 2 commits into from
Jan 31, 2022

Conversation

gibsonliketheguitar
Copy link
Contributor

@gibsonliketheguitar gibsonliketheguitar commented Dec 28, 2021

#559

  • Use .reduce() to carry out data swap, and
  • transform columns into a correct data structure for dispatch.

Details about Data swap

  • During interaction,
    if curr.key === a.key, then copy data[b], index
    vice versa === b.key, acc[a.key] = { ...data[a], index }

I do request some clarification on the array mover function.

  • When is there an undefined element?

I don't fully understand the arrayMover function.
I think I am missing an edge case, assistance would be awesome.

@gibsonliketheguitar gibsonliketheguitar changed the title fix-bug unpredictable state of tableAction.reorder's function fix-bug #559 unpredictable state of tableAction.reorder's function Dec 28, 2021
Copy link
Contributor

@notsidney notsidney left a comment

Choose a reason for hiding this comment

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

For reorder, we want to move a column to a new position and push all columns right to make space, not swap the two columns’ positions.

@gibsonliketheguitar
Copy link
Contributor Author

Will do

@notsidney notsidney marked this pull request as draft January 28, 2022 03:59
@gibsonliketheguitar gibsonliketheguitar marked this pull request as ready for review January 28, 2022 04:17
@gibsonliketheguitar
Copy link
Contributor Author

ready-im-ready

@shamsmosowi shamsmosowi merged commit dee5636 into rowyio:develop Jan 31, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants