Skip to content

Commit fdbd853

Browse files
committed
Merge remote-tracking branch 'magento2/develop' into 0.42.0-beta6
2 parents 0cc78ca + 5b1aef1 commit fdbd853

File tree

894 files changed

+8612
-6613
lines changed

Some content is hidden

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

894 files changed

+8612
-6613
lines changed

Gruntfile.js

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44

55
// For performance use one level down: 'name/{,*/}*.js'
66
// If you want to recursively match all subfolders, use: 'name/**/*.js'
7-
8-
'use strict';
9-
107
module.exports = function (grunt) {
8+
'use strict';
119

1210
// Required plugins
1311
// _____________________________________________
12+
var specRunner = require('./dev/tests/js/framework/spec_runner')(grunt);
1413

1514
require('./dev/tools/grunt/tasks/mage-minify')(grunt);
1615

1716
// Time how long tasks take. Can help when optimizing build times
1817
require('time-grunt')(grunt);
1918

2019
// Load grunt tasks automatically
21-
require('load-grunt-tasks')(grunt);
20+
require('load-grunt-tasks')(grunt, {
21+
pattern: ['grunt-*', '!grunt-template-jasmine-requirejs']
22+
});
2223

2324
var svgo = require('imagemin-svgo');
2425

@@ -42,7 +43,8 @@ module.exports = function (grunt) {
4243
uglify: {
4344
legacy: 'lib/web/legacy-build.min.js'
4445
},
45-
doc: 'lib/web/css/docs'
46+
doc: 'lib/web/css/docs',
47+
spec: 'dev/tests/js/spec'
4648
};
4749

4850
// Define Themes
@@ -459,8 +461,38 @@ module.exports = function (grunt) {
459461
'<%= path.doc %>': '<%= path.doc %>/source'
460462
}
461463
}
462-
}
464+
},
465+
466+
specRunner: {
467+
options: {
468+
shareDir: 'base'
469+
},
470+
backend: {
471+
options: {
472+
port: 8000,
473+
areaDir: 'adminhtml',
474+
theme: 'backend'
475+
}
476+
},
477+
frontend: {
478+
options: {
479+
port: 3000,
480+
areaDir: 'frontend',
481+
theme: 'blank'
482+
}
483+
}
484+
},
463485

486+
jasmine: {
487+
'options': {
488+
template: require('grunt-template-jasmine-requirejs'),
489+
ignoreEmpty: true
490+
},
491+
'backend-unit': specRunner.configure('unit', 'adminhtml', 8000),
492+
'backend-integration': specRunner.configure('integration', 'adminhtml', 8000),
493+
'frontend-unit': specRunner.configure('unit', 'frontend', 3000),
494+
'frontend-integration': specRunner.configure('integration', 'frontend', 3000)
495+
}
464496
});
465497

466498
// Assembling tasks
@@ -514,4 +546,21 @@ module.exports = function (grunt) {
514546
}
515547
});
516548

549+
// Tests
550+
// ---------------------------------------------
551+
552+
grunt.registerTask('spec', [
553+
'specRunner:backend',
554+
'specRunner:frontend'
555+
]);
556+
557+
grunt.registerTask('unit', [
558+
'jasmine:backend-unit',
559+
'jasmine:frontend-unit'
560+
]);
561+
562+
grunt.registerTask('integration', [
563+
'jasmine:backend-integration',
564+
'jasmine:frontend-integration'
565+
]);
517566
};

app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
*/
1414
?>
1515
<div data-mage-init='{"modalPopup": {}}' class="fade critical-notification">
16-
<div class="popup popup-<?php echo preg_replace('#[^a-z0-9]+#', '-', strtolower($this->getSeverityText())) ?>">
16+
<div class="popup popup-<?php echo preg_replace('#[^a-z0-9]+#', '-', strtolower($block->getSeverityText())) ?>">
1717
<div class="popup-inner">
1818
<header class="popup-header">
19-
<h2 class="popup-title"><?php echo $this->getHeaderText(); ?></h2>
19+
<h2 class="popup-title"><?php echo $block->getHeaderText(); ?></h2>
2020
</header>
2121
<div class="popup-content">
22-
<span><?php echo $this->getSeverityText();?></span>
23-
<p class="message-text"><?php echo $this->getNoticeMessageText(); ?></p>
22+
<span><?php echo $block->getSeverityText();?></span>
23+
<p class="message-text"><?php echo $block->getNoticeMessageText(); ?></p>
2424

