Skip to content

Commit

Permalink
Merge pull request #82 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
Clean code
  • Loading branch information
haitv282 authored Nov 9, 2020
2 parents ae6cba8 + 6ffaa20 commit b3cb807
Show file tree
Hide file tree
Showing 38 changed files with 448 additions and 449 deletions.
68 changes: 34 additions & 34 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
---
name: Bug report
about: Technical issue with the extension
labels: 'Issue'

---

<!---
Fields marked with (*) are required. Please don't remove the template.
-->

### Preconditions (*)
<!---
Provide the exact Magento version (example: 2.4.0) and any important information on the environment where bug is reproducible.
-->
1.
2.

### Steps to reproduce (*)
<!---
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
-->
1.
2.

### Expected result (*)
<!--- Tell us what do you expect to happen. -->
1. [Screenshots, logs or description]
2.

### Actual result (*)
<!--- Tell us what happened instead. Include error messages and issues. -->
1. [Screenshots, logs or description]
2.
---
name: Bug report
about: Technical issue with the extension
labels: 'Issue'

---

<!---
Fields marked with (*) are required. Please don't remove the template.
-->

### Preconditions (*)
<!---
Provide the exact Magento version (example: 2.4.0) and any important information on the environment where bug is reproducible.
-->
1.
2.

### Steps to reproduce (*)
<!---
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
-->
1.
2.

### Expected result (*)
<!--- Tell us what do you expect to happen. -->
1. [Screenshots, logs or description]
2.

### Actual result (*)
<!--- Tell us what happened instead. Include error messages and issues. -->
1. [Screenshots, logs or description]
2.
38 changes: 19 additions & 19 deletions .github/ISSUE_TEMPLATE/developer-experience-issue.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
name: Developer experience issue
about: Issues related to customization, extensibility, modularity
labels: 'Experience'

---

<!---
Fields marked with (*) are required. Please don't remove the template.
-->

### Summary (*)
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->

### Examples (*)
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->

### Proposed solution
<!--- Suggest your potential solutions for this issue. -->
---
name: Developer experience issue
about: Issues related to customization, extensibility, modularity
labels: 'Experience'

---

<!---
Fields marked with (*) are required. Please don't remove the template.
-->

### Summary (*)
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->

### Examples (*)
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->

### Proposed solution
<!--- Suggest your potential solutions for this issue. -->
44 changes: 22 additions & 22 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
name: Feature request
about: Request feature for development
labels: 'Feature Request'

---

<!---
Fields marked with (*) are required. Please don't remove the template.
-->

### Description (*)
<!--- Describe the feature you would like to add. -->

### Expected behavior (*)
<!--- What is the expected behavior of this feature? How is it going to work? -->

### Benefits
<!--- How do you think this feature would improve the extension? -->

### Additional information
<!--- What other information can you provide about the desired feature? -->
---
name: Feature request
about: Request feature for development
labels: 'Feature Request'

---

<!---
Fields marked with (*) are required. Please don't remove the template.
-->

### Description (*)
<!--- Describe the feature you would like to add. -->

### Expected behavior (*)
<!--- What is the expected behavior of this feature? How is it going to work? -->

### Benefits
<!--- How do you think this feature would improve the extension? -->

### Additional information
<!--- What other information can you provide about the desired feature? -->
16 changes: 8 additions & 8 deletions Block/AbstractSlider.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ public function __construct(
) {
$this->_productCollectionFactory = $productCollectionFactory;
$this->_catalogProductVisibility = $catalogProductVisibility;
$this->_date = $dateTime;
$this->_helperData = $helperData;
$this->httpContext = $httpContext;
$this->urlEncoder = $urlEncoder;
$this->_date = $dateTime;
$this->_helperData = $helperData;
$this->httpContext = $httpContext;
$this->urlEncoder = $urlEncoder;

parent::__construct($context, $data);
}
Expand All @@ -121,7 +121,7 @@ protected function _construct()

$this->addData([
'cache_lifetime' => $this->getSlider() ? $this->getSlider()->getTimeCache() : 86400,
'cache_tags' => [Product::CACHE_TAG]
'cache_tags' => [Product::CACHE_TAG]
]);

$this->setTemplate('Mageplaza_Productslider::productslider.phtml');
Expand Down Expand Up @@ -200,8 +200,8 @@ public function getAddToCartPostParams(Product $product)

