Skip to content

Commit 1efdc59

Browse files
author
Vilchynskyi, Dmytro(dvilchynskyi)
committed
Merge pull request #262 from magento-vanilla/PR
[Vanilla] Sprints 16-17
2 parents 28f4987 + 199391f commit 1efdc59

File tree

477 files changed

+18363
-14684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

477 files changed

+18363
-14684
lines changed

app/code/Magento/AdminNotification/view/adminhtml/templates/toolbar_entry.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
?>
1515
<div
1616
data-mage-init='{"toolbarEntry": {}}'
17-
class="notifications-wrapper"
17+
class="notifications-wrapper admin__action-dropdown-wrap"
1818
data-notification-count="<?php echo $notificationCount; ?>">
1919
<?php if ($notificationCount > 0) : ?>
2020
<a
2121
href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>"
22-
class="notifications-action"
22+
class="notifications-action admin__action-dropdown"
2323
data-mage-init='{"dropdown":{}}'
2424
title="<?php echo __('Notifications'); ?>"
2525
data-toggle="dropdown">
@@ -28,7 +28,7 @@
2828
</span>
2929
</a>
3030
<ul
31-
class="notifications-list"
31+
class="admin__action-dropdown-menu"
3232
data-mark-as-read-url="<?php echo $block->getUrl('adminhtml/notification/ajaxMarkAsRead'); ?>">
3333
<?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
3434
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox*/ ?>
@@ -76,7 +76,7 @@
7676
</ul>
7777
<?php else : ?>
7878
<a
79-
class="notifications-action"
79+
class="notifications-action admin__action-dropdown"
8080
href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>"
8181
title="<?php echo __('Notifications'); ?>">
8282
</a>