25-
<a href="<?php echo $this->getNoticeMessageUrl(); ?>"><?php echo $this->getReadDetailsText(); ?></a>
25+
<a href="<?php echo $block->getNoticeMessageUrl(); ?>"><?php echo $block->getReadDetailsText(); ?></a>
2626
</div>
2727
<span class="close" data-dismiss="popup" title="<?php echo __('Close popup'); ?>"><?php echo __('Close'); ?></span>
2828
</div>

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages.phtml

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

99
?>
10-
<?php /** @var $this \Magento\AdminNotification\Block\System\Messages */ ?>
10+
<?php /** @var $block \Magento\AdminNotification\Block\System\Messages */ ?>
1111

12-
<?php $lastCritical = $this->getLastCritical();?>
12+
<?php $lastCritical = $block->getLastCritical();?>
1313
<div id="system_messages" class="message-system<?php if ($lastCritical): ?> message-system-unread<?php endif; ?>">
1414
<div class="message-system-inner">
1515
<?php if ($lastCritical): ?>
@@ -21,13 +21,13 @@
2121
<?php endif; ?>
2222
<div class="message-system-short">
2323
System Messages:
24-
<?php if ($this->getCriticalCount()): ?>
25-
<span class="error"><a href="#" title="<?php echo $this->escapeHtml(__('Critical System Messages'));?>"><?php echo $this->getCriticalCount();?></a></span>
24+
<?php if ($block->getCriticalCount()): ?>
25+
<span class="error"><a href="#" title="<?php echo $block->escapeHtml(__('Critical System Messages'));?>"><?php echo $block->getCriticalCount();?></a></span>
2626
<?php endif;?>
27-
<?php if ($this->getMajorCount()): ?>
28-
<span class="warning"><a href="#" title="<?php echo $this->escapeHtml(__('Major System Messages'));?>"><?php echo $this->getMajorCount();?></a></span>
27+
<?php if ($block->getMajorCount()): ?>
28+
<span class="warning"><a href="#" title="<?php echo $block->escapeHtml(__('Major System Messages'));?>"><?php echo $block->getMajorCount();?></a></span>
2929
<?php endif;?>
3030
</div>
31-
<div id="message-system-all" title="<?php echo $this->escapeHtml(__('System messages'));?>" data-mage-init='<?php echo $this->escapeHtml($this->getSystemMessageDialogJson());?>'></div>
31+
<div id="message-system-all" title="<?php echo $block->escapeHtml(__('System messages'));?>" data-mage-init='<?php echo $block->escapeHtml($block->getSystemMessageDialogJson());?>'></div>
3232
</div>
3333
</div>

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

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

99
?>
10-
<?php /** @var $this \Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup */ ?>
11-
<div id="system_messages_list" title="<?php echo $this->escapeHtml($this->getPopupTitle()); ?>">
10+
<?php /** @var $block \Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup */ ?>
11+
<div id="system_messages_list" title="<?php echo $block->escapeHtml($block->getPopupTitle()); ?>">
1212
<ul class="message-system-list">
13-
<?php foreach ($this->getUnreadMessages() as $message): ?>
14-
<li class="<?php echo $this->getItemClass($message);?>">
13+
<?php foreach ($block->getUnreadMessages() as $message): ?>
14+
<li class="<?php echo $block->getItemClass($message);?>">
1515
<?php echo $message->getText();?>
1616
</li>
1717
<?php endforeach;?>

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,39 @@
88

