Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the wrong behavior for a prompt modal when a user clicks on the modal overlay #27399

Conversation

serhiyzhovnir
Copy link

Description (*)

The prompt modal performs the confirm action when a user clicks on the modal overlay.
This PR fixes this issue and adds the false argument for closeModal() method when a user clicks on the modal overlay.

Related Pull Requests

The issue starts reproducing after the changes from this 6167b0c commit.

Fixed Issues (if relevant)

  1. Confirm Save Preview is performed if click outside of the Search Adobe Stock when File Name window is opened adobe-stock-integration#1002: Confirm Save Preview is performed if click outside of the Search Adobe Stock when File Name window is opened

Manual testing scenarios (*)

The manual testing scenarios and how to reproduce this issue is described in this issue magento/adobe-stock-integration#1002.

Also, it could be checked quickly with the following JS code via a browser console.

require(['jquery', 'Magento_Ui/js/modal/prompt'], function ($, prompt) {
    prompt({
        title: 'Prompt Title',
        content: $('.prompt-modal-content'),
        modalClass: 'prompt',
        value: 'Value by default',
        validation: true,
        promptField: '[data-role="promptField"]',
        attributesForm: {
            novalidate: 'novalidate',
            action: ''
        },
        actions: {
            always: function() {
                // do something when the modal is closed
            },
            confirm: function () {
                alert('Confirmation');
            },
            cancel: function () {
                // do something when the cancel button is clicked
            }
        }
    });

    jQuery('.prompt + .modals-overlay').click()
})

This code creates the Prompt popup and clicks on overlay.
In 2.4-develop you will see the alert with "Confirmation" that is triggered by the confirm action.

This issue is fixed in this PR and the prompt popup will be closed after clicking on the modal overlay.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Mar 23, 2020

Hi @serhiyzhovnir. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@nuzil
Copy link
Contributor

nuzil commented Mar 23, 2020

@magento give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @nuzil. Thank you for your request. I'm working on Magento instance for you

@nuzil nuzil self-assigned this Mar 23, 2020
@magento-engcom-team
Copy link
Contributor

Hi @nuzil, here is your new Magento instance.
Admin access: https://pr-27399.instances.magento-community.engineering/admin_f275
Login: 1e782097 Password: f59789959763
Instance will be terminated in up to 3 hours.

Copy link
Contributor

@nuzil nuzil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @serhiyzhovnir
Please have a look at failed test, looks like it caused by your change:

[NO TESTCASEID]: Admin should be able to cancel and close 'create folder' modal window using ESC key and to add image to new folder (using enter key) for WYSIWYG content of Block

@sivaschenko
Copy link
Member

Static test failure is not related to the changes in the pull request.

The same functional test is currently failing on other pull requests as well (i.e. #25360 Allure Report) so I assume it's not caused by the changes in this PR as well

@sivaschenko
Copy link
Member

@serhiyzhovnir could you cover the changes by jasmine or MFTF test?

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-7195 has been created to process this Pull Request
✳️ @sivaschenko, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@sivaschenko sivaschenko added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Mar 24, 2020
@engcom-Bravo engcom-Bravo self-assigned this Mar 25, 2020
@magento-engcom-team
Copy link
Contributor

Hi @nuzil, thank you for the review.
ENGCOM-7195 has been created to process this Pull Request

@engcom-Bravo
Copy link
Contributor

✔️ QA Passed

@engcom-Echo engcom-Echo added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Apr 1, 2020
@engcom-Echo
Copy link
Contributor

@magento run Functional Tests EE

@engcom-Echo
Copy link
Contributor

Failed integration tests not related to the changes in this PR

magento-engcom-team pushed a commit that referenced this pull request Apr 2, 2020
@magento-engcom-team magento-engcom-team merged commit 4fb6a23 into magento:2.4-develop Apr 2, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 2, 2020

Hi @serhiyzhovnir, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Ui Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants