feat(extra-fields): add ms3-key-value field type#323
Open
Ibochkarev wants to merge 1 commit into
Open
Conversation
Introduce configurable key-value extra fields with fixed and free modes, backend validation via KeyValueFieldService, and Vue editor components for manager forms and extra field definitions. Closes modx-pro#300
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.
Описание
Добавляет тип extra field
ms3-key-valueдля хранения пар ключ–значение с JSON-схемой в колонкеkey_value_config.Поддерживаются два режима:
Backend:
KeyValueFieldService(валидация, нормализация, сериализация), миграция Phinx, регистрация вServiceRegistry, интеграция вExtraFieldsService,ProductDataServiceи валидацию extra fields вOrdersController.Frontend (Vue Manager):
KeyValueField,KeyValueSchemaEditor, утилитыkeyValueField.js, подключение вDynamicField,ExtraFieldsManagerиOrderExtraFieldsSection.Тип изменений
Связанные Issues
Closes #300
Как это было протестировано?
Конфигурация тестирования:
feat/300-key-value-extra-fieldотbetaПроверки:
php -lнаKeyValueFieldService.php, миграции,ExtraFieldsService.php,ProductDataService.php,OrdersController.phpnpx eslintнаKeyValueField.vue,KeyValueSchemaEditor.vue,keyValueField.js,DynamicField.vue,ExtraFieldsManager.vue,OrderExtraFieldsSection.vuePHPStan и полный прогон MODX не выполнялись.
Скриншоты (если применимо)
Не приложены: изменения затрагивают формы менеджера и конфигурацию extra fields; визуальная проверка выполнялась локально.
Чеклист
Дополнительные заметки
Реализация следует паттерну
ms3-repeater(#301): отдельный сервис, колонка конфига вms3_extra_fields, Vue-компоненты для редактирования схемы и значений. CHANGELOG не обновлялся — по политике репозитория записи добавляются при подготовке релиза.