feat(grid): add select/combo editor types for category products inline edit#157
Open
Ibochkarev wants to merge 1 commit into
Open
feat(grid): add select/combo editor types for category products inline edit#157Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
e54131b to
c534194
Compare
2eee283 to
606cd06
Compare
Registry, composable, options API; GridFieldsConfig editor types; CHANGELOG/lexicon.
606cd06 to
18a29eb
Compare
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.
Описание
Добавлена поддержка select и combo для inline-редактирования в таблице товаров категории (closes #155). Базовая реализация расширяет PR #134; поверх первоначального коммита выполнен архитектурный рефакторинг (единый контракт опций, реестр справочников, composable).
Select (статические опции)
editor_type: 'select'в конфиге колонкиeditor_options: [{ label, value }, ...]Selectсoption-value="value"/option-label="label"Combo (опции из API)
editor_type: 'combo'editor_reference— ключ из серверного реестра (напримерvendors→ путь к API)editor_combo_endpoint(опционально) — переопределение URL только если путь в белом списке (префикс/api/mgr/references/)editor_reference. Должен быть задан reference или allowlisted endpoint (валидация при сохранении вGridFieldsConfigи на бэкенде)API и контракт данных
GET .../references/vendorsдополняет ответ массивомoptions: [{ value, label }]; полеvendorsсохранено для обратной совместимости{ value, label }[](toSelectOptionsFromReferencesResponse)Бэкенд
GridEditorReferenceRegistry— whitelist ключ → путь, проверка allowlist для overrideGridColumnEditorType— константы типов редактора (text,number,select,combo)GridConfigService— сохранениеeditor_reference,editor_combo_endpoint, очистка combo-полей при смене типаGridConfigController— в ответе конфига дляcategory-productsпередаётсяeditor_referencesдля UIФронтенд (vueManager)
useCategoryProductsInlineEdit— состояние inline-edit, загрузка combo, сохранениеutils/gridEditorOptions.js— чистые функции: allowlist URL, резолв URL, маппинг ответа API → опцииconstants/gridColumnEditorTypes.js— замороженный объект +normalizeGridColumnEditorType/ хелперыCategoryProductsGrid— подключение composable, одинSelectдля select+comboGridFieldsConfig— выбор reference, поле override URL, лексиконы ru/enТип изменений
editor_combo_endpointпродолжают работать как override)Связанные Issues
Closes #155
Как протестировано
Сценарии:
editor_type: selectи JSONeditor_optionseditor_reference: vendorsбез overrideeditor_combo_endpointshowClearдля nullable combo-полейЧеклист
Дополнительно
ProductDataService::$allowedUpdateFieldsпо-прежнему должен включать редактируемые поля (напримерvendor_id,made_in).