Skip to content

Commit

Permalink
add button actions #2041 for magento 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed Dec 10, 2024
1 parent 3491591 commit 23ff13f
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 56 deletions.
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Ecommerce/CreateWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,12 @@ public function execute()
$message = $return['message'];
}
$resultJson = $this->resultJsonFactory->create();
$resultJson->setData([
$ret = [
'valid' => (int)$valid,
'message' => $message,
]);
$this->helper->buttonPressed("CreateWebhook", [
'valid' => (int)$valid,
'message' => $message,
]);
return $resultJson;
];
$this->helper->buttonPressed("CreateWebhook", $ret);
return $resultJson->setData($ret);
}
protected function _isAllowed()
{
Expand Down
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Ecommerce/DeleteStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,12 @@ public function execute()
$valid = 0;
$message = $e->getMessage();
}
$resultJson->setData([
$ret = [
'valid' => (int)$valid,
'message' => $message,
]);
$this->helper->buttonPressed("DeleteStore", [
'valid' => (int)$valid,
'message' => $message,
]);
return $resultJson;
];
$this->helper->buttonPressed("DeleteStore",$ret);
return $resultJson->setData($ret);
}
protected function _isAllowed()
{
Expand Down
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Ecommerce/FixMailchimpJS.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,12 @@ public function execute()
$valid = 0;
$message = $e->getMessage();
}
$resultJson->setData([
$ret = [
'valid' => (int)$valid,
'message' => $message,
]);
$this->helper->buttonPressed("FixMailchimpJS", [
'valid' => (int)$valid,
'message' => $message,
]);
return $resultJson;
];
$this->helper->buttonPressed("FixMailchimpJS", $ret);
return $resultJson->setData($ret);
}
protected function _isAllowed()
{
Expand Down
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Ecommerce/ResetLocalErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,12 @@ public function execute()
$valid = 0;
$message = $e->getMessage();
}
$resultJson->setData([
$ret = [
'valid' => (int)$valid,
'message' => $message,
]);
$this->helper->buttonPressed("ResetLocalErrors",[
'valid' => (int)$valid,
'message' => $message,
]);
return $resultJson;
];
$this->helper->buttonPressed("ResetLocalErrors",$ret);
return $resultJson->setData($ret);
}
protected function _isAllowed()
{
Expand Down
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Ecommerce/ResetLocalErrorsNoRetry.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,12 @@ public function execute()
$valid = 0;
$message = $e->getMessage();
}
$resultJson->setData([
$ret = [
'valid' => (int)$valid,
'message' => $message,
]);
$this->helper->buttonPressed("ResetLocalErrorNoRetry",[
'valid' => (int)$valid,
'message' => $message,
]);
return $resultJson;
];
$this->helper->buttonPressed("ResetLocalErrorNoRetry",$ret);
return $resultJson->setData($ret);
}
protected function _isAllowed()
{
Expand Down
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Ecommerce/ResetStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,12 @@ public function execute()
$valid = 0;
$message = $e->getMessage();
}
$resultJson->setData([
$ret = [
'valid' => (int)$valid,
'message' => $message,
]);
$this->helper->buttonPressed("ResetStore", [
'valid' => (int)$valid,
'message' => $message,
]);
return $resultJson;
];
$this->helper->buttonPressed("ResetStore",$ret);
return $resultJson->setData($ret);
}
protected function _isAllowed()
{
Expand Down
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Ecommerce/ResyncProducts.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,12 @@ public function execute()
$valid = 0;
$message = $e->getMessage();
}
$resultJson->setData([
$ret = [
'valid' => (int)$valid,
'message' => $message,
]);
$this->helper->buttonPressed("ResyncProducts", [
'valid' => (int)$valid,
'message' => $message,
]);
return $resultJson;
];
$this->helper->buttonPressed("ResyncProducts", $ret);
return $resultJson->setData($ret);
}
protected function _isAllowed()
{
Expand Down
11 changes: 4 additions & 7 deletions Controller/Adminhtml/Ecommerce/ResyncSubscribers.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,12 @@ public function execute()
$valid = 0;
$message = $e->getMessage();
}
$resultJson->setData([
$ret = [
'valid' => (int)$valid,
'message' => $message,
]);
$this->helper->buttonPressed("ResyncSubscribers", [
'valid' => (int)$valid,
'message' => $message,
]);
return $resultJson;
];
$this->helper->buttonPressed("ResyncSubscribers", $ret);
return $resultJson->setData($ret);
}
protected function _isAllowed()
{
Expand Down

0 comments on commit 23ff13f

Please sign in to comment.