Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions client/src/boot/BootRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ class BootRoutes {
lastPath = window.location.pathname;
}

// When navigating from a non-react route to a react route, we must
// completely load the page for react's router to kick in.
if (ctx.state?.path && this.matchesReactRoute(ctx.state.path)) {
// Add the current path to the history so we can go back to it
history.pushState({}, '');
// Navigate to the new path
window.location = ctx.state.path;
return;
}

// Verify that this is a true state change. E.g. not a hash change.
// This emulates behaviour of old html history.js
const forceReload = ctx.state && ctx.state.__forceReload;
Expand Down
12 changes: 10 additions & 2 deletions tests/behat/features/admin-routing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ Feature: Single-page routing works as expected
So that I can get to the areas I want to get to

Background:
Given I have a config file "fake-asset-admin.yml"
Given the "Company" "Company A" with "Category"="Other"
And the "Employee" "Employee A" with "Email"="test@example.com" and "Biography"="<p>some content here</p>" and "DateOfBirth"="1990-06-09"
And the "group" "EDITOR" has permissions "Access to 'Test ModelAdmin' section" and "TEST_DATAOBJECT_EDIT"
# Page access is required to see the Company object
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Test ModelAdmin' section" and "CMS_ACCESS_AssetAdmin" and "TEST_DATAOBJECT_EDIT"
And I am logged in as a member of "EDITOR" group

Scenario: Non-react sections correctly route to react sections
When I go to "/admin/test"
Then I click "Company A" in the "#Form_EditForm" element
And I click "behat link to file" in the "#Form_ItemEditForm" element
Then I should see "Files" in the ".cms-content.AssetAdmin .breadcrumb__container" element

Scenario: Admin sections can start with the same string as a react section
Given I have a config file "fake-asset-admin.yml"
When I go to "/admin/assets-test"
Then I should see "Add Company"
1 change: 0 additions & 1 deletion tests/behat/features/gridfield-inline-delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Feature: GridField inline delete
And I go to "/admin/test"

Scenario: I can see toast message when I successfully delete a record by clicking the Delete button in action menu
Given I take a screenshot after every step
Copy link
Member Author

Choose a reason for hiding this comment

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

This shouldn't be there so cleaning that up while I'm here.

Noticed it because I was copying some of the background from this feature.

When I click "Company C" in the "#Form_EditForm" element
And I click "Employees" in the ".ui-tabs-nav" element
Then I should see "Employee A" in the "#Form_ItemEditForm_Employees" element
Expand Down
Loading