Skip to content

Commit

Permalink
Change pattern of action confirmation modal id
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreyu committed Jan 12, 2025
1 parent 275577d commit 03dd4b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Action/Type/ActionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public function buildView(ActionView $view, ActionInterface $action, array $opti

if ($action->getConfig()->isConfirmable()) {
$options['confirmation']['identifier'] = vsprintf(
format: '%s-%s-action-confirmation-%s',
// [data table name]--[context]-action--[action name]--confirmation
format: '%s--%s-action--%s',
values: [
$dataTable->vars['name'],
$action->getConfig()->getContext()->value,
Expand All @@ -60,7 +61,8 @@ public function buildView(ActionView $view, ActionInterface $action, array $opti
);

if ($view->parent instanceof ColumnValueView) {
$options['confirmation']['identifier'] .= '-'.$view->parent->parent->index;
// [data table name]--[context]-action--[action name]--confirmation--[row index]
$options['confirmation']['identifier'] .= '--'.$view->parent->parent->index;
}
}

Expand Down

0 comments on commit 03dd4b2

Please sign in to comment.