Conversation
- fix behat test - remove ui dependency - fix card deck - fix demo file using model user action - switch executorFactory property at View level
more formally remove ui property from atk4/data, right? (as atk4/data does not depend on atk4/ui) |
Yes but this pr is for ui property in Model\UserAction only, not Field. |
- automatically set when action->confirmation is callable
fix - Intro Exception in Business model step; fix - Make delete action enable property with predictable callback in order to prevent exception.
|
@ibelar can we merge it? |
|
@mvorisek - This is ready. Waiting for @romaninsh or @DarkSide666 to approve the changes. |
DarkSide666
left a comment
There was a problem hiding this comment.
I can't go in details of this now and not so good in frontend things.
I will approve just in case you need that, but does this mean we can't define UI executor in atk4/data action ui property anymore?
You can define executor factory in App, see https://github.com/atk4/ui/pull/1550/files#diff-ad46c7350003ccf7f086dccbecc6fcb7706a1558b14eb5e437a856b8c619e71fR227, thus I would say you can, as long as you will provided factory that does that :) |
Remove all dependency to
atk4\Data\UserAction::uipropertyFixes #1548
Use of an ExecutorFactory class to properly wired UI element from its model action.
Factory method to create action executor based on action definition;
Enable registration of specific Ui executor for certain model UserAction
$app->getExecutorFactory()->registerExecutor($country->getUserAction('confirm'), [ConfirmationExecutor::class]);Allow overriding UI element responsible to trigger the action for a specific component like Crud or Grid
Allow overriding action caption per action or per model/action
$app->getExecutorFactory()->registerCaption($model->getUserAction('add'), 'Add new record');Add new method for Grid to setup button using column action.
Change look and buttons default label by overriding ExcutorFactory
ExecutorFactory can be applied to a specific View object instance:
BC Break
Setting Executor via the $action-ui property might break your code since because the executor uses for the action will be revert to the default provide by executor factory. If you need to use a specific executor class for your action, you will need to register one:
$app->getExecutorFactory()->registerExecutor($file->getUserAction('edit'), [$myExecutorClass]);If you were relying heavily on Model\UserAction::$ui property to set up your action button then this PR may break the look of these buttons.
You will need to register your user action ui property into an action trigger in ExecutorFactory to restore them.
Previous action definition using ui property:
From this pr - you will need to remove ui property in your action definition and register the button in ExecutorFactory:
New action definition
Important
Please note that your code should not break if you where using ui property for buttons - only the look of the button since they will be revert to ExecutorFactory default.