fix: [users:view] Correctly reload authkey child panel when performing operations
parent
789bd9926f
commit
dc8710d89e
|
@ -10,7 +10,8 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
'data' => [
|
||||
'type' => 'simple',
|
||||
'text' => __('Add authentication key'),
|
||||
'popover_url' => '/authKeys/add'
|
||||
'popover_url' => '/authKeys/add',
|
||||
'reload_url' => $this->request->getRequestTarget()
|
||||
]
|
||||
]
|
||||
],
|
||||
|
@ -65,7 +66,8 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
[
|
||||
'open_modal' => '/authKeys/delete/[onclick_params_data_path]',
|
||||
'modal_params_data_path' => 'id',
|
||||
'icon' => 'trash'
|
||||
'icon' => 'trash',
|
||||
'reload_url' => $this->request->getRequestTarget()
|
||||
]
|
||||
]
|
||||
]
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?php
|
||||
$seed = 'f_' . mt_rand();
|
||||
if (!isset($data['requirement']) || $data['requirement']) {
|
||||
if (!empty($data['popover_url'])) {
|
||||
$onClick = sprintf(
|
||||
'onClick="openModalForButton(this, \'%s\', \'%s\')"',
|
||||
'onClick="openModalForButton%s(this, \'%s\', \'%s\')"',
|
||||
$seed,
|
||||
h($data['popover_url']),
|
||||
h(!empty($data['reload_url']) ? $data['reload_url'] : '')
|
||||
);
|
||||
|
@ -70,7 +72,7 @@
|
|||
?>
|
||||
|
||||
<script>
|
||||
function openModalForButton(clicked, url, reloadUrl='') {
|
||||
function openModalForButton<?= $seed ?>(clicked, url, reloadUrl='') {
|
||||
const fallbackReloadUrl = '<?= $this->Url->build(['action' => 'index']); ?>'
|
||||
reloadUrl = reloadUrl != '' ? reloadUrl : fallbackReloadUrl
|
||||
UI.overlayUntilResolve(clicked, UI.submissionModalForIndex(url, reloadUrl, '<?= $tableRandomValue ?>'))
|
||||
|
|
Loading…
Reference in New Issue