-
-
Notifications
You must be signed in to change notification settings - Fork 243
Add inline drag-and-drop sorting for lists and relations #1491
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e4743a8
Add inline drag-and-drop sorting for lists and relations
LukeTowers 6c37b3e
Use stripe load indicator when firing the request to reorder records
LukeTowers ce9818f
Don't flag the form as changed when reordering relation records
LukeTowers fea679e
Make the whole drag-handle cell the reorder target
LukeTowers af483ea
Refine the list drag handle: non-link element, visible icon, grab cursor
LukeTowers 690e905
Build SortableJS via Mix, harden onReorder, gate sortable lists
LukeTowers 13f8f86
Guard against overlapping reorder requests; drop dead pivot guards
LukeTowers f1af62f
Remove now-dead sortOrderColumn / getRecordSortOrder plumbing
LukeTowers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <?php | ||
|
|
||
| namespace Backend\Tests\Fixtures\Models; | ||
|
|
||
| use Illuminate\Support\Facades\Schema; | ||
| use Winter\Storm\Database\Model; | ||
| use Winter\Storm\Database\Traits\Sortable; | ||
|
|
||
| /** | ||
| * Self-contained Sortable model fixture for list reordering tests. | ||
| * | ||
| * Owns its own table so the backend test suite has no dependency on any plugin. | ||
| */ | ||
| class SortableFixture extends Model | ||
| { | ||
| use Sortable; | ||
|
|
||
| public $table = 'backend_test_sortable_fixtures'; | ||
|
|
||
| protected $guarded = []; | ||
|
|
||
| public $timestamps = false; | ||
|
|
||
| /** | ||
| * Create the backing table if it does not already exist. | ||
| */ | ||
| public static function migrateUp(): void | ||
| { | ||
| if (Schema::hasTable('backend_test_sortable_fixtures')) { | ||
| return; | ||
| } | ||
|
|
||
| Schema::create('backend_test_sortable_fixtures', function ($table) { | ||
| $table->increments('id'); | ||
| $table->string('name')->nullable(); | ||
| $table->string('label')->nullable(); | ||
| $table->integer('sort_order')->nullable(); | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Drop the backing table. | ||
| */ | ||
| public static function migrateDown(): void | ||
| { | ||
| Schema::dropIfExists('backend_test_sortable_fixtures'); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.