99
?>
1010
<?php /** @var $this \Magento\AdminNotification\Block\ToolbarEntry */ ?>
11-
<?php $notificationCount = $this->getUnreadNotificationCount(); ?>
12-
<div data-mage-init='{"toolbarEntry": {}}' class="notifications-summary" data-notification-count="<?php echo $this->escapeHtml($notificationCount); ?>">
11+
<?php $notificationCount = $block->getUnreadNotificationCount(); ?>
12+
<div data-mage-init='{"toolbarEntry": {}}' class="notifications-summary" data-notification-count="<?php echo $block->escapeHtml($notificationCount); ?>">
1313
<?php if ($notificationCount > 0) : ?>
14-
<a href="<?php echo $this->getUrl('adminhtml/notification/index'); ?>" class="action notifications-action" data-mage-init='{"dropdown":{}}' title="<?php echo __('Notifications'); ?>" data-toggle="dropdown">
14+
<a href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>" class="action notifications-action" data-mage-init='{"dropdown":{}}' title="<?php echo __('Notifications'); ?>" data-toggle="dropdown">
1515
<span class="text"><?php echo __('Notifications'); ?></span>
16-
<span class="counter qty"><?php echo $this->escapeHtml($notificationCount); ?></span>
16+
<span class="counter qty"><?php echo $block->escapeHtml($notificationCount); ?></span>
1717
</a>
18-
<ul class="dropdown-menu notifications-list" data-mark-as-read-url="<?php echo $this->getUrl('adminhtml/notification/ajaxMarkAsRead'); ?>">
19-
<?php foreach ($this->getLatestUnreadNotifications() as $notification) : ?>
18+
<ul class="dropdown-menu notifications-list" data-mark-as-read-url="<?php echo $block->getUrl('adminhtml/notification/ajaxMarkAsRead'); ?>">
19+
<?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
2020
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox*/ ?>
2121
<li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>"
22-
data-notification-id="<?php echo $this->escapeHtml($notification->getId()); ?>"
22+
data-notification-id="<?php echo $block->escapeHtml($notification->getId()); ?>"
2323
data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>">
24-
<strong class="notifications-entry-title"><?php echo $this->escapeHtml($notification->getTitle()); ?></strong>
25-
<span class="notifications-entry-description"><?php echo $this->escapeHtml($notification->getDescription()); ?></span>
26-
<time class="notifications-entry-time"><?php echo $this->escapeHtml($this->formatNotificationDate($notification->getDateAdded())); ?></time>
24+
<strong class="notifications-entry-title"><?php echo $block->escapeHtml($notification->getTitle()); ?></strong>
25+
<span class="notifications-entry-description"><?php echo $block->escapeHtml($notification->getDescription()); ?></span>
26+
<time class="notifications-entry-time"><?php echo $block->escapeHtml($block->formatNotificationDate($notification->getDateAdded())); ?></time>
2727
<button class="action close notifications-close"><span><?php echo __('Close'); ?></span></button>
2828
<div class="notifications-dialog-content" data-title="<?php echo __('Notification'); ?>" data-cancel-caption="<?php echo __('Cancel'); ?>" data-acknowledge-caption="<?php echo __('Acknowledge'); ?>">
29-
<strong class="notifications-entry-title"><?php echo $this->escapeHtml($notification->getTitle()); ?></strong>
30-
<span class="notifications-entry-description"><?php echo $this->escapeHtml($notification->getDescription()); ?></span>
29+
<strong class="notifications-entry-title"><?php echo $block->escapeHtml($notification->getTitle()); ?></strong>
30+
<span class="notifications-entry-description"><?php echo $block->escapeHtml($notification->getDescription()); ?></span>
3131
<div class="actions notifications-entry-actions">
32-
<a class="notifications-url" href="<?php echo $this->escapeUrl($notification->getUrl()); ?>" target="_blank"><?php echo __('Read Details'); ?></a>
32+
<a class="notifications-url" href="<?php echo $block->escapeUrl($notification->getUrl()); ?>" target="_blank"><?php echo __('Read Details'); ?></a>
3333
</div>
34-
<time class="notifications-entry-time"><?php echo $this->escapeHtml($this->formatNotificationDate($notification->getDateAdded())); ?></time>
34+
<time class="notifications-entry-time"><?php echo $block->escapeHtml($block->formatNotificationDate($notification->getDateAdded())); ?></time>
3535
</div>
3636
</li>
3737
<?php endforeach; ?>
3838
<li class="last">
39-
<a href="<?php echo $this->getUrl('adminhtml/notification/index'); ?>" class="action more notification-more"><?php echo __('See All (%1 unread)', $notificationCount); ?></a>
39+
<a href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>" class="action more notification-more"><?php echo __('See All (%1 unread)', $notificationCount); ?></a>
4040
</li>
4141
</ul>
4242
<?php else : ?>
43-
<a href="<?php echo $this->getUrl('adminhtml/notification/index'); ?>" class="action notifications-action empty" title="<?php echo __('Notifications'); ?>">
43+
<a href="<?php echo $block->getUrl('adminhtml/notification/index'); ?>" class="action notifications-action empty" title="<?php echo __('Notifications'); ?>">
4444
<span class="text"><?php echo __('Notifications'); ?></span>
4545
</a>
4646
<?php endif; ?>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ public function getGridIdsJson()
260260
return '';
261261
}
262262

263-
$gridIds = $this->getParentBlock()->getCollection()->getAllIds();
263+
/** @var \Magento\Framework\Data\Collection $allIdsCollection */
264+
$allIdsCollection = clone $this->getParentBlock()->getCollection();
265+
$gridIds = $allIdsCollection->clear()->setPageSize(0)->getAllIds();
264266

265267
if (!empty($gridIds)) {
266268
return join(",", $gridIds);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ public function getGridIdsJson()
271271
return '';
272272
}
273273

274-
$gridIds = $this->getParentBlock()->getCollection()->getAllIds();
274+
/** @var \Magento\Framework\Data\Collection $allIdsCollection */
275+
$allIdsCollection = clone $this->getParentBlock()->getCollection();
276+
$gridIds = $allIdsCollection->clear()->setPageSize(0)->getAllIds();
275277

