Skip to content

Commit

Permalink
Fixing the Pending Reviews label and adding menu for pending reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard13 committed Mar 20, 2019
1 parent 4dd101e commit dd3a94a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/code/Magento/Review/Block/Adminhtml/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ protected function _construct()
}

if ($this->getRequest()->getParam('ret', false) == 'pending') {
$this->buttonList->update('back', 'onclick', 'setLocation(\'' . $this->getUrl('catalog/*/pending') . '\')');
$this->buttonList->update('back', 'onclick', 'setLocation(\'' . $this->getUrl('review/*/pending') . '\')');
$this->buttonList->update(
'delete',
'onclick',
'deleteConfirm(' . '\'' . __(
'Are you sure you want to do this?'
) . '\' ' . '\'' . $this->getUrl(
) . '\', ' . '\'' . $this->getUrl(
'*/*/delete',
[$this->_objectId => $this->getRequest()->getParam($this->_objectId), 'ret' => 'pending']
) . '\'' . ')'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Exception\LocalizedException;

/**
* Save Review action.
*/
class Save extends ProductController
{
/**
* Save Review action.
*
* @return \Magento\Backend\Model\View\Result\Redirect
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
Expand Down Expand Up @@ -63,7 +68,7 @@ public function execute()
if ($nextId) {
$resultRedirect->setPath('review/*/edit', ['id' => $nextId]);
} elseif ($this->getRequest()->getParam('ret') == 'pending') {
$resultRedirect->setPath('*/*/pending');
$resultRedirect->setPath('review/*/pending');
} else {
$resultRedirect->setPath('*/*/');
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Review/etc/acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<resource id="Magento_Backend::marketing">
<resource id="Magento_Backend::marketing_user_content">
<resource id="Magento_Review::reviews_all" title="Reviews" translate="title" sortOrder="10"/>
<resource id="Magento_Review::pending" title="Reviews" translate="title" sortOrder="20"/>
<resource id="Magento_Review::pending" title="Pending Reviews" translate="title" sortOrder="20"/>
</resource>
</resource>
</resource>
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Review/etc/adminhtml/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<menu>
<add id="Magento_Review::catalog_reviews_ratings_ratings" title="Rating" translate="title" module="Magento_Review" sortOrder="60" parent="Magento_Backend::stores_attributes" action="review/rating/" resource="Magento_Review::ratings"/>
<add id="Magento_Review::catalog_reviews_ratings_reviews_all" title="Reviews" translate="title" module="Magento_Review" parent="Magento_Backend::marketing_user_content" sortOrder="10" action="review/product/index" resource="Magento_Review::reviews_all"/>
<add id="Magento_Review::catalog_reviews_ratings_pending" title="Pending Reviews" translate="title" module="Magento_Review" parent="Magento_Backend::marketing_user_content" sortOrder="15" action="review/product/pending" resource="Magento_Review::pending"/>
<add id="Magento_Review::report_review" title="Reviews" translate="title" module="Magento_Reports" sortOrder="20" parent="Magento_Reports::report" resource="Magento_Reports::review"/>
<add id="Magento_Review::report_review_customer" title="By Customers" translate="title" sortOrder="10" module="Magento_Review" parent="Magento_Review::report_review" action="reports/report_review/customer" resource="Magento_Reports::review_customer"/>
<add id="Magento_Review::report_review_product" title="By Products" translate="title" sortOrder="20" module="Magento_Review" parent="Magento_Review::report_review" action="reports/report_review/product" resource="Magento_Reports::review_product"/>
Expand Down

0 comments on commit dd3a94a

Please sign in to comment.