ui icon indicating copy to clipboard operation
ui copied to clipboard

UserAction StepExecutor improvement

Open ibelar opened this issue 3 years ago • 4 comments

Fix #1680 Fix #1681

  • Refactor in order to improve Class extension;
  • Allow settings Data\UserAction argument from a Data\Model
    • arguments can be validate using Model validation.

ibelar avatar Nov 04 '21 19:11 ibelar

Question: Will you be ok to add a property to Model\UserAction say $argModel instead of using a special key name '__atk_model' in args array?

Then executor can check for both UserAction property ($arg and $argModel) accordingly.

ibelar avatar Nov 05 '21 15:11 ibelar

Question: Will you be ok to add a property to Model\UserAction say $argModel instead of using a special key name '__atk_model' in args array?

Then executor can check for both UserAction property ($arg and $argModel) accordingly.

~If Model\UserAction::$args can be replaced with a Model, I would prefer that as otherwise args are passed like ...$args which has no typing check neither correct arg names/order/count.~

I think lets use/stay with __atk_model for now as the args are not refactorable currently anyway. Maybe add it as a const to Model\UserAction class prefixed with the cl. name as other constants.

mvorisek avatar Nov 05 '21 15:11 mvorisek

I am currently checking passing the entire $argModel to callback function as well instead of passing $args separately. This will allow full usage of Model capability for action argument i.e usage of hook within the model.

ibelar avatar Nov 05 '21 15:11 ibelar

@ibelar how does this PR fix https://github.com/atk4/ui/issues/1680 and what do actaully mean by

Current implementation does not allow for easily overriding each step method

as described in the issue desc?

mvorisek avatar May 22 '22 10:05 mvorisek