-
Notifications
You must be signed in to change notification settings - Fork 111
Remove Data\UserAction::ui property dependency in UI #1548
Copy link
Copy link
Closed
Labels
Description
UI class like Crud, Grid and any UserAction Executor should not be dependant on Data\Model\UserAction->ui property.
Take this data model user action as an example:
$model->addUserAction('edit', [
'fields' => true,
'modifier' => Model\UserAction::MODIFIER_UPDATE,
'appliesTo' => Model\UserAction::APPLIES_TO_SINGLE_RECORD,
'callback' => 'save',
'ui' => ['icon' => 'edit', 'button' => [null, 'icon' => [\atk4\ui\Icon::class, 'edit']], 'execButton' => [\atk4\ui\Button::class, 'Save', 'blue']],
]);
Creating Crud, Grid or using Ui UserAction executor should not rely upon the 'ui' property of Data\Model\UserAction. In fact, I believe this property should be removed.
- Ui element should rely on other model user action properties in order to provide basic information to UI View class on what to display to the user and how to react after the user execute the model action.
- Ui element that uses model user action should offer a way to override Views, like buttons, that fire them.
- Executor should also offer a way of overriding View (ModelExecutor button) that executes the action.
Reactions are currently unavailable