From: Dan Brown Date: Tue, 11 Feb 2025 14:36:25 +0000 (+0000) Subject: Sorting: Renamed sort set to sort rule X-Git-Tag: v25.02~1^2~17^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/b9306a9029f41f3779b755d08c907a2edafc33df Sorting: Renamed sort set to sort rule Renamed based on feedback from Tim and Script on Discord. Also fixed flaky test --- diff --git a/app/Activity/ActivityType.php b/app/Activity/ActivityType.php index 4a648da6c..a7f129f71 100644 --- a/app/Activity/ActivityType.php +++ b/app/Activity/ActivityType.php @@ -71,9 +71,9 @@ class ActivityType const IMPORT_RUN = 'import_run'; const IMPORT_DELETE = 'import_delete'; - const SORT_SET_CREATE = 'sort_set_create'; - const SORT_SET_UPDATE = 'sort_set_update'; - const SORT_SET_DELETE = 'sort_set_delete'; + const SORT_RULE_CREATE = 'sort_rule_create'; + const SORT_RULE_UPDATE = 'sort_rule_update'; + const SORT_RULE_DELETE = 'sort_rule_delete'; /** * Get all the possible values. diff --git a/app/Console/Commands/AssignSortSetCommand.php b/app/Console/Commands/AssignSortSetCommand.php index 484f69952..6c9d3f764 100644 --- a/app/Console/Commands/AssignSortSetCommand.php +++ b/app/Console/Commands/AssignSortSetCommand.php @@ -4,7 +4,7 @@ namespace BookStack\Console\Commands; use BookStack\Entities\Models\Book; use BookStack\Sorting\BookSorter; -use BookStack\Sorting\SortSet; +use BookStack\Sorting\SortRule; use Illuminate\Console\Command; class AssignSortSetCommand extends Command @@ -37,7 +37,7 @@ class AssignSortSetCommand extends Command return $this->listSortSets(); } - $set = SortSet::query()->find($sortSetId); + $set = SortRule::query()->find($sortSetId); if ($this->option('all-books')) { $query = Book::query(); } else if ($this->option('books-without-sort')) { @@ -87,7 +87,7 @@ class AssignSortSetCommand extends Command protected function listSortSets(): int { - $sets = SortSet::query()->orderBy('id', 'asc')->get(); + $sets = SortRule::query()->orderBy('id', 'asc')->get(); $this->error("Sort set ID required!"); $this->warn("\nAvailable sort sets:"); foreach ($sets as $set) { diff --git a/app/Entities/Models/Book.php b/app/Entities/Models/Book.php index 7d240e5ca..ede4fc7d5 100644 --- a/app/Entities/Models/Book.php +++ b/app/Entities/Models/Book.php @@ -2,7 +2,7 @@ namespace BookStack\Entities\Models; -use BookStack\Sorting\SortSet; +use BookStack\Sorting\SortRule; use BookStack\Uploads\Image; use Exception; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -17,14 +17,14 @@ use Illuminate\Support\Collection; * @property string $description * @property int $image_id * @property ?int $default_template_id - * @property ?int $sort_set_id + * @property ?int $sort_rule_id * @property Image|null $cover * @property \Illuminate\Database\Eloquent\Collection $chapters * @property \Illuminate\Database\Eloquent\Collection $pages * @property \Illuminate\Database\Eloquent\Collection $directPages * @property \Illuminate\Database\Eloquent\Collection $shelves * @property ?Page $defaultTemplate - * @property ?SortSet $sortSet + * @property ?SortRule $sortRule */ class Book extends Entity implements HasCoverImage { @@ -88,9 +88,9 @@ class Book extends Entity implements HasCoverImage /** * Get the sort set assigned to this book, if existing. */ - public function sortSet(): BelongsTo + public function sortRule(): BelongsTo { - return $this->belongsTo(SortSet::class); + return $this->belongsTo(SortRule::class); } /** diff --git a/app/Entities/Repos/BookRepo.php b/app/Entities/Repos/BookRepo.php index b3b811647..92e6a81c3 100644 --- a/app/Entities/Repos/BookRepo.php +++ b/app/Entities/Repos/BookRepo.php @@ -8,7 +8,7 @@ use BookStack\Entities\Models\Book; use BookStack\Entities\Tools\TrashCan; use BookStack\Exceptions\ImageUploadException; use BookStack\Facades\Activity; -use BookStack\Sorting\SortSet; +use BookStack\Sorting\SortRule; use BookStack\Uploads\ImageRepo; use Exception; use Illuminate\Http\UploadedFile; @@ -35,8 +35,8 @@ class BookRepo Activity::add(ActivityType::BOOK_CREATE, $book); $defaultBookSortSetting = intval(setting('sorting-book-default', '0')); - if ($defaultBookSortSetting && SortSet::query()->find($defaultBookSortSetting)) { - $book->sort_set_id = $defaultBookSortSetting; + if ($defaultBookSortSetting && SortRule::query()->find($defaultBookSortSetting)) { + $book->sort_rule_id = $defaultBookSortSetting; $book->save(); } diff --git a/app/Sorting/BookSortController.php b/app/Sorting/BookSortController.php index 98d79d0fd..479d19724 100644 --- a/app/Sorting/BookSortController.php +++ b/app/Sorting/BookSortController.php @@ -69,10 +69,10 @@ class BookSortController extends Controller if ($request->filled('auto-sort')) { $sortSetId = intval($request->get('auto-sort')) ?: null; - if ($sortSetId && SortSet::query()->find($sortSetId) === null) { + if ($sortSetId && SortRule::query()->find($sortSetId) === null) { $sortSetId = null; } - $book->sort_set_id = $sortSetId; + $book->sort_rule_id = $sortSetId; $book->save(); $sorter->runBookAutoSort($book); if (!$loggedActivityForBook) { diff --git a/app/Sorting/BookSorter.php b/app/Sorting/BookSorter.php index b6fe33b9c..7bf1b63f4 100644 --- a/app/Sorting/BookSorter.php +++ b/app/Sorting/BookSorter.php @@ -16,7 +16,7 @@ class BookSorter ) { } - public function runBookAutoSortForAllWithSet(SortSet $set): void + public function runBookAutoSortForAllWithSet(SortRule $set): void { $set->books()->chunk(50, function ($books) { foreach ($books as $book) { @@ -32,12 +32,12 @@ class BookSorter */ public function runBookAutoSort(Book $book): void { - $set = $book->sortSet; + $set = $book->sortRule; if (!$set) { return; } - $sortFunctions = array_map(function (SortSetOperation $op) { + $sortFunctions = array_map(function (SortRuleOperation $op) { return $op->getSortFunction(); }, $set->getOperations()); diff --git a/app/Sorting/SortSet.php b/app/Sorting/SortRule.php similarity index 77% rename from app/Sorting/SortSet.php rename to app/Sorting/SortRule.php index cc8879f96..45e5514fd 100644 --- a/app/Sorting/SortSet.php +++ b/app/Sorting/SortRule.php @@ -17,24 +17,24 @@ use Illuminate\Database\Eloquent\Relations\HasMany; * @property Carbon $created_at * @property Carbon $updated_at */ -class SortSet extends Model implements Loggable +class SortRule extends Model implements Loggable { use HasFactory; /** - * @return SortSetOperation[] + * @return SortRuleOperation[] */ public function getOperations(): array { - return SortSetOperation::fromSequence($this->sequence); + return SortRuleOperation::fromSequence($this->sequence); } /** - * @param SortSetOperation[] $options + * @param SortRuleOperation[] $options */ public function setOperations(array $options): void { - $values = array_map(fn (SortSetOperation $opt) => $opt->value, $options); + $values = array_map(fn (SortRuleOperation $opt) => $opt->value, $options); $this->sequence = implode(',', $values); } @@ -45,7 +45,7 @@ class SortSet extends Model implements Loggable public function getUrl(): string { - return url("/settings/sorting/sets/{$this->id}"); + return url("/settings/sorting/rules/{$this->id}"); } public function books(): HasMany diff --git a/app/Sorting/SortSetController.php b/app/Sorting/SortRuleController.php similarity index 51% rename from app/Sorting/SortSetController.php rename to app/Sorting/SortRuleController.php index 7b1c0bc41..96b8e8ef5 100644 --- a/app/Sorting/SortSetController.php +++ b/app/Sorting/SortRuleController.php @@ -6,7 +6,7 @@ use BookStack\Activity\ActivityType; use BookStack\Http\Controller; use Illuminate\Http\Request; -class SortSetController extends Controller +class SortRuleController extends Controller { public function __construct() { @@ -15,9 +15,9 @@ class SortSetController extends Controller public function create() { - $this->setPageTitle(trans('settings.sort_set_create')); + $this->setPageTitle(trans('settings.sort_rule_create')); - return view('settings.sort-sets.create'); + return view('settings.sort-rules.create'); } public function store(Request $request) @@ -27,28 +27,28 @@ class SortSetController extends Controller 'sequence' => ['required', 'string', 'min:1'], ]); - $operations = SortSetOperation::fromSequence($request->input('sequence')); + $operations = SortRuleOperation::fromSequence($request->input('sequence')); if (count($operations) === 0) { return redirect()->withInput()->withErrors(['sequence' => 'No operations set.']); } - $set = new SortSet(); - $set->name = $request->input('name'); - $set->setOperations($operations); - $set->save(); + $rule = new SortRule(); + $rule->name = $request->input('name'); + $rule->setOperations($operations); + $rule->save(); - $this->logActivity(ActivityType::SORT_SET_CREATE, $set); + $this->logActivity(ActivityType::SORT_RULE_CREATE, $rule); return redirect('/settings/sorting'); } public function edit(string $id) { - $set = SortSet::query()->findOrFail($id); + $rule = SortRule::query()->findOrFail($id); - $this->setPageTitle(trans('settings.sort_set_edit')); + $this->setPageTitle(trans('settings.sort_rule_edit')); - return view('settings.sort-sets.edit', ['set' => $set]); + return view('settings.sort-rules.edit', ['rule' => $rule]); } public function update(string $id, Request $request, BookSorter $bookSorter) @@ -58,21 +58,21 @@ class SortSetController extends Controller 'sequence' => ['required', 'string', 'min:1'], ]); - $set = SortSet::query()->findOrFail($id); - $operations = SortSetOperation::fromSequence($request->input('sequence')); + $rule = SortRule::query()->findOrFail($id); + $operations = SortRuleOperation::fromSequence($request->input('sequence')); if (count($operations) === 0) { - return redirect($set->getUrl())->withInput()->withErrors(['sequence' => 'No operations set.']); + return redirect($rule->getUrl())->withInput()->withErrors(['sequence' => 'No operations set.']); } - $set->name = $request->input('name'); - $set->setOperations($operations); - $changedSequence = $set->isDirty('sequence'); - $set->save(); + $rule->name = $request->input('name'); + $rule->setOperations($operations); + $changedSequence = $rule->isDirty('sequence'); + $rule->save(); - $this->logActivity(ActivityType::SORT_SET_UPDATE, $set); + $this->logActivity(ActivityType::SORT_RULE_UPDATE, $rule); if ($changedSequence) { - $bookSorter->runBookAutoSortForAllWithSet($set); + $bookSorter->runBookAutoSortForAllWithSet($rule); } return redirect('/settings/sorting'); @@ -80,16 +80,16 @@ class SortSetController extends Controller public function destroy(string $id, Request $request) { - $set = SortSet::query()->findOrFail($id); + $rule = SortRule::query()->findOrFail($id); $confirmed = $request->input('confirm') === 'true'; - $booksAssigned = $set->books()->count(); + $booksAssigned = $rule->books()->count(); $warnings = []; if ($booksAssigned > 0) { if ($confirmed) { - $set->books()->update(['sort_set_id' => null]); + $rule->books()->update(['sort_rule_id' => null]); } else { - $warnings[] = trans('settings.sort_set_delete_warn_books', ['count' => $booksAssigned]); + $warnings[] = trans('settings.sort_rule_delete_warn_books', ['count' => $booksAssigned]); } } @@ -98,16 +98,16 @@ class SortSetController extends Controller if ($confirmed) { setting()->remove('sorting-book-default'); } else { - $warnings[] = trans('settings.sort_set_delete_warn_default'); + $warnings[] = trans('settings.sort_rule_delete_warn_default'); } } if (count($warnings) > 0) { - return redirect($set->getUrl() . '#delete')->withErrors(['delete' => $warnings]); + return redirect($rule->getUrl() . '#delete')->withErrors(['delete' => $warnings]); } - $set->delete(); - $this->logActivity(ActivityType::SORT_SET_DELETE, $set); + $rule->delete(); + $this->logActivity(ActivityType::SORT_RULE_DELETE, $rule); return redirect('/settings/sorting'); } diff --git a/app/Sorting/SortSetOperation.php b/app/Sorting/SortRuleOperation.php similarity index 74% rename from app/Sorting/SortSetOperation.php rename to app/Sorting/SortRuleOperation.php index 7fdd0b002..0d8ff239f 100644 --- a/app/Sorting/SortSetOperation.php +++ b/app/Sorting/SortRuleOperation.php @@ -5,7 +5,7 @@ namespace BookStack\Sorting; use Closure; use Illuminate\Support\Str; -enum SortSetOperation: string +enum SortRuleOperation: string { case NameAsc = 'name_asc'; case NameDesc = 'name_desc'; @@ -26,13 +26,13 @@ enum SortSetOperation: string $label = ''; if (str_ends_with($key, '_asc')) { $key = substr($key, 0, -4); - $label = trans('settings.sort_set_op_asc'); + $label = trans('settings.sort_rule_op_asc'); } elseif (str_ends_with($key, '_desc')) { $key = substr($key, 0, -5); - $label = trans('settings.sort_set_op_desc'); + $label = trans('settings.sort_rule_op_desc'); } - $label = trans('settings.sort_set_op_' . $key) . ' ' . $label; + $label = trans('settings.sort_rule_op_' . $key) . ' ' . $label; return trim($label); } @@ -43,12 +43,12 @@ enum SortSetOperation: string } /** - * @return SortSetOperation[] + * @return SortRuleOperation[] */ public static function allExcluding(array $operations): array { - $all = SortSetOperation::cases(); - $filtered = array_filter($all, function (SortSetOperation $operation) use ($operations) { + $all = SortRuleOperation::cases(); + $filtered = array_filter($all, function (SortRuleOperation $operation) use ($operations) { return !in_array($operation, $operations); }); return array_values($filtered); @@ -57,12 +57,12 @@ enum SortSetOperation: string /** * Create a set of operations from a string sequence representation. * (values seperated by commas). - * @return SortSetOperation[] + * @return SortRuleOperation[] */ public static function fromSequence(string $sequence): array { $strOptions = explode(',', $sequence); - $options = array_map(fn ($val) => SortSetOperation::tryFrom($val), $strOptions); + $options = array_map(fn ($val) => SortRuleOperation::tryFrom($val), $strOptions); return array_filter($options); } } diff --git a/database/factories/Entities/Models/BookFactory.php b/database/factories/Entities/Models/BookFactory.php index 29403a294..48d43d7a8 100644 --- a/database/factories/Entities/Models/BookFactory.php +++ b/database/factories/Entities/Models/BookFactory.php @@ -27,7 +27,7 @@ class BookFactory extends Factory 'slug' => Str::random(10), 'description' => $description, 'description_html' => '

' . e($description) . '

', - 'sort_set_id' => null, + 'sort_rule_id' => null, 'default_template_id' => null, ]; } diff --git a/database/factories/Sorting/SortSetFactory.php b/database/factories/Sorting/SortRuleFactory.php similarity index 70% rename from database/factories/Sorting/SortSetFactory.php rename to database/factories/Sorting/SortRuleFactory.php index 36e0a6976..dafe8c3fa 100644 --- a/database/factories/Sorting/SortSetFactory.php +++ b/database/factories/Sorting/SortRuleFactory.php @@ -2,25 +2,25 @@ namespace Database\Factories\Sorting; -use BookStack\Sorting\SortSet; -use BookStack\Sorting\SortSetOperation; +use BookStack\Sorting\SortRule; +use BookStack\Sorting\SortRuleOperation; use Illuminate\Database\Eloquent\Factories\Factory; -class SortSetFactory extends Factory +class SortRuleFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ - protected $model = SortSet::class; + protected $model = SortRule::class; /** * Define the model's default state. */ public function definition(): array { - $cases = SortSetOperation::cases(); + $cases = SortRuleOperation::cases(); $op = $cases[array_rand($cases)]; return [ 'name' => $op->name . ' Sort', diff --git a/database/migrations/2025_01_29_180933_create_sort_sets_table.php b/database/migrations/2025_01_29_180933_create_sort_rules_table.php similarity index 82% rename from database/migrations/2025_01_29_180933_create_sort_sets_table.php rename to database/migrations/2025_01_29_180933_create_sort_rules_table.php index bf9780c5b..37d20ddf6 100644 --- a/database/migrations/2025_01_29_180933_create_sort_sets_table.php +++ b/database/migrations/2025_01_29_180933_create_sort_rules_table.php @@ -11,7 +11,7 @@ return new class extends Migration */ public function up(): void { - Schema::create('sort_sets', function (Blueprint $table) { + Schema::create('sort_rules', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->text('sequence'); @@ -24,6 +24,6 @@ return new class extends Migration */ public function down(): void { - Schema::dropIfExists('sort_sets'); + Schema::dropIfExists('sort_rules'); } }; diff --git a/database/migrations/2025_02_05_150842_add_sort_set_id_to_books.php b/database/migrations/2025_02_05_150842_add_sort_rule_id_to_books.php similarity index 79% rename from database/migrations/2025_02_05_150842_add_sort_set_id_to_books.php rename to database/migrations/2025_02_05_150842_add_sort_rule_id_to_books.php index c0b32c552..106db05ca 100644 --- a/database/migrations/2025_02_05_150842_add_sort_set_id_to_books.php +++ b/database/migrations/2025_02_05_150842_add_sort_rule_id_to_books.php @@ -12,7 +12,7 @@ return new class extends Migration public function up(): void { Schema::table('books', function (Blueprint $table) { - $table->unsignedInteger('sort_set_id')->nullable()->default(null); + $table->unsignedInteger('sort_rule_id')->nullable()->default(null); }); } @@ -22,7 +22,7 @@ return new class extends Migration public function down(): void { Schema::table('books', function (Blueprint $table) { - $table->dropColumn('sort_set_id'); + $table->dropColumn('sort_rule_id'); }); } }; diff --git a/lang/en/entities.php b/lang/en/entities.php index 28a209fa2..a74785eaa 100644 --- a/lang/en/entities.php +++ b/lang/en/entities.php @@ -166,7 +166,7 @@ return [ 'books_search_this' => 'Search this book', 'books_navigation' => 'Book Navigation', 'books_sort' => 'Sort Book Contents', - 'books_sort_desc' => 'Move chapters and pages within a book to reorganise its contents. Other books can be added which allows easy moving of chapters and pages between books. Optionally an auto sort option can be set to automatically sort this book\'s contents upon changes.', + 'books_sort_desc' => 'Move chapters and pages within a book to reorganise its contents. Other books can be added which allows easy moving of chapters and pages between books. Optionally an auto sort rule can be set to automatically sort this book\'s contents upon changes.', 'books_sort_auto_sort' => 'Auto Sort Option', 'books_sort_auto_sort_active' => 'Auto Sort Active: :sortName', 'books_sort_named' => 'Sort Book :bookName', diff --git a/lang/en/settings.php b/lang/en/settings.php index 344c186cb..098479f3b 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -77,32 +77,32 @@ return [ // Sorting Settings 'sorting' => 'Sorting', 'sorting_book_default' => 'Default Book Sort', - 'sorting_book_default_desc' => 'Select the default sort set to apply to new books. This won\'t affect existing books, and can be overridden per-book.', - 'sorting_sets' => 'Sort Sets', - 'sorting_sets_desc' => 'These are predefined sorting operations which can be applied to content in the system.', - 'sort_set_assigned_to_x_books' => 'Assigned to :count Book|Assigned to :count Books', - 'sort_set_create' => 'Create Sort Set', - 'sort_set_edit' => 'Edit Sort Set', - 'sort_set_delete' => 'Delete Sort Set', - 'sort_set_delete_desc' => 'Remove this sort set from the system. Books using this sort will revert to manual sorting.', - 'sort_set_delete_warn_books' => 'This sort set is currently used on :count book(s). Are you sure you want to delete this?', - 'sort_set_delete_warn_default' => 'This sort set is currently used as the default for books. Are you sure you want to delete this?', - 'sort_set_details' => 'Sort Set Details', - 'sort_set_details_desc' => 'Set a name for this sort set, which will appear in lists when users are selecting a sort.', - 'sort_set_operations' => 'Sort Operations', - 'sort_set_operations_desc' => 'Configure the sort actions to be performed in this set by moving them from the list of available operations. Upon use, the operations will be applied in order, from top to bottom.', - 'sort_set_available_operations' => 'Available Operations', - 'sort_set_available_operations_empty' => 'No operations remaining', - 'sort_set_configured_operations' => 'Configured Operations', - 'sort_set_configured_operations_empty' => 'Drag/add operations from the "Available Operations" list', - 'sort_set_op_asc' => '(Asc)', - 'sort_set_op_desc' => '(Desc)', - 'sort_set_op_name' => 'Name - Alphabetical', - 'sort_set_op_name_numeric' => 'Name - Numeric', - 'sort_set_op_created_date' => 'Created Date', - 'sort_set_op_updated_date' => 'Updated Date', - 'sort_set_op_chapters_first' => 'Chapters First', - 'sort_set_op_chapters_last' => 'Chapters Last', + 'sorting_book_default_desc' => 'Select the default sort role to apply to new books. This won\'t affect existing books, and can be overridden per-book.', + 'sorting_rules' => 'Sort Rules', + 'sorting_rules_desc' => 'These are predefined sorting operations which can be applied to content in the system.', + 'sort_rule_assigned_to_x_books' => 'Assigned to :count Book|Assigned to :count Books', + 'sort_rule_create' => 'Create Sort Rule', + 'sort_rule_edit' => 'Edit Sort Rule', + 'sort_rule_delete' => 'Delete Sort Rule', + 'sort_rule_delete_desc' => 'Remove this sort rule from the system. Books using this sort will revert to manual sorting.', + 'sort_rule_delete_warn_books' => 'This sort rule is currently used on :count book(s). Are you sure you want to delete this?', + 'sort_rule_delete_warn_default' => 'This sort rule is currently used as the default for books. Are you sure you want to delete this?', + 'sort_rule_details' => 'Sort Rule Details', + 'sort_rule_details_desc' => 'Set a name for this sort rule, which will appear in lists when users are selecting a sort.', + 'sort_rule_operations' => 'Sort Operations', + 'sort_rule_operations_desc' => 'Configure the sort actions to be performed in this set by moving them from the list of available operations. Upon use, the operations will be applied in order, from top to bottom.', + 'sort_rule_available_operations' => 'Available Operations', + 'sort_rule_available_operations_empty' => 'No operations remaining', + 'sort_rule_configured_operations' => 'Configured Operations', + 'sort_rule_configured_operations_empty' => 'Drag/add operations from the "Available Operations" list', + 'sort_rule_op_asc' => '(Asc)', + 'sort_rule_op_desc' => '(Desc)', + 'sort_rule_op_name' => 'Name - Alphabetical', + 'sort_rule_op_name_numeric' => 'Name - Numeric', + 'sort_rule_op_created_date' => 'Created Date', + 'sort_rule_op_updated_date' => 'Updated Date', + 'sort_rule_op_chapters_first' => 'Chapters First', + 'sort_rule_op_chapters_last' => 'Chapters Last', // Maintenance settings 'maint' => 'Maintenance', diff --git a/resources/js/components/index.ts b/resources/js/components/index.ts index affa25fcf..10b8025db 100644 --- a/resources/js/components/index.ts +++ b/resources/js/components/index.ts @@ -50,7 +50,7 @@ export {ShelfSort} from './shelf-sort'; export {Shortcuts} from './shortcuts'; export {ShortcutInput} from './shortcut-input'; export {SortableList} from './sortable-list'; -export {SortSetManager} from './sort-set-manager' +export {SortRuleManager} from './sort-rule-manager' export {SubmitOnChange} from './submit-on-change'; export {Tabs} from './tabs'; export {TagManager} from './tag-manager'; diff --git a/resources/js/components/sort-set-manager.ts b/resources/js/components/sort-rule-manager.ts similarity index 93% rename from resources/js/components/sort-set-manager.ts rename to resources/js/components/sort-rule-manager.ts index c35ad41fe..ff08f4ab8 100644 --- a/resources/js/components/sort-set-manager.ts +++ b/resources/js/components/sort-rule-manager.ts @@ -3,7 +3,7 @@ import Sortable from "sortablejs"; import {buildListActions, sortActionClickListener} from "../services/dual-lists"; -export class SortSetManager extends Component { +export class SortRuleManager extends Component { protected input!: HTMLInputElement; protected configuredList!: HTMLElement; @@ -25,7 +25,7 @@ export class SortSetManager extends Component { const scrollBoxes = [this.configuredList, this.availableList]; for (const scrollBox of scrollBoxes) { new Sortable(scrollBox, { - group: 'sort-set-operations', + group: 'sort-rule-operations', ghostClass: 'primary-background-light', handle: '.handle', animation: 150, diff --git a/resources/views/books/parts/sort-box.blade.php b/resources/views/books/parts/sort-box.blade.php index 232616168..6fdb1819e 100644 --- a/resources/views/books/parts/sort-box.blade.php +++ b/resources/views/books/parts/sort-box.blade.php @@ -9,18 +9,23 @@ {{ $book->name }}
- @if($book->sortSet) - @icon('auto-sort') + @if($book->sortRule) + @icon('auto-sort') @endif
- - - - - + + + + +