fix #3238 【ブログカテゴリ】並び替え機能 追加#4443
Conversation
|
@kaburk おおお、ツリー形式になってる、便利になりますね。問題としてはメンテナンススコープが増えることぐらいですかね。 |
|
是非コアで欲しい機能です。 触ってみて気になった点は以下です。
あとは、コンテンツ管理のようにツリー構造のチェックやリセット機能が必要になってくるかもしれません。 |
|
とりあえず不具合的なところを修正して、ツリー構造のチェックやリセット機能(既存のコンテンツ管理と同等の機能)も追加しています。(リセット機能の改造構造維持についての改善は別チケットで検討中です) |
|
@kaburk ありがとうございます。いずれの問題も修正されていることを確認しました! |
There was a problem hiding this comment.
Pull request overview
ブログカテゴリ管理に「ツリー表示+ドラッグ&ドロップでの並び替え/再親付け」を追加し、ツリー破損時の検査・リセット機能をユーティリティ画面から実行できるようにする変更です。bc-blog のカテゴリを TreeBehavior(lft/rght)前提で扱う運用を強化し、管理画面の操作性と復旧手段を提供します。
Changes:
- 管理画面のブログカテゴリ一覧に「表形式/ツリー形式」切替を追加し、ツリー形式では jstree による DnD 並び替え・再親付けを実装
- API/Service/Table にカテゴリ移動ロジック(move / moveOffset / getOrderSameParent)を追加し、複数ブログで lft/rght が交錯するケースの回帰テストを追加
- ユーティリティ画面にブログカテゴリツリーの「検査(verity)/リセット」導線を追加し、共通のツリー検査ロジックを UtilitiesService に抽出
Reviewed changes
Copilot reviewed 24 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/bc-blog/tests/TestCase/Service/BlogCategoriesServiceTest.php | move/verityTree/resetTree 等のサービス層テストを追加 |
| plugins/bc-blog/tests/TestCase/Model/BlogCategoriesTableTest.php | getOrderSameParent/moveOffset/resetTree のテーブル層テストを追加 |
| plugins/bc-blog/tests/TestCase/Controller/Api/Admin/BlogCategoriesControllerTest.php | API move エンドポイントの結合テストを追加 |
| plugins/bc-blog/tests/TestCase/Controller/Admin/BlogCategoriesControllerTest.php | 管理画面の表示切替、ツリー検査/リセット、親指定追加のテストを追加 |
| plugins/bc-blog/src/Service/BlogCategoriesServiceInterface.php | getNew の引数拡張と move/verityTree/resetTree をI/Fに追加 |
| plugins/bc-blog/src/Service/BlogCategoriesService.php | カテゴリ移動(並び替え・再親付け)とツリー検査/リセットのサービス実装を追加 |
| plugins/bc-blog/src/Service/Admin/BlogCategoriesAdminServiceInterface.php | 一覧用 viewVars に listType を追加 |
| plugins/bc-blog/src/Service/Admin/BlogCategoriesAdminService.php | 一覧テンプレート切替(ツリー/表)とツリー取得(threaded)を追加 |
| plugins/bc-blog/src/Model/Table/BlogCategoriesTable.php | 同一親内順位取得・オフセット移動・ツリーリセットを追加 |
| plugins/bc-blog/src/Event/BcBlogViewEventListener.php | Utilities 画面にブログカテゴリツリー関連セクションを差し込むイベントを追加 |
| plugins/bc-blog/src/Controller/Api/Admin/BlogCategoriesController.php | カテゴリ移動 API(move)を追加 |
| plugins/bc-blog/src/Controller/Admin/BlogCategoriesController.php | 一覧表示形式のセッション保持、親ID指定追加、ツリー検査/リセットアクションを追加 |
| plugins/bc-blog/config/permission.php | ツリー検査/リセット用の権限定義を追加 |
| plugins/bc-admin-third/webroot/bc_blog/js/admin/blog_categories/index.bundle.js.map | 管理画面カテゴリ一覧JSのビルド成果物(map)更新 |
| plugins/bc-admin-third/webroot/bc_blog/js/admin/blog_categories/index.bundle.js | 管理画面カテゴリ一覧JSのビルド成果物更新 |
| plugins/bc-admin-third/templates/plugin/BcBlog/Admin/element/Utilities/blog_categories_tree.php | Utilities 画面のブログカテゴリツリー検査/リセットUI要素を追加 |
| plugins/bc-admin-third/templates/plugin/BcBlog/Admin/element/BlogCategories/index_view_setting.php | 一覧の表示形式(ツリー/表)切替UIを追加 |
| plugins/bc-admin-third/templates/plugin/BcBlog/Admin/element/BlogCategories/index_tree.php | ツリー表示テンプレートを追加 |
| plugins/bc-admin-third/templates/plugin/BcBlog/Admin/element/BlogCategories/index_setup.php | 一覧ページのJS/CSS読込とi18n文言定義を追加 |
| plugins/bc-admin-third/templates/plugin/BcBlog/Admin/element/BlogCategories/index_list.php | 表形式側の行に sortable クラス付与 |
| plugins/bc-admin-third/templates/plugin/BcBlog/Admin/element/BlogCategories/index_list_tree.php | jstree 用の再帰ツリーHTML(data-jstree)を追加 |
| plugins/bc-admin-third/templates/plugin/BcBlog/Admin/BlogCategories/index.php | 一覧をテンプレート切替(tree/list)前提に変更し、表示切替UI等を組込 |
| plugins/bc-admin-third/templates/Admin/Utilities/index.php | afterUtilitiesIndex イベントを dispatch して拡張セクションを描画可能に |
| plugins/bc-admin-third/src/bc_blog/js/admin/blog_categories/index.js | ツリー表示・DnD移動・右クリックメニュー等の実装を追加 |
| plugins/baser-core/src/Service/UtilitiesServiceInterface.php | 任意テーブル向けのツリー検査メソッド(verityTree)を追加 |
| plugins/baser-core/src/Service/UtilitiesService.php | verityContentsTree を共通化し、verityTree(Table) を実装 |
作成してみました。どうでしょうか?
コアに入れるべきでなさそうでしたら、別途プラグイン化しようと思います。