fix: prevent modal from showing unexpectedly and fix inline actions
Remove duplicate inline actions from Forms page title column to prevent conflicts with DataTable's built-in actions column. Fix DataTable actions column: - Only show delete/duplicate on hover using CSS - Add proper event propagation handling (stopPropagation) - Remove unnecessary wrapper div that was causing issues Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'wp-components', 'wp-element', 'wp-i18n', 'wp-icons/build/arrow-left', 'wp-icons/build/bell', 'wp-icons/build/eye-closed', 'wp-icons/build/eye-opened', 'wp-icons/build/list', 'wp-icons/build/message', 'wp-icons/build/minus', 'wp-icons/build/trash', 'wp-icons/build/visible'), 'version' => '42bdafafef51db2063cf');
|
||||
<?php return array('dependencies' => array('react', 'wp-components', 'wp-element', 'wp-i18n', 'wp-icons/build/arrow-left', 'wp-icons/build/bell', 'wp-icons/build/eye-closed', 'wp-icons/build/eye-opened', 'wp-icons/build/list', 'wp-icons/build/message', 'wp-icons/build/minus', 'wp-icons/build/trash', 'wp-icons/build/visible'), 'version' => 'ffa92e2b75f22808382a');
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -185,34 +185,34 @@ class Customer {
|
||||
// Assets now handled by ReactAdmin class
|
||||
return;
|
||||
|
||||
$customer_id = intval(filter_input(INPUT_GET, 'customer_id', FILTER_SANITIZE_STRING));
|
||||
if(empty($customer_id)){
|
||||
wp_enqueue_style( 'page-customers', FORMIPAY_URL . 'admin/assets/css/admin-customers.css', [], FORMIPAY_VERSION, 'all' );
|
||||
wp_enqueue_script( 'page-customers', FORMIPAY_URL . 'admin/assets/js/admin-customers.js', ['jquery', 'gridjs'], FORMIPAY_VERSION, true );
|
||||
}else{
|
||||
wp_enqueue_style( 'bootstrap-icon', FORMIPAY_URL . 'vendor/Bootstrap/bootstrap-icons.css', [], '1.11.1', 'all');
|
||||
wp_enqueue_style( 'bootstrap', FORMIPAY_URL . 'vendor/Bootstrap/bootstrap.min.css', [], '5.3.2' );
|
||||
wp_enqueue_style( 'page-customers', FORMIPAY_URL . 'admin/assets/css/admin-customer-details.css', [], FORMIPAY_VERSION, 'all' );
|
||||
wp_enqueue_script( 'handlebars', FORMIPAY_URL . 'vendor/HandleBars/handlebars.min.js', [], '4.7.7', true);
|
||||
wp_enqueue_script( 'bootstrap', FORMIPAY_URL . 'vendor/Bootstrap/bootstrap.bundle.min.js', ['jquery'], '5.3.2', true );
|
||||
wp_enqueue_script( 'page-customers', FORMIPAY_URL . 'admin/assets/js/admin-customer-details.js', ['jquery'], FORMIPAY_VERSION, true );
|
||||
}
|
||||
// $customer_id = intval(filter_input(INPUT_GET, 'customer_id', FILTER_SANITIZE_STRING));
|
||||
// if(empty($customer_id)){
|
||||
// wp_enqueue_style( 'page-customers', FORMIPAY_URL . 'admin/assets/css/admin-customers.css', [], FORMIPAY_VERSION, 'all' );
|
||||
// wp_enqueue_script( 'page-customers', FORMIPAY_URL . 'admin/assets/js/admin-customers.js', ['jquery', 'gridjs'], FORMIPAY_VERSION, true );
|
||||
// }else{
|
||||
// wp_enqueue_style( 'bootstrap-icon', FORMIPAY_URL . 'vendor/Bootstrap/bootstrap-icons.css', [], '1.11.1', 'all');
|
||||
// wp_enqueue_style( 'bootstrap', FORMIPAY_URL . 'vendor/Bootstrap/bootstrap.min.css', [], '5.3.2' );
|
||||
// wp_enqueue_style( 'page-customers', FORMIPAY_URL . 'admin/assets/css/admin-customer-details.css', [], FORMIPAY_VERSION, 'all' );
|
||||
// wp_enqueue_script( 'handlebars', FORMIPAY_URL . 'vendor/HandleBars/handlebars.min.js', [], '4.7.7', true);
|
||||
// wp_enqueue_script( 'bootstrap', FORMIPAY_URL . 'vendor/Bootstrap/bootstrap.bundle.min.js', ['jquery'], '5.3.2', true );
|
||||
// wp_enqueue_script( 'page-customers', FORMIPAY_URL . 'admin/assets/js/admin-customer-details.js', ['jquery'], FORMIPAY_VERSION, true );
|
||||
// }
|
||||
|
||||
wp_localize_script( 'page-customers', 'formipay_customers_page', [
|
||||
'ajax_url' => admin_url('admin-ajax.php'),
|
||||
'site_url' => site_url(),
|
||||
'customer_id' => $customer_id,
|
||||
'nonce' => wp_create_nonce( 'formipay-admin-access-nonce' ),
|
||||
'columns' => [
|
||||
'id' => esc_html__( 'ID', 'formipay' ),
|
||||
'name' => esc_html__( 'Name', 'formipay' ),
|
||||
'email' => esc_html__( 'Email', 'formipay' ),
|
||||
'phone' => esc_html__( 'Phone', 'formipay' ),
|
||||
'total_order' => esc_html__( 'Total Order', 'formipay' ),
|
||||
]
|
||||
] );
|
||||
// wp_localize_script( 'page-customers', 'formipay_customers_page', [
|
||||
// 'ajax_url' => admin_url('admin-ajax.php'),
|
||||
// 'site_url' => site_url(),
|
||||
// 'customer_id' => $customer_id,
|
||||
// 'nonce' => wp_create_nonce( 'formipay-admin-access-nonce' ),
|
||||
// 'columns' => [
|
||||
// 'id' => esc_html__( 'ID', 'formipay' ),
|
||||
// 'name' => esc_html__( 'Name', 'formipay' ),
|
||||
// 'email' => esc_html__( 'Email', 'formipay' ),
|
||||
// 'phone' => esc_html__( 'Phone', 'formipay' ),
|
||||
// 'total_order' => esc_html__( 'Total Order', 'formipay' ),
|
||||
// ]
|
||||
// ] );
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -78,46 +78,46 @@ class License {
|
||||
public function enqueue() {
|
||||
// Assets now handled by ReactAdmin class
|
||||
return;
|
||||
wp_enqueue_style('page-licenses', FORMIPAY_URL . 'admin/assets/css/admin-licenses.css', [], FORMIPAY_VERSION, 'all');
|
||||
wp_enqueue_script('page-licenses', FORMIPAY_URL . 'admin/assets/js/admin-licenses.js', ['jquery', 'gridjs'], FORMIPAY_VERSION, true);
|
||||
wp_localize_script('page-licenses', 'formipay_licenses_page', [
|
||||
'ajax_url' => admin_url('admin-ajax.php'),
|
||||
'site_url' => site_url(),
|
||||
'columns' => [
|
||||
'id' => __('ID','formipay'),
|
||||
'product' => __('Product','formipay'),
|
||||
'order' => __('Order','formipay'),
|
||||
'email' => __('Email','formipay'),
|
||||
'key' => __('Key','formipay'),
|
||||
'status' => __('Status','formipay'),
|
||||
'expiry' => __('Expiry','formipay'),
|
||||
'date' => __('Date','formipay'),
|
||||
],
|
||||
'filter_form' => [
|
||||
'products' => [
|
||||
'placeholder' => __('Filter by Product','formipay'),
|
||||
'noresult_text' => __('No results found','formipay')
|
||||
],
|
||||
'status' => [
|
||||
'placeholder' => __('Filter by Status','formipay'),
|
||||
'noresult_text' => __('No results found','formipay')
|
||||
]
|
||||
],
|
||||
'modal' => [
|
||||
'delete' => [
|
||||
'question' => __('Do you want to delete the license?','formipay'),
|
||||
'cancelButton' => __('Cancel','formipay'),
|
||||
'confirmButton' => __('Delete Permanently','formipay')
|
||||
],
|
||||
'bulk_delete' => [
|
||||
'question' => __('Do you want to delete the selected license(s)?','formipay'),
|
||||
'cancelButton' => __('Cancel','formipay'),
|
||||
'confirmButton' => __('Confirm','formipay')
|
||||
],
|
||||
],
|
||||
'nonce' => wp_create_nonce('formipay-admin-licenses')
|
||||
]);
|
||||
}
|
||||
// wp_enqueue_style('page-licenses', FORMIPAY_URL . 'admin/assets/css/admin-licenses.css', [], FORMIPAY_VERSION, 'all');
|
||||
// wp_enqueue_script('page-licenses', FORMIPAY_URL . 'admin/assets/js/admin-licenses.js', ['jquery', 'gridjs'], FORMIPAY_VERSION, true);
|
||||
// wp_localize_script('page-licenses', 'formipay_licenses_page', [
|
||||
// 'ajax_url' => admin_url('admin-ajax.php'),
|
||||
// 'site_url' => site_url(),
|
||||
// 'columns' => [
|
||||
// 'id' => __('ID','formipay'),
|
||||
// 'product' => __('Product','formipay'),
|
||||
// 'order' => __('Order','formipay'),
|
||||
// 'email' => __('Email','formipay'),
|
||||
// 'key' => __('Key','formipay'),
|
||||
// 'status' => __('Status','formipay'),
|
||||
// 'expiry' => __('Expiry','formipay'),
|
||||
// 'date' => __('Date','formipay'),
|
||||
// ],
|
||||
// 'filter_form' => [
|
||||
// 'products' => [
|
||||
// 'placeholder' => __('Filter by Product','formipay'),
|
||||
// 'noresult_text' => __('No results found','formipay')
|
||||
// ],
|
||||
// 'status' => [
|
||||
// 'placeholder' => __('Filter by Status','formipay'),
|
||||
// 'noresult_text' => __('No results found','formipay')
|
||||
// ]
|
||||
// ],
|
||||
// 'modal' => [
|
||||
// 'delete' => [
|
||||
// 'question' => __('Do you want to delete the license?','formipay'),
|
||||
// 'cancelButton' => __('Cancel','formipay'),
|
||||
// 'confirmButton' => __('Delete Permanently','formipay')
|
||||
// ],
|
||||
// 'bulk_delete' => [
|
||||
// 'question' => __('Do you want to delete the selected license(s)?','formipay'),
|
||||
// 'cancelButton' => __('Cancel','formipay'),
|
||||
// 'confirmButton' => __('Confirm','formipay')
|
||||
// ],
|
||||
// ],
|
||||
// 'nonce' => wp_create_nonce('formipay-admin-licenses')
|
||||
// ]);
|
||||
// }
|
||||
}
|
||||
|
||||
/** GridJS data source */
|
||||
|
||||
@@ -655,6 +655,7 @@ class Order {
|
||||
public function enqueue() {
|
||||
// Assets now handled by ReactAdmin class
|
||||
return;
|
||||
}
|
||||
|
||||
public function formipay_get_all_forms() {
|
||||
|
||||
|
||||
BIN
node_modules/.cache/babel-loader/1a741df843f1088b111b34098367931913ebadf428560780b121588c6c0cdf65.json.gz
generated
vendored
Normal file
BIN
node_modules/.cache/babel-loader/1a741df843f1088b111b34098367931913ebadf428560780b121588c6c0cdf65.json.gz
generated
vendored
Normal file
Binary file not shown.
BIN
node_modules/.cache/babel-loader/215ccb96814ec5dad6acde72ebf5628ba13cafe629ac4cbda7f836d7b5a83c4f.json.gz
generated
vendored
Normal file
BIN
node_modules/.cache/babel-loader/215ccb96814ec5dad6acde72ebf5628ba13cafe629ac4cbda7f836d7b5a83c4f.json.gz
generated
vendored
Normal file
Binary file not shown.
BIN
node_modules/.cache/babel-loader/8ad61b9bd1cdfe0ddc52c8e65cbe1ef62f81ff6400630b08f6d2900f354bcb5e.json.gz
generated
vendored
Normal file
BIN
node_modules/.cache/babel-loader/8ad61b9bd1cdfe0ddc52c8e65cbe1ef62f81ff6400630b08f6d2900f354bcb5e.json.gz
generated
vendored
Normal file
Binary file not shown.
BIN
node_modules/.cache/babel-loader/b9ad9415434e146b824f735780f297bc80716ef8e1e601716cb0e4c36412d093.json.gz
generated
vendored
Normal file
BIN
node_modules/.cache/babel-loader/b9ad9415434e146b824f735780f297bc80716ef8e1e601716cb0e4c36412d093.json.gz
generated
vendored
Normal file
Binary file not shown.
@@ -438,25 +438,36 @@ export default function DataTable({
|
||||
{/* Actions */}
|
||||
{actions.inline && (
|
||||
<td className="column-actions">
|
||||
<div className="row-actions">
|
||||
<a href={`${window.formipayAdmin?.siteUrl || ''}/wp-admin/post.php?post=${rowId}&action=edit`}>
|
||||
{__('Edit', 'formipay')}
|
||||
</a>
|
||||
{' | '}
|
||||
<span
|
||||
className="row-actions"
|
||||
style={{ visibility: 'hidden' }}
|
||||
>
|
||||
<button
|
||||
className="button-link delete"
|
||||
onClick={() => handleDelete(rowId)}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
handleDelete(rowId);
|
||||
}}
|
||||
>
|
||||
{__('Delete', 'formipay')}
|
||||
</button>
|
||||
{' | '}
|
||||
<button
|
||||
className="button-link duplicate"
|
||||
onClick={() => handleDuplicate(rowId)}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
handleDuplicate(rowId);
|
||||
}}
|
||||
>
|
||||
{__('Duplicate', 'formipay')}
|
||||
</button>
|
||||
</div>
|
||||
</span>
|
||||
</td>
|
||||
)}
|
||||
</tr>
|
||||
|
||||
@@ -20,23 +20,9 @@ export default function FormsPage() {
|
||||
key: 'title',
|
||||
label: __('Title', 'formipay'),
|
||||
render: (row) => (
|
||||
<>
|
||||
<strong>{row.title}</strong>
|
||||
<br />
|
||||
<span className="row-actions" style={{ display: 'none', visibility: 'hidden' }}>
|
||||
<a href={`${window.formipayAdmin?.siteUrl || ''}/wp-admin/post.php?post=${row.ID}&action=edit`}>
|
||||
{__('Edit', 'formipay')}
|
||||
<strong>{row.title}</strong>
|
||||
</a>
|
||||
{' | '}
|
||||
<button className="button-link delete" data-id={row.ID}>
|
||||
{__('Delete', 'formipay')}
|
||||
</button>
|
||||
{' | '}
|
||||
<button className="button-link duplicate" data-id={row.ID}>
|
||||
{__('Duplicate', 'formipay')}
|
||||
</button>
|
||||
</span>
|
||||
</>
|
||||
)
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user