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

Fix duplicated Modal code when loaded using AJAX #1771

Merged
merged 2 commits into from
Apr 10, 2022

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Apr 10, 2022

discovered during investigation of #1732

wrapping demos/data-action/jsactions-panel.php RightPanel demo works well even if wrapped inside Loader

duplicated code/ID is now tested in Behat after every step

  Scenario:                                        # tests-behat/callback.feature:12
    Given I am on "_unit-test/callback-nested.php" # Behat\MinkExtension\Context\MinkContext::visit()
    Then I press button "Load1"                    # Atk4\Ui\Behat\Context::iPressButton()
    Then I should see "Loader-1"                   # Behat\MinkExtension\Context\
                                                     MinkContext::assertPageContainsText()
    Then I press button "Load2"                    # Atk4\Ui\Behat\Context::iPressButton()
    │
    ╳  Exception: Page contains elements with duplicate ID:
         "atk_icon", "_ea0591c61f4b3107cf54838053b3adc3___useraction_modalexecutor",
         "_395f2da8a6a5c80767b0042937355326__tion_modalexecutor_loader",
         "_5fc141f467ea245de8f9515e9dba36b5__modalexecutor_loader_view",
         "_54e1cbc5bc6bbbb943063a6b5646b718__action_modalexecutor_view",
         "_59434c8e5978a6c002cbfdf93e3567b5__modalexecutor_view_button",
         "_365d92f1164005c843c56306fed35810__dalexecutor_view_button_2",
         "_365d92f1164005c843c56306fed35810__dalexecutor_view_button_3",
         "_f0a382c18a3f238d2ca01ecfe1d8bfac__seraction_modalexecutor_2",
         "_10ceb07386588d34599519a11fd9c342__on_modalexecutor_2_loader",
         "_d767499edd1aa3fc1207a1e884d12391__dalexecutor_2_loader_view",
         "_451b4b9ca5c98b9c0e30300079193a29__tion_modalexecutor_2_view",
         "_e35de19f435359fb1223eb830dbe63b5__dalexecutor_2_view_button",
         "_8b700a87c50e78df6714556cb335e1ca__lexecutor_2_view_button_2",
         "_8b700a87c50e78df6714556cb335e1ca__lexecutor_2_view_button_3"
       in src/Behat/Context.php:190
    ╳  Stack trace:
    ╳  #0 src/Behat/Context.php(67): Atk4\Ui\Behat\Context->assertNoInvalidNorDuplicateId()
    │
    └─ @AfterStep # Atk4\Ui\Behat\Context::waitUntilLoadingAndAnimationFinished()

@mvorisek mvorisek force-pushed the fix_nested_modal__base_for_diff branch from 2b6226d to 197213e Compare April 10, 2022 13:00
@mvorisek mvorisek force-pushed the fix_modal_in_callback branch 9 times, most recently from 6029ba9 to 2b801bb Compare April 10, 2022 17:28
@mvorisek mvorisek changed the title Fix Modal in Callback Fix duplicated Modal code when loaded using AJAX Apr 10, 2022
@mvorisek mvorisek changed the base branch from fix_nested_modal__base_for_diff to develop April 10, 2022 17:32
@mvorisek mvorisek marked this pull request as ready for review April 10, 2022 17:35
@mvorisek mvorisek merged commit 77a128a into develop Apr 10, 2022
@mvorisek mvorisek deleted the fix_modal_in_callback branch April 10, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant