feat: вкладка «Категории» товара на Vue (#113) - #479
Open
Ibochkarev wants to merge 5 commits into
Open
Conversation
Replace ms3-tree-categories with a Vue tab backed by a reusable ResourceCategoryTree widget and REST tree endpoint. Closes #113.
Ibochkarev
force-pushed
the
feat/issue-113-product-categories-vue
branch
from
July 29, 2026 11:31
700385d to
b7aba67
Compare
Satisfy PHPStan for constructor/property typing and select() column aliases.
When the Vue tree sends categories, checked state follows the client allowlist instead of stale msCategoryMember rows from the database.
This was referenced Jul 29, 2026
- Drop invalid addCss for ResourceCategoryTree.min.css from product update and settings controllers; the widget styles ship inside the product-tabs and options CSS bundles, so the dedicated file 404'd. - Register ProductCategoryTreeService as ms3_product_category_tree in ServiceRegistry and inject it via the container in ProductDataController::getCategoriesTree instead of `new`. - Extract MiniShop3\Utils\IntArrayDecoder and route both BaseApiController::decodeIntArray and OptionsController::decodeIntArray through it, removing the duplicated ad-hoc implementations. The shared decoder deduplicates and keeps only positive ids. - Extract MiniShop3\Utils\ResourceCategoryTreeQueryTrait with the category/container class-key sets and SQL helpers, used by both ProductCategoryTreeService and OptionsController::getTree.
PHPStan: $out is already a list built via sequential append.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Описание
Вкладка «Категории» на странице редактирования товара переведена с ExtJS (
ms3-tree-categories) на Vue. Добавлен переиспользуемый виджетResourceCategoryTree(PrimeVue Tree + независимые чекбоксы), REST endpoint для lazy-дерева и hidden inputcategoriesдля сохранения через существующий контрактProductDataService::saveCategories().Тип изменений
Связанные Issues
Closes #113
Refs #350 — после merge остаются ExtJS: вкладка «Связи» (
links.grid.js), shell формы товара (product.common.js,ms3.combo.js), combos справочников. Shell и #114 — отдельные PR.Как это было протестировано?
Локальный CI-гейт:
composer ci:php,npm run lint:ci)Конфигурация тестирования:
feat/issue-113-product-categories-vuephp -l)Скриншоты (если применимо)
ms3-tree-categoriesProductCategoriesTab+ResourceCategoryTreeЧеклист
categoriesсохранён)manager.inc.php/ MODX core)npm run lint:ci)Дополнительные заметки
Gate A (#113):
ProductCategoriesTab.vue,ProductTabs.vueResourceCategoryTree.vue, рефакторOptionCategoryTree.vuename="categories",saveCategories()без измененийGET /api/mgr/product-data/{id}/categories/treecomposer ci:phpDeferred (non-blockers): единый
CategoryTreeNodeProviderдля GetNodes + REST; registry DI дляProductCategoryTreeService; рефактор dispatch built-in tabs вProductTabs.vue.