Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
haitv282 committed Jan 31, 2019
2 parents 6c9f2bf + c223bcc commit 3d34b10
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 83 deletions.
13 changes: 13 additions & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configuration for probot-no-response - https://github.com/probot/no-response

# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 7
# Label requiring a response
responseRequiredLabel: waiting-customer-response
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further.
1 change: 1 addition & 0 deletions Block/Adminhtml/SeoChecker/CheckButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CheckButton implements ButtonProviderInterface

/**
* CheckButton constructor.
*
* @param Data $helper
*/
public function __construct(Data $helper)
Expand Down
41 changes: 21 additions & 20 deletions Block/Adminhtml/SeoChecker/CheckForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class CheckForm extends Template

/**
* CheckForm constructor.
*
* @param Template\Context $context
* @param Url $url
* @param UrlBuilder $cmsUrl
Expand All @@ -111,16 +112,15 @@ public function __construct(
CategoryRepositoryInterface $categoryRepository,
SeoHelperData $helper,
array $data = []
)
{
$this->helper = $helper;
$this->productFactory = $productFactory;
) {
$this->helper = $helper;
$this->productFactory = $productFactory;
$this->categoryRepository = $categoryRepository;
$this->cmsUrl = $cmsUrl;
$this->cmsPageFactory = $cmsPageFactory;
$this->sitemapCollection = $sitemapCollection;
$this->jsonHelper = $jsonHelper;
$this->productRepository = $productRepository;
$this->cmsUrl = $cmsUrl;
$this->cmsPageFactory = $cmsPageFactory;
$this->sitemapCollection = $sitemapCollection;
$this->jsonHelper = $jsonHelper;
$this->productRepository = $productRepository;

parent::__construct($context, $data);
}
Expand All @@ -133,28 +133,28 @@ public function __construct(
*/
public function getLink()
{
$id = $this->_request->getParam('id');
$storeCode = $this->_storeManager->getStore()->getCode();
$storeId = $this->_storeManager->getStore()->getId();
$id = $this->_request->getParam('id');
$storeCode = $this->_storeManager->getStore()->getCode();
$storeId = $this->_storeManager->getStore()->getId();
$actionName = $this->_request->getFullActionName();
if ($storeId == "0") {
$storeId = $this->_storeManager->getDefaultStoreView()->getId();
$storeId = $this->_storeManager->getDefaultStoreView()->getId();
$storeCode = $this->_storeManager->getDefaultStoreView()->getCode();
}

switch ($actionName) {
case 'catalog_product_edit':
$urlModel = $this->productRepository->getById($id)->getUrlModel();
$product = $this->productFactory->create()->load($id)->setStoreId($storeId);
$url = $urlModel->getUrl($product) . "?___store=" . $storeCode;
$product = $this->productFactory->create()->load($id)->setStoreId($storeId);
$url = $urlModel->getUrl($product) . "?___store=" . $storeCode;
break;
case 'catalog_category_edit':
$category = $this->categoryRepository->get($id, $storeId);
$url = $category->getUrl() . "?___store=" . $storeCode;
$url = $category->getUrl() . "?___store=" . $storeCode;
break;
case 'cms_page_edit':
$pageId = $this->_request->getParam('page_id');
$url = $this->cmsUrl->getUrl($this->cmsPageFactory->create()->load($pageId)->getIdentifier(), $storeId, $storeCode);
$url = $this->cmsUrl->getUrl($this->cmsPageFactory->create()->load($pageId)->getIdentifier(), $storeId, $storeCode);
break;
default:
$url = '';
Expand All @@ -167,6 +167,7 @@ public function getLink()
* get site map links
*
* @return array
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function sitemap()
{
Expand Down Expand Up @@ -195,8 +196,8 @@ public function sitemap()
*/
public function getSeoData()
{
$data = [];
$data['link'] = $this->getLink();
$data = [];
$data['link'] = $this->getLink();
$data['sitemap'] = $this->sitemap();
$data['baseUrl'] = $this->getBaseUrl();

Expand All @@ -212,4 +213,4 @@ public function getSeoToolUrl()
{
return self::SEO_TOOL_URL;
}
}
}
7 changes: 7 additions & 0 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Data extends CoreHelper
/**
* @param $code
* @param null $storeId
*
* @return mixed
*/
public function getMetaConfig($code, $storeId = null)
Expand All @@ -47,6 +48,7 @@ public function getMetaConfig($code, $storeId = null)
/**
* @param $code
* @param null $storeId
*
* @return mixed
*/
public function getVerficationConfig($code, $storeId = null)
Expand All @@ -59,6 +61,7 @@ public function getVerficationConfig($code, $storeId = null)
/**
* @param $code
* @param null $storeId
*
* @return mixed
*/
public function getRichsnippetsConfig($code, $storeId = null)
Expand All @@ -71,6 +74,7 @@ public function getRichsnippetsConfig($code, $storeId = null)
/**
* @param null $code
* @param null $storeId
*
* @return mixed
*/
public function getInfoConfig($code = null, $storeId = null)
Expand All @@ -83,6 +87,7 @@ public function getInfoConfig($code = null, $storeId = null)
/**
* @param null $code
* @param null $storeId
*
* @return mixed
*/
public function getSocialProfiles($code = null, $storeId = null)
Expand All @@ -95,6 +100,7 @@ public function getSocialProfiles($code = null, $storeId = null)
/**
* @param null $code
* @param null $storeId
*
* @return mixed
*/
public function getDuplicateConfig($code = null, $storeId = null)
Expand All @@ -110,6 +116,7 @@ public function getDuplicateConfig($code = null, $storeId = null)
* @param $data
* @param string $prefixComment
* @param string $subfixComment
*
* @return string
*/
public function createStructuredData($data, $prefixComment = '', $subfixComment = '')
Expand Down
4 changes: 3 additions & 1 deletion Plugin/Helper/CanUseCanonicalTagForCategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CanUseCanonicalTagForCategories

/**
* CanUseCanonicalTagForCategories constructor.
*
* @param HelperData $helper
*/
function __construct(HelperData $helper)
Expand All @@ -46,6 +47,7 @@ function __construct(HelperData $helper)
/**
* @param \Magento\Catalog\Helper\Category $category
* @param $result
*
* @return mixed
*/
public function afterCanUseCanonicalTag(\Magento\Catalog\Helper\Category $category, $result)
Expand All @@ -56,4 +58,4 @@ public function afterCanUseCanonicalTag(\Magento\Catalog\Helper\Category $catego

return $result;
}
}
}
4 changes: 3 additions & 1 deletion Plugin/Helper/CanUseCanonicalTagForProducts.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CanUseCanonicalTagForProducts

/**
* CanUseCanonicalTagForProducts constructor.
*
* @param HelperData $helper
*/
function __construct(HelperData $helper)
Expand All @@ -46,6 +47,7 @@ function __construct(HelperData $helper)
/**
* @param \Magento\Catalog\Helper\Product $product
* @param $result
*
* @return mixed
*/
public function afterCanUseCanonicalTag(\Magento\Catalog\Helper\Product $product, $result)
Expand All @@ -56,4 +58,4 @@ public function afterCanUseCanonicalTag(\Magento\Catalog\Helper\Product $product

return $result;
}
}
}
Loading

0 comments on commit 3d34b10

Please sign in to comment.