app/code/Magento/AdminNotification/view/adminhtml/web/toolbar_entry.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ define([
1111

1212
// Mark notification as read via AJAX call
1313
var markNotificationAsRead = function (notificationId) {
14-
var requestUrl = $('.notifications-wrapper .notifications-list').attr('data-mark-as-read-url');
14+
var requestUrl = $('.notifications-wrapper .admin__action-dropdown-menu').attr('data-mark-as-read-url');
1515
$.ajax({
1616
url: requestUrl,
1717
type: 'POST',
@@ -33,7 +33,7 @@ define([
3333

3434
if (notificationCount == 0) {
3535
// Change appearance of the bubble and its behavior when the last notification is removed
36-
$('.notifications-wrapper .notifications-list').remove();
36+
$('.notifications-wrapper .admin__action-dropdown-menu').remove();
3737
var notificationIcon = $('.notifications-wrapper .notifications-icon');
3838
notificationIcon.removeAttr('data-toggle');
3939
notificationIcon.off('click.dropdown');
@@ -45,7 +45,7 @@ define([
4545
}
4646
$('.notifications-entry-last .notifications-counter').text(notificationCount);
4747
// Modify caption of the 'See All' link
48-
var actionElement = $('.notifications-wrapper .notifications-list .last .action-more');
48+
var actionElement = $('.notifications-wrapper .admin__action-dropdown-menu .last .action-more');
4949
actionElement.text(actionElement.text().replace(/\d+/, notificationCount));
5050
}
5151
},
@@ -65,7 +65,7 @@ define([
6565
};
6666

6767
// Show notification description when corresponding item is clicked
68-
$('.notifications-wrapper .notifications-list .notifications-entry').on('click.showNotification', function (event) {
68+
$('.notifications-wrapper .admin__action-dropdown-menu .notifications-entry').on('click.showNotification', function (event) {
6969
// hide notification dropdown
7070
$('.notifications-wrapper .notifications-icon').trigger('click.dropdown');
7171

app/code/Magento/Backend/Block/Menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ protected function _addSubMenu($menuItem, $level, $limit, $id = null)
419419
if ($level == 0 && $limit) {
420420
$colStops = $this->_columnBrake($menuItem->getChildren(), $limit);
421421
$output .= '<strong class="submenu-title">' . $this->_getAnchorLabel($menuItem) . '</strong>';
422-
$output .= '<a href="#" class="submenu-close _close" data-role="close-submenu"></a>';
422+
$output .= '<a href="#" class="action-close _close" data-role="close-submenu"></a>';
423423
}
424424

425425
$output .= $this->renderNavigation($menuItem->getChildren(), $level + 1, $limit, $colStops);

app/code/Magento/Backend/Block/Widget/Grid.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ protected function _preparePage()
391391
*/
392392
protected function _prepareGrid()
393393
{
394+
$this->_eventManager->dispatch(
395+
'backend_block_widget_grid_prepare_grid_before',
396+
['grid' => $this, 'collection' => $this->getCollection()]
397+
);
394398
if ($this->getChildBlock('grid.massaction') && $this->getChildBlock('grid.massaction')->isAvailable()) {
395399
$this->getChildBlock('grid.massaction')->prepareMassactionColumn();
396400
}
@@ -433,6 +437,10 @@ protected function _prepareFilterButtons()
433437
'Magento\Backend\Block\Widget\Button'
434438
)->setData(
435439
['label' => __('Reset Filter'), 'onclick' => $this->getJsObjectName() . '.resetFilter()', 'class' => 'action-reset']
440+
)->setDataAttribute(
441+
[
442+
'action' => 'grid-filter-reset'
443+
]
436444
)
437445
);
438446
$this->setChild(
@@ -445,6 +453,10 @@ protected function _prepareFilterButtons()
445453
'onclick' => $this->getJsObjectName() . '.doFilter()',
446454
'class' => 'task',
447455
]
456+
)->setDataAttribute(
457+
[
458+
'action' => 'grid-filter-apply'
459+
]
448460
)
449461
);
450462
}

app/code/Magento/Backend/Block/Widget/Grid/Extended.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ protected function _prepareLayout()
208208
'onclick' => $this->getJsObjectName() . '.resetFilter()',
209209
'class' => 'action-reset'
210210
]
211+
)->setDataAttribute(
212+
[
213+
'action' => 'grid-filter-reset'
214+
]
211215
)
212216
);
213217
$this->setChild(
@@ -218,6 +222,10 @@ protected function _prepareLayout()
218222
'onclick' => $this->getJsObjectName() . '.doFilter()',
219223
'class' => 'task',
220224
]
225+
)->setDataAttribute(
226+
[
227+
'action' => 'grid-filter-apply'
228+
]
221229
)
222230
);
223231
return parent::_prepareLayout();

app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,41 @@
77
// @codingStandardsIgnoreFile
88

99
?>
10+
1011
<form method="post" action="" id="login-form" data-mage-init='{"form": {}, "validation": {}}' autocomplete="off">
1112
<fieldset class="admin__fieldset">
1213
<legend class="admin__legend"><span><?php echo __('Welcome, please sign in') ?></span></legend><br/>
1314
<input name="form_key" type="hidden" value="<?php echo $block->getFormKey() ?>" />
1415
<div class="admin__field _required field-username">
1516
<label for="username" class="admin__field-label"><span><?php echo __('Username') ?></span></label>
1617
<div class="admin__field-control">
17-
<input type="text" id="username" name="login[username]" autofocus value="" data-validate="{required:true}" class="admin__control-text" placeholder="<?php echo __('user name') ?>" />
18+
<input
19+
id="username"
20+
class="admin__control-text"
21+
type="text"
22+
name="login[username]"
23+
autofocus
24+
value=""
25+
data-validate="{required:true}"
26+
placeholder="<?php echo __('user name') ?>"/>
1827
</div>
1928
</div>
2029
<div class="admin__field _required field-password">
2130
<label for="login" class="admin__field-label"><span><?php echo __('Password') ?></span></label>
2231
<div class="admin__field-control">
2332
<!-- This is a dummy hidden field to trick firefox from auto filling the password -->
24-
<input type="text" class="admin__control-dummy" name="dummy" id="dummy" />
25-
<input type="password" id="login" name="login[password]" data-validate="{required:true}" class="admin__control-text" value="" placeholder="<?php echo __('password') ?>" />
33+
<input
34+
id="dummy"
35+
class="admin__control-dummy"
36+
type="text"
37+
name="dummy"/>
38+
<input
39+
id="login"
40+
class="admin__control-text"
41+
type="password"
42+
name="login[password]"
43+
data-validate="{required:true}"
44+
value="" placeholder="<?php echo __('password') ?>" />
2645
</div>
2746
</div>
2847
<?php echo $block->getChildHtml('form.additional.info'); ?>

app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
</a>
2222
<?php break; ?>
2323
<?php case 'user': ?>
24-
<div class="admin-user">
24+
<div class="admin-user admin__action-dropdown-wrap">
2525
<a
2626
href="<?php echo $block->getUrl('adminhtml/system_account/index') ?>"
27-
class="admin-user-account"
27+
class="admin__action-dropdown"
2828
title="<?php echo $block->escapeHtml(__('My Account')) ?>"
2929
data-mage-init='{"dropdown":{}}'
3030
data-toggle="dropdown">
31-
<span class="admin-user-account-text-wrapper">
31+
<span class="admin__action-dropdown-text">
3232
<span class="admin-user-account-text"><?php echo $block->escapeHtml($block->getUser()->getUsername()); ?></span>
3333
</span>
3434
</a>
35-
<ul class="admin-user-menu">
35+
<ul class="admin__action-dropdown-menu">
3636
<?php if ($block->getAuthorization()->isAllowed('Magento_Backend::myaccount')): ?>
3737
<li>
3838
<a

app/code/Magento/Captcha/view/adminhtml/templates/default.phtml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@
1111
<?php /* @var $block \Magento\Captcha\Block\Captcha\DefaultCaptcha */ ?>
1212
<?php $captcha = $block->getCaptchaModel() ?>
1313
<div class="admin__field _required">
14-
<label for="captcha" class="admin__field-label"><span><?php echo __('Please enter the letters from the image') ?></span></label>
14+
<label for="captcha" class="admin__field-label">
15+
<span><?php echo __('Please enter the letters from the image') ?></span>
16+
</label>
1517
<div class="admin__field-control">
16-
<input type="text" name="<?php echo \Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $block->getFormId()?>]" id="captcha" data-validate="{required:true}" class="admin__control-text"/>
18+
<input
19+
id="captcha"
20+
class="admin__control-text"
21+
type="text"
22+
name="<?php echo \Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $block->getFormId()?>]"
23+
data-validate="{required:true}"/>
1724
<?php if ($captcha->isCaseSensitive()) :?>
1825
<div class="admin__field-note">
1926
<span><?php echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?></span>
@@ -22,8 +29,16 @@
2229
</div>
2330
</div>
2431
<div class="admin__field field-captcha">
25-
<img id="captcha-reload" class="captcha-reload" src="<?php echo $block->getViewFileUrl('Magento_Captcha::reload.png') ?>" alt="<?php echo __('Reload captcha') ?>"/>
26-
<img id="<?php echo $block->getFormId() ?>" width="<?php echo $block->getImgWidth() ?>" height="<?php echo $block->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>" />
32+
<img
33+
id="captcha-reload"
34+
class="captcha-reload"
35+
src="<?php echo $block->getViewFileUrl('Magento_Captcha::reload.png') ?>"
36+
alt="<?php echo __('Reload captcha') ?>"/>
37+
<img
38+
id="<?php echo $block->getFormId() ?>"
39+
width="<?php echo $block->getImgWidth() ?>"
40+
height="<?php echo $block->getImgHeight() ?>"
41+
src="<?php echo $captcha->getImgSrc() ?>" />
2742
</div>
2843
<script>
2944
require(["prototype", "mage/captcha"], function(){

app/code/Magento/Catalog/view/adminhtml/web/catalog/product.js

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,72 @@
33
* See COPYING.txt for license details.
44
*/
55
require([
6-
"jquery",
7-
"prototype"
8-
], function(jQuery){
6+
'jquery'
7+
], function ($) {
8+
'use strict';
99

1010
window.Product = {};
1111

12+
function byId(id) {
13+
return document.getElementById(id);
14+
}
15+
1216
function toogleFieldEditMode(toogleIdentifier, fieldContainer) {
13-
if ($(toogleIdentifier).checked) {
17+
if (byId(toogleIdentifier).checked) {
1418
enableFieldEditMode(fieldContainer);
1519
} else {
1620
disableFieldEditMode(fieldContainer);
1721
}
1822
}
1923

2024
function disableFieldEditMode(fieldContainer) {
21-
$(fieldContainer).disabled = true;
22-
if ($(fieldContainer + '_hidden')) {
23-
$(fieldContainer + '_hidden').disabled = true;
25+
byId(fieldContainer).disabled = true;
26+
27+
if (byId(fieldContainer + '_hidden')) {
28+
byId(fieldContainer + '_hidden').disabled = true;
2429
}
2530
}
2631

2732
function enableFieldEditMode(fieldContainer) {
28-
$(fieldContainer).disabled = false;
29-
if ($(fieldContainer + '_hidden')) {
30-
$(fieldContainer + '_hidden').disabled = false;
33+
byId(fieldContainer).disabled = false;
34+
35+
if (byId(fieldContainer + '_hidden')) {
36+
byId(fieldContainer + '_hidden').disabled = false;
3137
}
3238
}
3339

3440
function onCompleteDisableInited() {
35-
jQuery.each(jQuery('[data-disable]'), function () {
36-
var item = jQuery(this).data('disable');
41+
$.each($('[data-disable]'), function () {
42+
var item = $(this).data('disable');
3743
disableFieldEditMode(item);
3844
});
3945
}
4046

4147
function onUrlkeyChanged(urlKey) {
42-
urlKey = $(urlKey);
43-
var hidden = urlKey.next('input[type=hidden]');
44-
var chbx = urlKey.next('input[type=checkbox]');
48+
urlKey = byId(urlKey);
49+
var hidden = $(urlKey).next('input[type=hidden]')[0];
50+
var chbx = $(urlKey).next('input[type=checkbox]')[0];
4551
var oldValue = chbx.value;
46-
chbx.disabled = (oldValue == urlKey.value);
52+
53+
chbx.disabled = (oldValue === urlKey.value);
4754
hidden.disabled = chbx.disabled;
4855
}
4956

5057
function onCustomUseParentChanged(element) {
51-
var useParent = (element.value == 1) ? true : false;
52-
element.up(2).select('input', 'select', 'textarea').each(function (el) {
53-
if (element.id != el.id) {
58+
var useParent = (element.value === 1) ? true : false,
59+
parent = $(element).parent().parent();
60+
61+
parent.find('input, select, textarea').each(function (i, el) {
62+
if (element.id !== el.id) {
5463
el.disabled = useParent;
5564
}
5665
});
57-
element.up(2).select('img').each(function (el) {
66+
67+
parent.find('img').each(function (i, el) {
5868
if (useParent) {
59-
el.hide();
69+
$(el).hide();
6070
} else {
61-
el.show();
71+
$(el).show();
6272
}
6373
});
6474
}
@@ -67,5 +77,5 @@ require([
6777
window.onUrlkeyChanged = onUrlkeyChanged;
6878
window.toogleFieldEditMode = toogleFieldEditMode;
6979

70-
Event.observe(window, 'load', onCompleteDisableInited);
71-
});
80+
$(window).load(onCompleteDisableInited);
81+
});

app/code/Magento/Cms/Controller/Adminhtml/AbstractMassDelete.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
/**
3-
*
43
* Copyright © 2015 Magento. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
@@ -21,7 +20,7 @@ class AbstractMassDelete extends \Magento\Backend\App\Action
2120
/**
2221
* Redirect url
2322
*/
24-
const REDIRECT_URL = '*/*/index';
23+
const REDIRECT_URL = '*/*/';
2524

2625
/**
2726
* Resource collection
@@ -45,17 +44,17 @@ class AbstractMassDelete extends \Magento\Backend\App\Action
4544
*/
4645
public function execute()
4746
{
48-
$data = $this->getRequest()->getParam('massaction', '[]');
49-
$data = json_decode($data, true);
47+
$selected = $this->getRequest()->getParam('selected');
48+
$excluded = $this->getRequest()->getParam('excluded');
5049

51-
if (isset($data['all_selected']) && $data['all_selected'] === true) {
52-
if (!empty($data['excluded'])) {
53-
$this->excludedDelete($data['excluded']);
50+
if (isset($excluded)) {
51+
if (!empty($excluded)) {
52+
$this->excludedDelete($excluded);
5453
} else {
5554
$this->deleteAll();
5655
}
57-
} elseif (!empty($data['selected'])) {
58-
$this->selectedDelete($data['selected']);
56+
} elseif (!empty($selected)) {
57+
$this->selectedDelete($selected);
5958
} else {
6059
$this->messageManager->addError(__('Please select item(s).'));
6160
}

app/code/Magento/Cms/Controller/Adminhtml/Page/MassDelete.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
/**
3-
*
43
* Copyright © 2015 Magento. All rights reserved.
54
* See COPYING.txt for license details.
65
*/

0 commit comments

Comments
 (0)