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

Drag and drop lesson reordering in the metabox on edit course screen.… #70

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

MaximilianoRicoTabo
Copy link

@MaximilianoRicoTabo MaximilianoRicoTabo commented Jun 9, 2024

#59

image image
  • Add jQuery UI dependency to support drag and drop
  • Make Course lessons table rows draggable by calling sortable function from
  • Update Course lesson order via AJAX on stop sortable event callback
  • Remove Order field
  • Get Order from UI when add a new lesson to the course
  • Add server side AJAX endpoint to update Course order
  • Add better JSON response to show proper notifications to users on AJAX callbacks.

All Submissions:

Changes proposed in this Pull Request:

Changes how order is managed so far. Instead of trust on admin input which is error prone handle order by assigning unique integers each lesson and let admin user easily rearrange course order by dragging lessons and sorting them. Order is updated automaticaly. This way it avoids repeated order wich is very ugly. Also it avoid having non int chars which is ugly too. Helps to avoid bugs with pagination. It's more honest with the user regarding AJAX updates, letting the user know operations performed are already done. instead of think they need to save the course. I'll make it a draft so i can spread this change re AJAX callback message to remove and add lesson to course as well in order to be consistent.
Resolves #59 .

How to test the changes in this Pull Request:

  1. Create a course
  2. Add few lessons
  3. Rearrange order by moving inside the table

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

…trangerstudios#59

 * Add jQuery UI dependency to support drag and drop
 * Make Course lessons table rows draggable by calling sortable function from
 * Update Course lesson order via AJAX on stop sortable event callback
 * Remove Order field
 * Get Order from UI when add a new lesson to the course
 * Add server side AJAX endpoint to update Course order
 * Add better JSON response to show proper notifications to users on AJAX callbacks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drag and drop lesson reordering in the metabox on edit course screen.
1 participant