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

AAU I want to re-order my views with drag & drop #5002

Merged
merged 4 commits into from May 15, 2024
Merged

Conversation

gitstart-twenty
Copy link
Contributor

Description

I want to re-order my views with drag & drop

Refs

#4782

Demo

https://jam.dev/c/699ece8a-0467-494a-b9a3-faf666ee9c93

Fixes #4782

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Co-authored-by: FellipeMTX <fellipefacdir@gmail.com>
@charlesBochet
Copy link
Member

@gitstart-twenty The INDEX view (the one with the lock) should not be draggable, it should always stay at the bottom of the list:
image

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

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

Looks good from a code perspective, I have left some comments, thank you!

[updateView, viewsOnCurrentObject],
);

const getSortedViews = () => {
Copy link
Member

Choose a reason for hiding this comment

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

we should not recode this logic. It's already in: getObjectMetadataItemViews function

key={view.id}
draggableId={view.id}
index={index}
isDragDisabled={viewsOnCurrentObject.length === 1}
Copy link
Member

Choose a reason for hiding this comment

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

if it's the INDEX view too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @charlesBochet
This has been updated!

gitstart-twenty and others added 2 commits April 17, 2024 19:20
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Co-authored-by: FellipeMTX <fellipefacdir@gmail.com>
@charlesBochet
Copy link
Member

LGTM! Thank you!

@charlesBochet charlesBochet merged commit de228be into main May 15, 2024
11 checks passed
@charlesBochet charlesBochet deleted the TWNTY-4782 branch May 15, 2024 15:57
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.

AAU I want to re-order my views with drag & drop.
3 participants