Skip to content

Commit

Permalink
Merge branch '2.3-develop' into feature/additional-product-options
Browse files Browse the repository at this point in the history
  • Loading branch information
torhoehn committed Nov 7, 2019
2 parents d4cae50 + 7324325 commit 6e36d5e
Show file tree
Hide file tree
Showing 607 changed files with 23,709 additions and 4,096 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<item name="text" xsi:type="string" translate="true"><![CDATA[
<p>Help us improve Magento Admin by allowing us to collect usage data.</p>
<p>All usage data that we collect for this purpose cannot be used to individually identify you and is used only to improve the Magento Admin and related products and services.</p>
<p>You can learn more and opt out at any time by following the instructions in <a href="https://docs.magento.com/m2/ce/user_guide/stores/admin.html" target="_blank">merchant documentation</a>.</p>
<p>You can learn more and opt out at any time by following the instructions in <a href="https://docs.magento.com/m2/ce/user_guide/stores/admin.html" target="_blank" tabindex="0">merchant documentation</a>.</p>
]]></item>
</item>
</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ define([
enableLogAction: '${ $.provider }:data.enableLogAction',
disableLogAction: '${ $.provider }:data.disableLogAction'
},
options: {
keyEventHandlers: {
/**
* Prevents escape key from exiting out of modal
*/
escapeKey: function () {
return;
}
}
},
options: {},
notificationWindow: null
},

Expand All @@ -41,11 +32,32 @@ define([
this._super();
},

/**
* Configure ESC and TAB so user can't leave modal
* without selecting an option
*
* @returns {Object} Chainable.
*/
initModalEvents: function () {
this._super();
//Don't allow ESC key to close modal
this.options.keyEventHandlers.escapeKey = this.handleEscKey.bind(this);
//Restrict tab action to the modal
this.options.keyEventHandlers.tabKey = this.handleTabKey.bind(this);

return this;
},

/**
* Once the modal is opened it hides the X
*/
onOpened: function () {
$('.modal-header button.action-close').hide();
$('.modal-header button.action-close').attr('disabled', true).hide();

this.focusableElements = $(this.rootSelector).find('a[href], button:enabled');
this.firstFocusableElement = this.focusableElements[0];
this.lastFocusableElement = this.focusableElements[this.focusableElements.length - 1];
this.firstFocusableElement.focus();
},

/**
Expand Down Expand Up @@ -104,11 +116,70 @@ define([
* Allows admin usage popup to be shown first and then new release notification
*/
openReleasePopup: function () {
var notifiModal = registry.get('release_notification.release_notification.notification_modal_1');
var notificationModalSelector = 'release_notification.release_notification.notification_modal_1';

if (analyticsPopupConfig.releaseVisible) {
notifiModal.initializeContentAfterAnalytics();
registry.get(notificationModalSelector).initializeContentAfterAnalytics();
}
},

/**
* Handle Tab and Shift+Tab key event
*
* Keep the tab actions restricted to the popup modal
* so the user must select an option to dismiss the modal
*/
handleTabKey: function (event) {
var modal = this,
KEY_TAB = 9;

/**
* Handle Shift+Tab to tab backwards
*/
function handleBackwardTab() {
if (document.activeElement === modal.firstFocusableElement ||
document.activeElement === $(modal.rootSelector)[0]
) {
event.preventDefault();
modal.lastFocusableElement.focus();
}
}

/**
* Handle Tab forward
*/
function handleForwardTab() {
if (document.activeElement === modal.lastFocusableElement) {
event.preventDefault();
modal.firstFocusableElement.focus();
}
}

switch (event.keyCode) {
case KEY_TAB:
if (modal.focusableElements.length === 1) {
event.preventDefault();
break;
}

if (event.shiftKey) {
handleBackwardTab();
break;
}
handleForwardTab();
break;
default:
break;
}
},

/**
* Handle Esc key
*
* Esc key should not close modal
*/
handleEscKey: function (event) {
event.preventDefault();
}
}
);
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Analytics/Test/Mftf/Data/UserRoleData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="adminNoReportRole" type="user_role">
<data key="all">0</data>
<data key="rolename" unique="suffix">noreport</data>
<data key="current_password">123123q</data>
<array key="resource">
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6e36d5e

Please sign in to comment.