Skip to content

Commit

Permalink
Merge pull request #64 from mageplaza/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
haitv282 authored May 18, 2020
2 parents bcc800c + e5ef2f5 commit 29ef59a
Show file tree
Hide file tree
Showing 77 changed files with 2,590 additions and 2,287 deletions.
24 changes: 12 additions & 12 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -1,13 +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
# 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.
136 changes: 68 additions & 68 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
language: php
php:
- 7.0
- 7.1
sudo: required
dist: trusty
env:
global:
- COMPOSER_BIN_DIR=~/bin
- INTEGRATION_SETS=3
- NODE_JS_VERSION=6
- MAGENTO_HOST_NAME="magento2.travis"
- COMPOSER_MODULE=mageplaza/module-banner-slider
matrix:
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.2.2 TEST_SUITE=static
- MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=3

matrix:
exclude:
- php: 7.0
env: MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static
- php: 7.0
env: MAGENTO_VERSION=2.2.2 TEST_SUITE=static
cache:
apt: true
directories:
- "$HOME/.composer/cache"
- "$HOME/.nvm"
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
- postfix
firefox: '46.0'
hosts:
- magento2.travis
before_install:
- git clone https://github.com/magento/magento2 --branch $MAGENTO_VERSION
- cd magento2
- bash ./dev/travis/before_install.sh
install:
- composer install --no-interaction --prefer-dist
- composer require $COMPOSER_MODULE
before_script:
#- cp -f ${TRAVIS_BUILD_DIR}/dev/tests/integration/phpunit.xml.dist dev/tests/integration/
- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Less/_files/whitelist/common.txt
- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt
- echo "vendor/$COMPOSER_MODULE/**/*.js" > dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt
- bash ./dev/travis/before_script.sh
script:
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true


language: php
php:
- 7.0
- 7.1
sudo: required
dist: trusty
env:
global:
- COMPOSER_BIN_DIR=~/bin
- INTEGRATION_SETS=3
- NODE_JS_VERSION=6
- MAGENTO_HOST_NAME="magento2.travis"
- COMPOSER_MODULE=mageplaza/module-banner-slider
matrix:
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.2.2 TEST_SUITE=static
- MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=3
- MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=1
- MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=2
- MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=3

matrix:
exclude:
- php: 7.0
env: MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static
- php: 7.0
env: MAGENTO_VERSION=2.2.2 TEST_SUITE=static
cache:
apt: true
directories:
- "$HOME/.composer/cache"
- "$HOME/.nvm"
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
- postfix
firefox: '46.0'
hosts:
- magento2.travis
before_install:
- git clone https://github.com/magento/magento2 --branch $MAGENTO_VERSION
- cd magento2
- bash ./dev/travis/before_install.sh
install:
- composer install --no-interaction --prefer-dist
- composer require $COMPOSER_MODULE
before_script:
#- cp -f ${TRAVIS_BUILD_DIR}/dev/tests/integration/phpunit.xml.dist dev/tests/integration/
- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Less/_files/whitelist/common.txt
- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt
- echo "vendor/$COMPOSER_MODULE/**/*.js" > dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt
- bash ./dev/travis/before_script.sh
script:
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true


