Skip to content

Commit 2ad891c

Browse files
committed
Beginning of drag+drop re-ordering for status labels
Signed-off-by: snipe <[email protected]>
1 parent 914a647 commit 2ad891c

File tree

11 files changed

+2379
-4
lines changed

11 files changed

+2379
-4
lines changed

app/Presenters/StatusLabelPresenter.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@ public static function dataTableLayout()
2121
'switchable' => true,
2222
'title' => trans('general.id'),
2323
'visible' => false,
24-
], [
24+
],
25+
26+
[
27+
'field' => 'display_order',
28+
'searchable' => false,
29+
'sortable' => false,
30+
'switchable' => false,
31+
'title' => trans('admin/custom_fields/general.reorder'),
32+
'visible' => true,
33+
'class' => 'sr-only',
34+
],
35+
[
2536
'field' => 'name',
2637
'searchable' => true,
2738
'sortable' => true,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('status_labels', function (Blueprint $table) {
15+
$table->tinyInteger('display_order')->nullable()->default(0);
16+
});
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*/
22+
public function down(): void
23+
{
24+
Schema::table('status_labels', function (Blueprint $table) {
25+
$table->dropColumn('display_order');
26+
});
27+
}
28+
};

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"select2": "4.0.13",
5656
"sheetjs": "^2.0.0",
5757
"signature_pad": "^4.2.0",
58+
"tablednd": "^1.0.5",
5859
"tableexport.jquery.plugin": "1.30.0",
5960
"tether": "^1.4.0",
6061
"webpack": "^5.94.0"

public/css/dist/bootstrap-table.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)