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

Cannot drag n drop table items #2593

Closed
4 of 11 tasks
jetienne opened this issue Mar 13, 2024 · 11 comments · Fixed by #2599
Closed
4 of 11 tasks

Cannot drag n drop table items #2593

jetienne opened this issue Mar 13, 2024 · 11 comments · Fixed by #2599
Assignees
Labels
Bug Something isn't working

Comments

@jetienne
Copy link

Describe the bug

Moving an item (grid or list view) produces a Content Missing error :

Uncaught (in promise) Error: The response (200) did not contain the expected <turbo-frame id="villa_images_list"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.
    at #v (turbo.es2017-esm.js:6109:11)
    at #h (turbo.es2017-esm.js:6104:10)
    at #a (turbo.es2017-esm.js:6007:12)
    at async JH.loadResponse (turbo.es2017-esm.js:5824:11)
    at async JH.requestSucceededWithResponse (turbo.es2017-esm.js:5898:5)

Steps to Reproduce

  1. Create a resource (Villa) and a nested resource (VillaImage)
  2. Add field :has_many on the Villa resource
  3. Enable drag n drop (see reproduction repo)

See reproduction repo: https://github.com/mercey-co/dnd_issue

System configuration

Avo version:
3.5.0

Rails version:
7.1.2.3

Ruby version:
3.3.0

License type:

  • Community
  • Pro
  • Advanced

Are you using Avo monkey patches, overriding views or view components?

  • Yes. If so, please post code samples.
  • No

Impact

  • High impact (It makes my app un-usable.)
  • Medium impact (I'm annoyed, but I'll live.)
  • Low impact (It's really a tiny thing that I could live with.)

Urgency

  • High urgency (I can't continue development without it.)
  • Medium urgency (I found a workaround, but I'd love to have it fixed.)
  • Low urgency (It can wait. I just wanted you to know about it.)
@RocKhalil
Copy link
Contributor

Another bug regarding DnD: I'm using avo-advanced and the DnD seems to point to avo-pro only;

Configuration:

self.ordering = {
  visible_on: %i[index association],
  position: -> { record.sort_order },
  drag_and_drop: true,
  actions: {
    higher: -> { record.move_higher },
    lower: -> { record.move_lower },
    to_top: -> { record.move_to_top },
    to_bottom: -> { record.move_to_bottom },
    insert_at: -> { record.insert_at position }

  }
}

Error:

[6160eac6-7a42-4924-9862-56ebd634aafd] ActionController::RoutingError (No route matches [PATCH] "/avo-pro/reorder/course_modules/chapitre-2"):

@iainbeeston
Copy link
Contributor

I'm seeing the same issue as @jetienne (which is makes drag and drop unusable)

@Paul-Bob Paul-Bob self-assigned this Mar 14, 2024
@Paul-Bob Paul-Bob added the Bug Something isn't working label Mar 14, 2024
@adrianthedev
Copy link
Collaborator

We're on it!

@adrianthedev
Copy link
Collaborator

This is a Rails 7.1 issue we encountered a few weeks ago.
Probably that's why we didn't spot it before.

Issuing a fix.

@iainbeeston
Copy link
Contributor

@adrianthedev FYI I'm using Rails 7.0 and I still get this issue... I'll try the new version once it's released to see if it works on rails 7.0 too

@adrianthedev
Copy link
Collaborator

Got it @iainbeeston! Thanks for reporting it.
We did also find an issue with how we mountes the engine in our dummy app, which could have caused some false positives.
Paul is going to release a new version soon.

@Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob reopened this Mar 14, 2024
@jetienne
Copy link
Author

@Paul-Bob I tested 3.5.1, and still get Content Missing. Interesting enough,, the position is now changed:

turbo.es2017-esm.js:6109 Uncaught (in promise) Error: The response (200) did not contain the expected <turbo-frame id="villa_assets_list"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.
    at #v (turbo.es2017-esm.js:6109:11)
    at #h (turbo.es2017-esm.js:6104:10)
    at #a (turbo.es2017-esm.js:6007:12)
    at async JH.loadResponse (turbo.es2017-esm.js:5824:11)
    at async JH.requestSucceededWithResponse (turbo.es2017-esm.js:5898:5)
```

@Paul-Bob
Copy link
Contributor

Thanks for reporting it! Closing as completed here #2599

Will be fixed on the today's patch release

@jetienne
Copy link
Author

Tested on 3.5.2: it works well in list view, but not on grid view (the icon doesn't appear at all).

@Paul-Bob
Copy link
Contributor

3.5.3 enables reordering on grid view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants