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

#288 | Orderable todo list #359

Merged
merged 9 commits into from
Apr 18, 2021
Merged

#288 | Orderable todo list #359

merged 9 commits into from
Apr 18, 2021

Conversation

frontendpm
Copy link
Contributor

@frontendpm frontendpm commented Apr 2, 2021

admin is able to change the order of items in todo list

Added drag and drop for todo list.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • Automated functional tests have been added or modified to cover my changes (if applicable)
  • I have updated the documentation accordingly.

I hereby agree to the terms of the Cogboard Contributor License Agreement.

@szymon-owczarzak szymon-owczarzak changed the title Orderable todo list #288 | Orderable todo list Apr 2, 2021
@szymon-owczarzak szymon-owczarzak added the enhancement New feature or request label Apr 2, 2021
@szymon-owczarzak szymon-owczarzak linked an issue Apr 2, 2021 that may be closed by this pull request
Comment on lines 36 to 45
const handleOnDragEnd = result => {
if (!result.destination) return;

const tempItems = buckets;
const [reorderedItem] = tempItems.splice(result.source.index, 1);
tempItems.splice(result.destination.index, 0, reorderedItem);

setBuckets(tempItems);
onChange(prepareChangeEvent(tempItems, 'array'));
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we somehow refactor this so we dont have 3 times almost the same code?

@GrzegorzBednarski GrzegorzBednarski merged commit 2c69057 into master Apr 18, 2021
@GrzegorzBednarski GrzegorzBednarski deleted the orderable-todo-list branch April 18, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Widget | Possibility to reorder Lists
5 participants