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
|
// Assets now handled by ReactAdmin class
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$customer_id = intval(filter_input(INPUT_GET, 'customer_id', FILTER_SANITIZE_STRING));
|
// $customer_id = intval(filter_input(INPUT_GET, 'customer_id', FILTER_SANITIZE_STRING));
|
||||||
if(empty($customer_id)){
|
// if(empty($customer_id)){
|
||||||
wp_enqueue_style( 'page-customers', FORMIPAY_URL . 'admin/assets/css/admin-customers.css', [], FORMIPAY_VERSION, 'all' );
|
// 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 );
|
// wp_enqueue_script( 'page-customers', FORMIPAY_URL . 'admin/assets/js/admin-customers.js', ['jquery', 'gridjs'], FORMIPAY_VERSION, true );
|
||||||
}else{
|
// }else{
|
||||||
wp_enqueue_style( 'bootstrap-icon', FORMIPAY_URL . 'vendor/Bootstrap/bootstrap-icons.css', [], '1.11.1', 'all');
|
// 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( '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_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( '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( '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_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', [
|
// wp_localize_script( 'page-customers', 'formipay_customers_page', [
|
||||||
'ajax_url' => admin_url('admin-ajax.php'),
|
// 'ajax_url' => admin_url('admin-ajax.php'),
|
||||||
'site_url' => site_url(),
|
// 'site_url' => site_url(),
|
||||||
'customer_id' => $customer_id,
|
// 'customer_id' => $customer_id,
|
||||||
'nonce' => wp_create_nonce( 'formipay-admin-access-nonce' ),
|
// 'nonce' => wp_create_nonce( 'formipay-admin-access-nonce' ),
|
||||||
'columns' => [
|
// 'columns' => [
|
||||||
'id' => esc_html__( 'ID', 'formipay' ),
|
// 'id' => esc_html__( 'ID', 'formipay' ),
|
||||||
'name' => esc_html__( 'Name', 'formipay' ),
|
// 'name' => esc_html__( 'Name', 'formipay' ),
|
||||||
'email' => esc_html__( 'Email', 'formipay' ),
|
// 'email' => esc_html__( 'Email', 'formipay' ),
|
||||||
'phone' => esc_html__( 'Phone', 'formipay' ),
|
// 'phone' => esc_html__( 'Phone', 'formipay' ),
|
||||||
'total_order' => esc_html__( 'Total Order', 'formipay' ),
|
// 'total_order' => esc_html__( 'Total Order', 'formipay' ),
|
||||||
]
|
// ]
|
||||||
] );
|
// ] );
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,46 +78,46 @@ class License {
|
|||||||
public function enqueue() {
|
public function enqueue() {
|
||||||
// Assets now handled by ReactAdmin class
|
// Assets now handled by ReactAdmin class
|
||||||
return;
|
return;
|
||||||
wp_enqueue_style('page-licenses', FORMIPAY_URL . 'admin/assets/css/admin-licenses.css', [], FORMIPAY_VERSION, 'all');
|
// 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_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', [
|
// wp_localize_script('page-licenses', 'formipay_licenses_page', [
|
||||||
'ajax_url' => admin_url('admin-ajax.php'),
|
// 'ajax_url' => admin_url('admin-ajax.php'),
|
||||||
'site_url' => site_url(),
|
// 'site_url' => site_url(),
|
||||||
'columns' => [
|
// 'columns' => [
|
||||||
'id' => __('ID','formipay'),
|
// 'id' => __('ID','formipay'),
|
||||||
'product' => __('Product','formipay'),
|
// 'product' => __('Product','formipay'),
|
||||||
'order' => __('Order','formipay'),
|
// 'order' => __('Order','formipay'),
|
||||||
'email' => __('Email','formipay'),
|
// 'email' => __('Email','formipay'),
|
||||||
'key' => __('Key','formipay'),
|
// 'key' => __('Key','formipay'),
|
||||||
'status' => __('Status','formipay'),
|
// 'status' => __('Status','formipay'),
|
||||||
'expiry' => __('Expiry','formipay'),
|
// 'expiry' => __('Expiry','formipay'),
|
||||||
'date' => __('Date','formipay'),
|
// 'date' => __('Date','formipay'),
|
||||||
],
|
// ],
|
||||||
'filter_form' => [
|
// 'filter_form' => [
|
||||||
'products' => [
|
// 'products' => [
|
||||||
'placeholder' => __('Filter by Product','formipay'),
|
// 'placeholder' => __('Filter by Product','formipay'),
|
||||||
'noresult_text' => __('No results found','formipay')
|
// 'noresult_text' => __('No results found','formipay')
|
||||||
],
|
// ],
|
||||||
'status' => [
|
// 'status' => [
|
||||||
'placeholder' => __('Filter by Status','formipay'),
|
// 'placeholder' => __('Filter by Status','formipay'),
|
||||||
'noresult_text' => __('No results found','formipay')
|
// 'noresult_text' => __('No results found','formipay')
|
||||||
]
|
// ]
|
||||||
],
|
// ],
|
||||||
'modal' => [
|
// 'modal' => [
|
||||||
'delete' => [
|
// 'delete' => [
|
||||||
'question' => __('Do you want to delete the license?','formipay'),
|
// 'question' => __('Do you want to delete the license?','formipay'),
|
||||||
'cancelButton' => __('Cancel','formipay'),
|
// 'cancelButton' => __('Cancel','formipay'),
|
||||||
'confirmButton' => __('Delete Permanently','formipay')
|
// 'confirmButton' => __('Delete Permanently','formipay')
|
||||||
],
|
// ],
|
||||||
'bulk_delete' => [
|
// 'bulk_delete' => [
|
||||||
'question' => __('Do you want to delete the selected license(s)?','formipay'),
|
// 'question' => __('Do you want to delete the selected license(s)?','formipay'),
|
||||||
'cancelButton' => __('Cancel','formipay'),
|
// 'cancelButton' => __('Cancel','formipay'),
|
||||||
'confirmButton' => __('Confirm','formipay')
|
// 'confirmButton' => __('Confirm','formipay')
|
||||||
],
|
// ],
|
||||||
],
|
// ],
|
||||||
'nonce' => wp_create_nonce('formipay-admin-licenses')
|
// 'nonce' => wp_create_nonce('formipay-admin-licenses')
|
||||||
]);
|
// ]);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** GridJS data source */
|
/** GridJS data source */
|
||||||
|
|||||||
@@ -655,6 +655,7 @@ class Order {
|
|||||||
public function enqueue() {
|
public function enqueue() {
|
||||||
// Assets now handled by ReactAdmin class
|
// Assets now handled by ReactAdmin class
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public function formipay_get_all_forms() {
|
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 */}
|
||||||
{actions.inline && (
|
{actions.inline && (
|
||||||
<td className="column-actions">
|
<td className="column-actions">
|
||||||
<div className="row-actions">
|
<a href={`${window.formipayAdmin?.siteUrl || ''}/wp-admin/post.php?post=${rowId}&action=edit`}>
|
||||||
<a href={`${window.formipayAdmin?.siteUrl || ''}/wp-admin/post.php?post=${rowId}&action=edit`}>
|
{__('Edit', 'formipay')}
|
||||||
{__('Edit', 'formipay')}
|
</a>
|
||||||
</a>
|
{' | '}
|
||||||
{' | '}
|
<span
|
||||||
|
className="row-actions"
|
||||||
|
style={{ visibility: 'hidden' }}
|
||||||
|
>
|
||||||
<button
|
<button
|
||||||
className="button-link delete"
|
className="button-link delete"
|
||||||
onClick={() => handleDelete(rowId)}
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
handleDelete(rowId);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{__('Delete', 'formipay')}
|
{__('Delete', 'formipay')}
|
||||||
</button>
|
</button>
|
||||||
{' | '}
|
{' | '}
|
||||||
<button
|
<button
|
||||||
className="button-link duplicate"
|
className="button-link duplicate"
|
||||||
onClick={() => handleDuplicate(rowId)}
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
handleDuplicate(rowId);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{__('Duplicate', 'formipay')}
|
{__('Duplicate', 'formipay')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -20,23 +20,9 @@ export default function FormsPage() {
|
|||||||
key: 'title',
|
key: 'title',
|
||||||
label: __('Title', 'formipay'),
|
label: __('Title', 'formipay'),
|
||||||
render: (row) => (
|
render: (row) => (
|
||||||
<>
|
<a href={`${window.formipayAdmin?.siteUrl || ''}/wp-admin/post.php?post=${row.ID}&action=edit`}>
|
||||||
<strong>{row.title}</strong>
|
<strong>{row.title}</strong>
|
||||||
<br />
|
</a>
|
||||||
<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')}
|
|
||||||
</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