Problem/Motivation
The Field Widget Action module is merged into 1.2.x, however we need to start adding Automators plugins to it. The parent issue #3534445: Parent Issue: Create Field Widget Actions plugins for Automators. is a parent issue for all the implementations of the Automators plugins. Read more in the parent issue.
This is the implementation of the Field Widget Action(s) [field_widget_actions] for the AI Automator Type(s) [ai_automator_types].
Proposed resolution
- In the AI Automators module, create a new Field Widget Action plugin under src/Plugin/FieldWidgetAction.
- Call it [fieldWidgetActionsAiAutomatorType].php
- Use the FieldWidgetAction attribute and connect it to the correct widget_types and field_types
- At minimum, set up the first part of the aiAutomatorsAjax, where it picks the correct components, and if it should clearEntity and the formElementProperty. clearEntity, means that it removes the enities, to recreate them for the Automators, this should not be set if its a subfield.
- Manually test that its working and record a video of it working and upload to the feature (could be done by a reviewer).
- (optional, can be removed) Write at least a kernel test of the ajax function
- (optional, can be removed) Even better Function Javascript tests, but that is optional.
Issue fork custom_field-3535237
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
apmsooner commentedComment #6
a.dmitriiev commentedFor testing:
1. Install this module
2. Install ai_automators module.
3. Install field_widget_actions module (AI submodule)
4. Create a custom field
5. Create an automator for this field. Set the worker to "Field widget actions"
6. On manage form display of the entity bundle where the field was created go to settings of the field widget for the custom field. There will be a setting for "Field widget actions". Choose the plugin "Automator Custom field" and then select your automator in the action settings.
7. When you are on the edit form of the entity there will be a button near the custom field. When clicking this button the automator is triggered and the custom field properties are populated
Comment #8
apmsooner commented