-
Notifications
You must be signed in to change notification settings - Fork 111
CardDeck/general addUserAction icon support #1849
Description
Today, the UserActions are all automatically rendered based on the UserAction's name, so 'Edit', 'Delete' or the like. The 'name' by nature becomes then also the caption for all buttons. In Cruds, the 'Edit' UserActions are shown by an edit icon, in Cards not.
Generally, it would be helpful if there is an easy and direct way to also set the 'icon' for a UserAction that Ui is taking. Consider this as an alternative to describe the UserAction instead of the name. The name is as good or bad to describe it as caption or an icon would be. To my knowledge, this was easily possible in earlier versions of the UserActions, but was removed and transferred to ExecutionFactory - this makes it very time-consuming and complex, to add a simple UserAction like 'Archive entry' - it should be as easy as:
$this->addUserAction('Archive', [
'confirmation' => 'Are you sure you want to archive email?',
'icon' => 'mailbox',
'caption' => '', // Show only the icon, and not the "Archive" text
'callback' => function ($entity) {
$entity->save(['archived' => true]);
return 'Email successfully archived';
},
]);