276278
if (!empty($gridIds)) {
277279
return join(",", $gridIds);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
?>
1515
<h1 class="page-heading"><?php echo __('Access denied') ?></h1>
16-
<?php if (!$this->hasAvailableResources()): ?>
16+
<?php if (!$block->hasAvailableResources()): ?>
1717
<p>
1818
<?php echo __('Please try to log out and sign in again.') ?><br/>
1919
<?php echo __('If you continue to receive this message, please contact the store owner.') ?>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<div><input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" /></div>
7+
<div><input name="form_key" type="hidden" value="<?php echo $block->getFormKey() ?>" /></div>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
<div class="logo" title="<?php echo __('Magento Admin Panel') ?>"><span><?php echo __('Magento Admin Panel') ?></span></div>
1616
</header>
1717
<div id="messages" data-container-for="messages">
18-
<?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?>
18+
<?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?>
1919
</div>
2020
<form method="post" action="" id="login-form" data-mage-init='{"form": {}, "validation": {}}' autocomplete="off">
2121
<fieldset class="fieldset">
2222
<legend class="legend"><span><?php echo __('Welcome') ?></span></legend><br/>
23-
<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
23+
<input name="form_key" type="hidden" value="<?php echo $block->getFormKey() ?>" />
2424
<div class="field field-username">
2525
<label for="username" class="label"><span><?php echo __('User Name:') ?></span></label>
2626
<div class="control">
@@ -35,9 +35,9 @@
3535
<input type="password" id="login" name="login[password]" class="required-entry input-text" value="" placeholder="<?php echo __('password') ?>" />
3636
</div>
3737
</div>
38-
<?php echo $this->getChildHtml('form.additional.info'); ?>
38+
<?php echo $block->getChildHtml('form.additional.info'); ?>
3939
<div class="form-actions">
40-
<?php echo $this->getChildHtml('form.buttons'); ?>
40+
<?php echo $block->getChildHtml('form.buttons'); ?>
4141
</div>
4242
</fieldset>
4343
</form>
@@ -46,7 +46,7 @@
4646
</div>
4747
<footer class="footer">
4848
<div class="footer-content">
49-
<div class="footer-copyright"><?php echo $this->getChildHtml('copyright');?></div>
49+
<div class="footer-copyright"><?php echo $block->getChildHtml('copyright');?></div>
5050
</div>
5151
</footer>
5252
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
?>
77
<div class="actions">
8-
<button <?php $this->getUiId(); ?> class="action-login primary" title="<?php echo __('Log in')?>" type="submit">
8+
<button <?php $block->getUiId(); ?> class="action-login primary" title="<?php echo __('Log in')?>" type="submit">
99
<span><?php echo __('Log in')?></span>
1010
</button>
1111
</div>

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@
1010
<div class="wrapper-popup">
1111
<div class="middle" id="anchor-content">
1212
<div id="page:main-container">
13-
<?php if ($this->getChildHtml('left')): ?>
14-
<div class="columns <?php echo $this->getContainerCssClass() ?>" id="page:container">
13+
<?php if ($block->getChildHtml('left')): ?>
14+
<div class="columns <?php echo $block->getContainerCssClass() ?>" id="page:container">
1515
<div id="page:left" class="side-col">
16-
<?php echo $this->getChildHtml('left') ?>
16+
<?php echo $block->getChildHtml('left') ?>
1717
</div>
1818
<div class="main-col" id="content">
1919
<div class="main-col-inner">
20-
<div id="messages" data-container-for="messages"><?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div>
21-
<?php echo $this->getChildHtml('content') ?>
20+
<div id="messages" data-container-for="messages"><?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div>
21+
<?php echo $block->getChildHtml('content') ?>
2222
</div>
2323
</div>
2424
</div>
2525
<?php else: ?>
26-
<div id="messages" data-container-for="messages"><?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div>
27-
<?php echo $this->getChildHtml('content') ?>
26+
<div id="messages" data-container-for="messages"><?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div>
27+
<?php echo $block->getChildHtml('content') ?>
2828
<?php endif; ?>
2929
</div>
3030
</div>
31-
<?php if ($this->getChildHtml('footer')): ?>
31+
<?php if ($block->getChildHtml('footer')): ?>
3232
<div class="footer">
33-
<?php echo $this->getChildHtml('footer') ?>
33+
<?php echo $block->getChildHtml('footer') ?>
3434
</div>
3535
<?php endif; ?>
36-
<?php echo $this->getChildHtml('js') ?>
36+
<?php echo $block->getChildHtml('js') ?>
3737
</div>

0 commit comments

Comments
 (0)