6 changes: 3 additions & 3 deletions Block/Adminhtml/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class Banner extends Container
*/
protected function _construct()
{
$this->_controller = 'adminhtml_banner';
$this->_blockGroup = 'Mageplaza_BannerSlider';
$this->_headerText = __('Banners');
$this->_controller = 'adminhtml_banner';
$this->_blockGroup = 'Mageplaza_BannerSlider';
$this->_headerText = __('Banners');
$this->_addButtonLabel = __('Create New Banner');

parent::_construct();
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Banner/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct(
*/
protected function _construct()
{
$this->_objectId = 'banner_id';
$this->_objectId = 'banner_id';
$this->_blockGroup = 'Mageplaza_BannerSlider';
$this->_controller = 'adminhtml_banner';
parent::_construct();
Expand Down
6 changes: 3 additions & 3 deletions Block/Adminhtml/Banner/Edit/Tab/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
namespace Mageplaza\BannerSlider\Block\Adminhtml\Banner\Edit\Tab;

use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget\Button;
use Magento\Backend\Block\Widget\Form\Element\Dependence;
use Magento\Backend\Block\Widget\Form\Generic;
use Magento\Backend\Block\Widget\Tab\TabInterface;
use Magento\Cms\Model\Wysiwyg\Config as WysiwygConfig;
Expand All @@ -32,13 +34,11 @@
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Registry;
use Mageplaza\BannerSlider\Block\Adminhtml\Banner\Edit\Tab\Render\Image as BannerImage;
use Mageplaza\BannerSlider\Block\Adminhtml\Banner\Edit\Tab\Render\Slider;
use Mageplaza\BannerSlider\Helper\Data;
use Mageplaza\BannerSlider\Helper\Image as HelperImage;
use Mageplaza\BannerSlider\Model\Config\Source\Template;
use Mageplaza\BannerSlider\Model\Config\Source\Type;
use Magento\Backend\Block\Widget\Button;
use Mageplaza\BannerSlider\Block\Adminhtml\Banner\Edit\Tab\Render\Slider;
use Magento\Backend\Block\Widget\Form\Element\Dependence;

/**
* Class Banner
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Banner/Edit/Tab/Render/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function getElementHtml()
{
$html = '';

if ((string)$this->getValue()) {
if ((string) $this->getValue()) {
$url = $this->_getUrl();

if (!preg_match("/^http\:\/\/|https\:\/\//", $url)) {
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Banner/Edit/Tab/Render/Slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function getSliderCollection()
$collection = $this->collectionFactory->create();
$sliderById = [];
foreach ($collection as $slider) {
$sliderId = $slider->getId();
$sliderId = $slider->getId();
$sliderById[$sliderId]['value'] = $sliderId;
$sliderById[$sliderId]['is_active'] = 1;
$sliderById[$sliderId]['label'] = $slider->getName();
Expand Down
12 changes: 9 additions & 3 deletions Block/Adminhtml/Config/Field/Responsive.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ class Responsive extends AbstractFieldArray
*/
protected function _prepareToRender()
{
$this->addColumn('size', ['label' => __('Screen size from'), 'renderer' => false, 'class' => 'required-entry validate-digits']);
$this->addColumn('items', ['label' => __('Number of items'), 'renderer' => false, 'class' => 'required-entry validate-digits']);
$this->addColumn(
'size',
['label' => __('Screen size from'), 'renderer' => false, 'class' => 'required-entry validate-digits']
);
$this->addColumn(
'items',
['label' => __('Number of items'), 'renderer' => false, 'class' => 'required-entry 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_BannerSlider';
$this->_headerText = __('Sliders');
$this->_controller = 'adminhtml_slider';
$this->_blockGroup = 'Mageplaza_BannerSlider';
$this->_headerText = __('Sliders');
$this->_addButtonLabel = __('Create New Slider');

parent::_construct();
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Slider/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct(
*/
protected function _construct()
{
$this->_objectId = 'slider_id';
$this->_objectId = 'slider_id';
$this->_blockGroup = 'Mageplaza_BannerSlider';
$this->_controller = 'adminhtml_slider';
parent::_construct();
Expand Down
12 changes: 6 additions & 6 deletions Block/Adminhtml/Slider/Edit/Tab/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public function __construct(
array $data = []
) {
$this->bannerCollectionFactory = $bannerCollectionFactory;
$this->coreRegistry = $coreRegistry;
$this->bannerFactory = $bannerFactory;
$this->coreRegistry = $coreRegistry;
$this->bannerFactory = $bannerFactory;

parent::__construct($context, $backendHelper, $data);
}
Expand Down Expand Up @@ -193,7 +193,7 @@ protected function _prepareColumns()
'header' => __('Position'),
'name' => 'position',
'type' => 'number',
'validate_class' => 'validate-number',
'validate_class' => 'validate-number validate-zero-or-greater validate-digits',
'index' => 'position',
'editable' => true,
]);
Expand Down Expand Up @@ -224,12 +224,12 @@ protected function _getSelectedBanners()
public function getSelectedBanners()
{
$selected = $this->getSlider()->getBannersPosition();
if (!is_array($selected)) {
$selected = [];
} else {
if (is_array($selected)) {
foreach ($selected as $key => $value) {
$selected[$key] = ['position' => $value];
}
} else {
$selected = [];
}

return $selected;
Expand Down
22 changes: 11 additions & 11 deletions Block/Adminhtml/Slider/Edit/Tab/Design.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct(
array $data = []
) {
$this->_effect = $effect;
$this->_yesno = $yesno;
$this->_yesno = $yesno;

parent::__construct($context, $registry, $formFactory, $data);
}
Expand All @@ -94,7 +94,7 @@ protected function _prepareForm()
'title' => __('Animation Effect'),
'values' => $this->_effect->toOptionArray()
]);
$design = $fieldset->addField('design', 'select', [
$design = $fieldset->addField('design', 'select', [
'name' => 'design',
'label' => __('Manually Design'),
'title' => __('Manually Design'),
Expand All @@ -103,7 +103,7 @@ protected function _prepareForm()
'1' => __('Yes')
]
]);
$responsive = $fieldset->addField('is_responsive', 'select', [
$responsive = $fieldset->addField('is_responsive', 'select', [
'name' => 'is_responsive',
'label' => __('Is Responsive'),
'title' => __('Is Responsive'),
Expand All @@ -114,49 +114,49 @@ protected function _prepareForm()
'label' => __('Max Items Slider'),
'title' => __('Max Items Slider'),
]);
$autoWidth = $fieldset->addField('autoWidth', 'select', [
$autoWidth = $fieldset->addField('autoWidth', 'select', [
'name' => 'autoWidth',
'label' => __('Auto Width'),
'title' => __('Auto Width'),
'values' => $this->_yesno->toOptionArray()
]);
$autoHeight = $fieldset->addField('autoHeight', 'select', [
$autoHeight = $fieldset->addField('autoHeight', 'select', [
'name' => 'autoHeight',
'label' => __('Auto Height'),
'title' => __('Auto Height'),
'values' => $this->_yesno->toOptionArray()
]);
$loop = $fieldset->addField('loop', 'select', [
$loop = $fieldset->addField('loop', 'select', [
'name' => 'loop',
'label' => __('Infinity Loop'),
'title' => __('Infinity Loop'),
'values' => $this->_yesno->toOptionArray()
]);
$nav = $fieldset->addField('nav', 'select', [
$nav = $fieldset->addField('nav', 'select', [
'name' => 'nav',
'label' => __('Show Next/Prev Buttons'),
'title' => __('Show Next/Prev Buttons'),
'values' => $this->_yesno->toOptionArray()
]);
$dots = $fieldset->addField('dots', 'select', [
$dots = $fieldset->addField('dots', 'select', [
'name' => 'dots',
'label' => __('Show Dots Navigation'),
'title' => __('Show Dots Navigation'),
'values' => $this->_yesno->toOptionArray()
]);
$lazyload = $fieldset->addField('lazyLoad', 'select', [
$lazyload = $fieldset->addField('lazyLoad', 'select', [
'name' => 'lazyLoad',
'label' => __('Lazy Loading Images'),
'title' => __('Lazy Loading Images'),
'values' => $this->_yesno->toOptionArray()
]);
$autoplay = $fieldset->addField('autoplay', 'select', [
$autoplay = $fieldset->addField('autoplay', 'select', [
'name' => 'autoplay',
'label' => __('Autoplay'),
'title' => __('Autoplay'),
'values' => $this->_yesno->toOptionArray()
]);
$timeout = $fieldset->addField('autoplayTimeout', 'text', [
$timeout = $fieldset->addField('autoplayTimeout', 'text', [
'name' => 'autoplayTimeout',
'label' => __('Autoplay Time-Out'),
'title' => __('Autoplay Time-Out')
Expand Down
Loading

0 comments on commit 29ef59a

Please sign in to comment.