Skip to content

Conversation

@myabc
Copy link
Contributor

@myabc myabc commented Jan 12, 2026

Ticket

https://community.openproject.org/wp/70480

This pull request removes the unused ConfirmationDialogHelper Ruby module and simplifies the Angular ConfirmDialogService by eliminating legacy Rails form augmentation logic.

Code cleanup and modernization:

  • Removed the entire ConfirmationDialogHelper Ruby module, which was previously used to render confirmation dialogs for Rails forms but is now obsolete.
  • In ConfirmDialogService (confirm-dialog.service.ts), removed the logic for listening to Rails form submissions and augmenting them with confirmation dialogs, as this integration is no longer needed. [1] [2]
  • Switched to using Angular's inject function for dependency injection in ConfirmDialogService, further simplifying the service.
  • Improved error handling in the confirm method by rejecting with an Error object when the dialog is cancelled, instead of a bare rejection.

Screenshots

There should be no visual changes.

What approach did you choose and why?

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

myabc added 2 commits January 12, 2026 18:11
Removes unused "form augumentation". This has largely been replaced by
the use of async dialogs.
@myabc myabc changed the title Remove unused ConfirmDialogService form augmentation, ConfirmationDialogHelper [#70480] Remove unused ConfirmDialogService form augmentation, ConfirmationDialogHelper Jan 12, 2026
@myabc myabc added maintenance javascript Pull requests that update Javascript code ruby Pull requests that update Ruby code needs review labels Jan 12, 2026
@myabc myabc marked this pull request as ready for review January 12, 2026 21:14
Copilot AI review requested due to automatic review settings January 12, 2026 21:14
@github-actions
Copy link

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request removes obsolete code related to Rails form confirmation dialogs. The ConfirmationDialogHelper Ruby module and the associated form augmentation logic in ConfirmDialogService are no longer used and have been safely removed.

Changes:

  • Removed entire ConfirmationDialogHelper Ruby module that was used for Rails form confirmation dialogs
  • Removed legacy Rails form submission listener and augmentation logic from ConfirmDialogService
  • Modernized ConfirmDialogService to use Angular's inject() function for dependency injection
  • Improved error handling to reject with proper Error object instead of bare rejection

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
app/helpers/confirmation_dialog_helper.rb Deleted unused helper module that provided augmented_confirmation_dialog method
frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.service.ts Removed constructor with form submission listener, switched to inject() DI, improved error handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code maintenance needs review ruby Pull requests that update Ruby code

Development

Successfully merging this pull request may close these issues.

2 participants