-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[#75318] Upgrade Turbo to 8.0.23 with proper event types #21816
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
Merged
myabc
merged 18 commits into
dev
from
dependabot/npm_and_yarn/frontend/dev/hotwired/turbo-8.0.23
May 27, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d4f8313
Bump @hotwired/turbo from 8.0.20 to 8.0.23 in /frontend
dependabot[bot] 3615118
Bump @hotwired/turbo-rails from 8.0.20 to 8.0.23 in /frontend
myabc b88d237
Bump @types/hotwired__turbo from 8.0.5 to 8.0.10 in /frontend
myabc f3d6ec1
Fix for Adapter typings
myabc ebe7304
Remove no longer necessary typings from shims.d.ts
myabc 9841bb9
Replace CustomEvent with typed Turbo events
myabc 7cc9cb2
Fix ViewChild type for turbo-frame elements
myabc 45a9590
Ensure all Turbo global events are logged
myabc 75390bc
Remove unnecessary cast in Turbo global listeners
myabc ab3b74d
Patch Puma socket timeout failure
myabc 610d9f3
Use ProgressBar API directly in helpers
myabc ae45d89
Fix canceled work package edit back navigation
myabc 605e728
Avoid Turbo snapshot restore on canceled edit back
myabc b824be6
Use edit form state for Turbo leave guard
myabc 1ab4a16
Treat new edit forms as unsaved
myabc c776be1
Make WP query history filter checks idempotent
myabc 3866b33
Block Turbo restoration renders for active edit forms
myabc 2935a93
Stabilize cancel editing home navigation
myabc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
frontend/src/app/shared/components/fields/edit/edit-form/edit-form.component.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| //-- copyright | ||
| // OpenProject is an open source project management software. | ||
| // Copyright (C) the OpenProject GmbH | ||
| // | ||
| // This program is free software; you can redistribute it and/or | ||
| // modify it under the terms of the GNU General Public License version 3. | ||
| // | ||
| // OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
| // Copyright (C) 2006-2013 Jean-Philippe Lang | ||
| // Copyright (C) 2010-2013 the ChiliProject Team | ||
| // | ||
| // This program is free software; you can redistribute it and/or | ||
| // modify it under the terms of the GNU General Public License | ||
| // as published by the Free Software Foundation; either version 2 | ||
| // of the License, or (at your option) any later version. | ||
| // | ||
| // This program is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
| // | ||
| // You should have received a copy of the GNU General Public License | ||
| // along with this program; if not, write to the Free Software | ||
| // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| // | ||
| // See COPYRIGHT and LICENSE files for more details. | ||
| //++ | ||
|
|
||
| import { TestBed } from '@angular/core/testing'; | ||
| import { StateService, Transition, TransitionService } from '@uirouter/core'; | ||
| import * as Turbo from '@hotwired/turbo'; | ||
| import { ConfigurationService } from 'core-app/core/config/configuration.service'; | ||
| import { I18nService } from 'core-app/core/i18n/i18n.service'; | ||
| import { EditingPortalService } from 'core-app/shared/components/fields/edit/editing-portal/editing-portal-service'; | ||
| import { EditFieldHandler } from 'core-app/shared/components/fields/edit/editing-portal/edit-field-handler'; | ||
| import { EditFormRoutingService } from 'core-app/shared/components/fields/edit/edit-form/edit-form-routing.service'; | ||
| import { EditFormComponent } from 'core-app/shared/components/fields/edit/edit-form/edit-form.component'; | ||
| import { GlobalEditFormChangesTrackerService } from 'core-app/shared/components/fields/edit/services/global-edit-form-changes-tracker/global-edit-form-changes-tracker.service'; | ||
| import { vi } from 'vitest'; | ||
|
|
||
| describe('EditFormComponent', () => { | ||
| let onBeforeCallback:(transition:Transition) => unknown; | ||
|
|
||
| afterEach(() => { | ||
| vi.restoreAllMocks(); | ||
| }); | ||
|
|
||
| beforeEach(async () => { | ||
| await TestBed | ||
| .configureTestingModule({ | ||
| declarations: [ | ||
| EditFormComponent, | ||
| ], | ||
| providers: [ | ||
| { | ||
| provide: TransitionService, | ||
| useValue: { | ||
| onBefore: vi.fn((_criteria:unknown, callback:(transition:Transition) => unknown) => { | ||
| onBeforeCallback = callback; | ||
| return vi.fn(); | ||
| }), | ||
| }, | ||
| }, | ||
| { provide: ConfigurationService, useValue: { warnOnLeavingUnsaved: vi.fn().mockReturnValue(true) } }, | ||
| { provide: EditingPortalService, useValue: {} }, | ||
| { provide: StateService, useValue: {} }, | ||
| { provide: I18nService, useValue: { t: vi.fn().mockReturnValue('Leave edit mode?') } }, | ||
| { provide: EditFormRoutingService, useValue: { blockedTransition: vi.fn().mockReturnValue(true) } }, | ||
| { | ||
| provide: GlobalEditFormChangesTrackerService, | ||
| useValue: { | ||
| addToActiveForms: vi.fn(), | ||
| removeFromActiveForms: vi.fn(), | ||
| }, | ||
| }, | ||
| ], | ||
| }) | ||
| .compileComponents(); | ||
| }); | ||
|
|
||
| it('restores a canceled browser Back transition without navigating forward', () => { | ||
| const fixture = TestBed.createComponent(EditFormComponent); | ||
| const component = fixture.componentInstance; | ||
| const urlRouterUpdate = vi.fn(); | ||
| const transition = { | ||
| options: vi.fn().mockReturnValue({ source: 'url' }), | ||
| from: vi.fn().mockReturnValue({ name: 'work-packages.partitioned.split' }), | ||
| params: vi.fn().mockReturnValue({ workPackageId: '46' }), | ||
| router: { | ||
| stateService: { | ||
| href: vi.fn().mockReturnValue('/work_packages/details/46/overview'), | ||
| }, | ||
| urlRouter: { | ||
| update: urlRouterUpdate, | ||
| }, | ||
| }, | ||
| } as unknown as Transition; | ||
| const turboPush = vi.spyOn( | ||
| Turbo.session.history, | ||
| 'push', | ||
| ).mockImplementation(() => undefined); | ||
| const historyForward = vi.spyOn(window.history, 'forward'); | ||
| const confirm = vi.spyOn(window, 'confirm').mockReturnValue(false); | ||
| const cancel = vi.spyOn(component, 'cancel'); | ||
|
|
||
| component.activeFields = { | ||
| description: {} as EditFieldHandler, | ||
| }; | ||
|
|
||
| expect(onBeforeCallback(transition)).toBe(false); | ||
| expect(confirm).toHaveBeenCalledWith('Leave edit mode?'); | ||
| expect(cancel).not.toHaveBeenCalled(); | ||
| expect(turboPush).toHaveBeenCalledOnce(); | ||
| expect(turboPush.mock.calls[0][0].pathname).toBe('/work_packages/details/46/overview'); | ||
| expect(urlRouterUpdate).toHaveBeenCalledWith(true); | ||
| expect(historyForward).not.toHaveBeenCalled(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.