Skip to content

Commit 4b82800

Browse files
Merge pull request #131 from magento-cia/pre-release-develop-sync-12122023
Pre release develop sync 12122023
2 parents 156370e + 8f476ac commit 4b82800

File tree

12 files changed

+213
-19
lines changed

12 files changed

+213
-19
lines changed

.github/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ For more detailed information on contribution please read our [beginners guide](
1919
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
2020
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/2.3-develop/.github/PULL_REQUEST_TEMPLATE.md) for more information.
2121
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
22-
3. PRs which include new logic or new features must be submitted along with:
23-
* Unit/integration test coverage
24-
* Proposed [documentation](https://devdocs.magento.com) updates. Documentation contributions can be submitted via the [devdocs GitHub](https://github.com/magento/devdocs).
25-
4. For larger features or changes, please [open an issue](https://github.com/magento/magento2/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
26-
5. All automated tests must pass (all builds on [Travis CI](https://travis-ci.org/magento/magento2) must be green).
22+
5. PRs which include new logic or new features must be submitted along with:
23+
* Unit/integration test coverage
24+
* Proposed [documentation](https://developer.adobe.com/commerce) updates. Use feedback buttons __Edit in GitHub__ and __Log an issue__ at the top of a relevant topic.
25+
6. For larger features or changes, please [open an issue](https://github.com/magento/magento2/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
26+
7. All automated tests must pass (all builds on [Travis CI](https://travis-ci.org/magento/magento2) must be green).
2727

2828
## Contribution process
2929

ReCaptchaFrontendUi/view/frontend/web/js/reCaptcha.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,14 @@ define(
7373
* @param {String} token
7474
*/
7575
reCaptchaCallback: function (token) {
76+
var submitButton;
77+
7678
if (this.getIsInvisibleRecaptcha()) {
7779
this.tokenField.value = token;
80+
submitButton = this.$parentForm.find('button:not([type]), [type=submit]');
81+
if (submitButton.length) { //eslint-disable-line max-depth
82+
submitButton.attr('disabled', false);
83+
}
7884
this.$parentForm.submit();
7985
}
8086
},
@@ -155,7 +161,13 @@ define(
155161

156162
if (this.getIsInvisibleRecaptcha() && parentForm.length > 0) {
157163
parentForm.submit(function (event) {
164+
var submitButton;
165+
158166
if (!this.tokenField.value) {
167+
submitButton = this.$parentForm.find('button:not([type]), [type=submit]');
168+
if (submitButton.length) { //eslint-disable-line max-depth
169+
submitButton.attr('disabled', true);
170+
}
159171
// eslint-disable-next-line no-undef
160172
grecaptcha.execute(widgetId);
161173
event.preventDefault(event);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
AdminLoginActionGroup
2+
AdminLogoutActionGroup
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
File "/var/www/html/app/code/Magento/ReCaptchaUser/Test/Mftf/Test/AdminLoginReCaptchaFunctionalityTest.xml"
3+
contains entity references that violate dependency constraints:
4+
5+
AdminLoginActionGroup from module(s): magento/module-admin-analytics, magento/module-backend, magento/module-two-factor-auth
6+
AdminLogoutActionGroup from module(s): magento/module-backend
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* ADOBE CONFIDENTIAL
5+
*
6+
* Copyright 2023 Adobe
7+
* All Rights Reserved.
8+
*
9+
* NOTICE: All information contained herein is, and remains
10+
* the property of Adobe and its suppliers, if any. The intellectual
11+
* and technical concepts contained herein are proprietary to Adobe
12+
* and its suppliers and are protected by all applicable intellectual
13+
* property laws, including trade secret and copyright laws.
14+
* Dissemination of this information or reproduction of this material
15+
* is strictly forbidden unless prior written permission is obtained
16+
* from Adobe.
17+
*/
18+
-->
19+
20+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
22+
<actionGroup name="AdminSaveUserRoleActionGroup">
23+
<annotations>
24+
<description>Merges with CE actionGroup. Adds steps to enable the 2FA ACL rule when creating a User Role.</description>
25+
</annotations>
26+
<waitForElementVisible selector="{{AdminEditRoleResourcesSection.resourceCheckboxLink('Magento_TwoFactorAuth::tfa', 'Two Factor Auth')}}" stepKey="waitFor2FACheckboxVisible" before="check2FAIfNotAlreadyChecked"/>
27+
<conditionalClick selector="{{AdminEditRoleResourcesSection.resourceCheckboxLink('Magento_TwoFactorAuth::tfa', 'Two Factor Auth')}}" dependentSelector="{{AdminEditRoleResourcesSection.resourceCheckbox('Magento_TwoFactorAuth::tfa')}}" visible="false" stepKey="check2FAIfNotAlreadyChecked" before="see2FAChecked"/>
28+
<seeElement selector="{{AdminEditRoleResourcesSection.resourceCheckbox('Magento_TwoFactorAuth::tfa')}}" stepKey="see2FAChecked" before="clickSaveRoleButton"/>
29+
</actionGroup>
30+
</actionGroups>

TwoFactorAuth/Test/Mftf/Test/AdminReviewOrderWithReportsPermissionTest.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
99
<test name="AdminReviewOrderWithReportsPermissionTest">
1010
<before>
11-
<actionGroup ref="AdminChooseUserRoleResourceActionGroup" before="saveRole" stepKey="enableTfa">
12-
<argument name="resourceId" value="Magento_TwoFactorAuth::tfa"/>
13-
<argument name="resourceName" value="Two Factor Auth"/>
14-
</actionGroup>
11+
<comment userInput="BIC workaround" before="saveRole" stepKey="enableTfa"/>
1512
</before>
1613
</test>
1714
</tests>

TwoFactorAuth/Test/Mftf/Test/AdminUpdateUserRoleTest.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
<severity value="AVERAGE"/>
1616
</annotations>
1717
<before>
18-
<actionGroup ref="AdminChooseUserRoleResourceActionGroup" before="saveNewRole" stepKey="enableTfa">
19-
<argument name="resourceId" value="Magento_TwoFactorAuth::tfa"/>
20-
<argument name="resourceName" value="Two Factor Auth"/>
21-
</actionGroup>
18+
<comment userInput="BIC workaround" before="saveNewRole" stepKey="enableTfa"/>
2219
</before>
2320
</test>
2421
</tests>

TwoFactorAuth/view/adminhtml/web/js/u2fkey/auth.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ define([
8484
*/
8585
waitForTouch: function () {
8686
this.idle(false);
87+
if (!navigator.credentials) {
88+
this.currentStep('no-webauthn');
89+
return;
90+
}
8791
navigator.credentials.get({
8892
publicKey: this.authenticateData.credentialRequestOptions
8993
})
@@ -158,8 +162,8 @@ define([
158162
_onCredentialError: function (u2fError) {
159163
this.idle(true);
160164

161-
if (['AbortError', 'NS_ERROR_ABORT', 'NotAllowedError'].indexOf(u2fError.name) === -1) {
162-
error.display($t('Unable to register your device'));
165+
if (['AbortError', 'NS_ERROR_ABORT'].indexOf(u2fError.name) === -1) {
166+
error.display($t(u2fError.message));
163167
}
164168
}
165169
});

TwoFactorAuth/view/adminhtml/web/js/u2fkey/configure.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ define([
7878
*/
7979
waitForTouch: function () {
8080
this.idle(false);
81+
if (!navigator.credentials) {
82+
this.currentStep('no-webauthn');
83+
return;
84+
}
8185
navigator.credentials.create({
8286
publicKey: this.registerData.publicKey
8387
})
@@ -150,8 +154,8 @@ define([
150154
_onCredentialError: function (u2fError) {
151155
this.idle(true);
152156

153-
if (['AbortError', 'NS_ERROR_ABORT', 'NotAllowedError'].indexOf(u2fError.name) === -1) {
154-
error.display($t('Unable to register your device'));
157+
if (['AbortError', 'NS_ERROR_ABORT'].indexOf(u2fError.name) === -1) {
158+
error.display($t(u2fError.message));
155159
}
156160
}
157161
});

TwoFactorAuth/view/adminhtml/web/template/u2fkey/auth.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<fieldset class="admin__fieldset">
1010
<legend class="admin__legend">
1111
<span translate="'2FA - U2F key verification'"></span>
12-
</legend><br/>
12+
</legend><br>
1313
<div class="tfa-u2f-touch-key">
1414
<h3 translate="'Plug in your U2F key and follow instructions'"></h3>
1515
<div visible="$data.idle" class="tfa-u2f-try-again">
@@ -27,6 +27,10 @@ <h3 translate="'Plug in your U2F key and follow instructions'"></h3>
2727
</div>
2828
<div translate="'Redirecting to Magento Admin Panel...'"></div>
2929
</div>
30+
<div visible='currentStep() === "no-webauthn"'
31+
translate="'Error! Your browser does not support WebAuthn or you are not using a secure connection'"
32+
>
33+
</div>
3034
<div visible='$data.loading' class="tfa-waitbox">
3135
<div data-role="spinner">
3236
<div class="spinner">

0 commit comments

Comments
 (0)