File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed
Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,16 @@ class BootRoutes {
173173 lastPath = window . location . pathname ;
174174 }
175175
176+ // When navigating from a non-react route to a react route, we must
177+ // completely load the page for react's router to kick in.
178+ if ( ctx . state ?. path && this . matchesReactRoute ( ctx . state . path ) ) {
179+ // Add the current path to the history so we can go back to it
180+ history . pushState ( { } , '' ) ;
181+ // Navigate to the new path
182+ window . location = ctx . state . path ;
183+ return ;
184+ }
185+
176186 // Verify that this is a true state change. E.g. not a hash change.
177187 // This emulates behaviour of old html history.js
178188 const forceReload = ctx . state && ctx . state . __forceReload ;
Original file line number Diff line number Diff line change @@ -5,11 +5,19 @@ Feature: Single-page routing works as expected
55 So that I can get to the areas I want to get to
66
77 Background :
8- Given I have a config file "fake-asset-admin.yml "
8+ Given the "Company" "Company A" with "Category" = "Other "
99 And the "Employee" "Employee A" with "Email" ="test@example.com" and "Biography" ="<p>some content here</p>" and "DateOfBirth" ="1990-06-09"
10- And the "group" "EDITOR" has permissions "Access to 'Test ModelAdmin' section" and "TEST_DATAOBJECT_EDIT"
10+ And the "group" "EDITOR" has permissions "Access to 'Test ModelAdmin' section" and "CMS_ACCESS_AssetAdmin" and " TEST_DATAOBJECT_EDIT"
1111 And I am logged in as a member of "EDITOR" group
1212
13+ Scenario : Non-react sections correctly route to react sections
14+ When I go to "/admin/test"
15+ Then I wait for 2 seconds
16+ Then I click "Company A" in the "#Form_EditForm" element
17+ And I click "behat link to file" in the "#Form_ItemEditForm" element
18+ Then I should see "Files" in the ".cms-content.AssetAdmin .breadcrumb__container" element
19+
1320 Scenario : Admin sections can start with the same string as a react section
21+ Given I have a config file "fake-asset-admin.yml"
1422 When I go to "/admin/assets-test"
1523 Then I should see "Add Company"
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ Feature: GridField inline delete
1616 And I go to "/admin/test"
1717
1818 Scenario : I can see toast message when I successfully delete a record by clicking the Delete button in action menu
19- Given I take a screenshot after every step
2019 When I click "Company C" in the "#Form_EditForm" element
2120 And I click "Employees" in the ".ui-tabs-nav" element
2221 Then I should see "Employee A" in the "#Form_ItemEditForm_Employees" element
You can’t perform that action at this time.
0 commit comments