return [
'action' => $url,
'data' => [
'product' => $product->getEntityId(),
'data' => [
'product' => $product->getEntityId(),
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlEncoder->encode($url),
]
];
Expand Down Expand Up @@ -341,7 +341,7 @@ public function getDescription()
public function getAllOptions()
{
$sliderOptions = '';
$allConfig = $this->_helperData->getModuleConfig('slider_design');
$allConfig = $this->_helperData->getModuleConfig('slider_design');

foreach ($allConfig as $key => $value) {
if ($key === 'item_slider') {
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Config/Field/Responsive.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function _prepareToRender()
$this->addColumn('size', ['label' => __('Screen size max'), 'renderer' => false, 'class' => 'validate-digits']);
$this->addColumn('items', ['label' => __('Number of items'), 'renderer' => false, 'class' => 'validate-digits']);

$this->_addAfter = false;
$this->_addAfter = false;
$this->_addButtonLabel = __('Add');
}
}
6 changes: 3 additions & 3 deletions Block/Adminhtml/Slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class Slider extends Container
*/
protected function _construct()
{
$this->_controller = 'adminhtml_slider';
$this->_blockGroup = 'Mageplaza_Productslider';
$this->_headerText = __('Sliders');
$this->_controller = 'adminhtml_slider';
$this->_blockGroup = 'Mageplaza_Productslider';
$this->_headerText = __('Sliders');
$this->_addButtonLabel = __('Create New Slider');
parent::_construct();
}
Expand Down
8 changes: 4 additions & 4 deletions Block/Adminhtml/Slider/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function getSlider()
*/
protected function _construct()
{
$this->_objectId = 'id';
$this->_objectId = 'id';
$this->_blockGroup = 'Mageplaza_Productslider';
$this->_controller = 'adminhtml_slider';

Expand All @@ -96,12 +96,12 @@ protected function _construct()
$this->buttonList->add(
'save-and-continue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => [
'event' => 'saveAndContinueEdit',
'event' => 'saveAndContinueEdit',
'target' => '#edit_form'
]
]
Expand Down
6 changes: 3 additions & 3 deletions Block/Adminhtml/Slider/Edit/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ protected function _prepareForm()
$form = $this->_formFactory->create(
[
'data' => [
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save', ['id' => $this->getRequest()->getParam('id')]),
'method' => 'post',
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save', ['id' => $this->getRequest()->getParam('id')]),
'method' => 'post',
'enctype' => 'multipart/form-data'
]
]
Expand Down
26 changes: 13 additions & 13 deletions Block/Adminhtml/Slider/Edit/Tab/Design.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,39 +93,39 @@ protected function _prepareForm()
'base_fieldset',
[
'legend' => __('Design'),
'class' => 'fieldset-wide'
'class' => 'fieldset-wide'
]
);

$fieldset->addField('title', 'text', [
'name' => 'title',
'name' => 'title',
'label' => __('Title'),
'title' => __('Title'),
]);
$fieldset->addField('description', 'textarea', [
'name' => 'description',
'name' => 'description',
'label' => __('Description'),
'title' => __('Description'),
]);
$fieldset->addField('limit_number', 'text', [
'name' => 'limit_number',
'name' => 'limit_number',
'label' => __('Limit the number of products'),
'title' => __('Limit the number of products'),
'class' => 'validate-digits'
]);

$fieldset->addField('display_additional', 'multiselect', [
'name' => 'display_additional',
'label' => __('Display additional information'),
'title' => __('Display additional information'),
'name' => 'display_additional',
'label' => __('Display additional information'),
'title' => __('Display additional information'),
'values' => $this->_additional->toOptionArray(),
'note' => __('Select information or button(s) to display with products.')
'note' => __('Select information or button(s) to display with products.')
]);

$isResponsive = $fieldset->addField('is_responsive', 'select', [
'name' => 'is_responsive',
'label' => __('Is Responsive'),
'title' => __('Is Responsive'),
'name' => 'is_responsive',
'label' => __('Is Responsive'),
'title' => __('Is Responsive'),
'options' => [
'1' => __('Yes'),
'0' => __('No'),
Expand All @@ -137,10 +137,10 @@ protected function _prepareForm()
'responsive_items',
'Mageplaza\Productslider\Block\Adminhtml\Slider\Edit\Tab\Renderer\Responsive',
[
'name' => 'responsive_items',
'name' => 'responsive_items',
'label' => __('Max Items slider'),
'title' => __('Max Items slider'),
'note' => __('Default: 3 items.')
'note' => __('Default: 3 items.')
]
);

Expand Down
Loading

0 comments on commit b3cb807

Please sign in to comment.