Skip to content

Fix: Error message when deleting tree ranks that have associated nodes#5029

Open
realVinayak wants to merge 31 commits intomainfrom
issue-5025
Open

Fix: Error message when deleting tree ranks that have associated nodes#5029
realVinayak wants to merge 31 commits intomainfrom
issue-5025

Conversation

@realVinayak
Copy link
Contributor

@realVinayak realVinayak commented Jun 21, 2024

Taking over this old PR and finishing the fix. Marco Martinez

Fixes #5025

Previously you were able to delete Tree ranks with associated nodes through the tree def Items menu. Now these remove buttons are implemented as delete buttons and properly trigger a save blocker warning when needed.

Previous Behavior

previous.behavior-5025.mp4

Current behavior.

Screen.Recording.2026-01-08.at.2.03.22.PM.mov

Expected behavior for new ranks, unsaved ranks

Screen.Recording.2026-01-22.at.11.52.26.AM.mov

Checklist

  • Self-review the PR after opening it to make sure the changes look good
    and self-explanatory (or properly documented)
  • Add automated tests
  • Add relevant issue to release milestone

Testing instructions

  • Open tree definition in the tree viewer
  • Try deleting a tree rank which has associated nodes through the (by clicking on the - symbol, or by using the grid view trash button)
  • Verify that the save blocker dialog appears, and the page should only automatically refresh after the save button is pressed
  • Make sure save buttons on forms, record sets, attachment gallery, app resource editor, resource dialogs work as expected
  • create a new rank for the page, do not press save, and attempt to to delete it
  • Verify that no save blockers are present nor extra dialogue when removing unsaved ranks/ resources

Looks like usages assume that save was a success anyways
Triggered by d0933c6 on branch refs/heads/issue-5025
@realVinayak realVinayak requested a review from maxpatiiuk June 21, 2024 14:10
@realVinayak realVinayak added this to the 7.9.7 milestone Jul 3, 2024
@grantfitzsimmons grantfitzsimmons modified the milestones: 7.9.7, 7.9.8 Aug 21, 2024
@CarolineDenis CarolineDenis modified the milestones: 7.9.8, 7.9.9 Nov 6, 2024
@Iwantexpresso Iwantexpresso self-assigned this Jan 8, 2026
@Iwantexpresso Iwantexpresso changed the title Call handleSave only if save was a success Fix: Error message when deleting tree ranks that have associated nodes Jan 8, 2026
@Iwantexpresso Iwantexpresso marked this pull request as ready for review January 8, 2026 20:27
@Iwantexpresso Iwantexpresso marked this pull request as draft January 8, 2026 20:28
@Iwantexpresso Iwantexpresso requested review from a team and removed request for a team January 8, 2026 20:35
@Iwantexpresso Iwantexpresso modified the milestones: 7.9.9, 7.12.0 Jan 22, 2026
@grantfitzsimmons grantfitzsimmons requested review from maxpatiiuk and removed request for maxpatiiuk January 22, 2026 19:31
@Iwantexpresso Iwantexpresso marked this pull request as ready for review January 22, 2026 19:32
@Iwantexpresso Iwantexpresso requested review from a team January 22, 2026 19:33
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • Verify that the save blocker dialog appears, and the page should only automatically refresh after the save button is pressed
  • Make sure save buttons on forms, record sets, attachment gallery, app resource editor, resource dialogs work as expected
  • Verify that no save blockers are present nor extra dialogue when removing unsaved ranks/ resources

  • Save blocker looks good!
01-26_12.25.mp4
  • Only problem I ran into is that you get an error when deleting an empty rank in the middle of a tree, no error occurs when it's at the end of a tree or when opening and deleting just a specific rank. Not sure if it's related to this PR or not but it is different than the behavior in main so I wanted to mention it.

Error:

01-26_12.35.mp4

Examples with no error:

01-26_12.38.mp4
01-26_12.39.mp4

Main:

01-26_12.43.mp4

@CarolineDenis CarolineDenis requested a review from a team January 27, 2026 14:16
@CarolineDenis CarolineDenis modified the milestones: 7.12.0, 7.13.0 Jan 27, 2026
@Iwantexpresso
Copy link
Contributor

  • Verify that the save blocker dialog appears, and the page should only automatically refresh after the save button is pressed

  • Make sure save buttons on forms, record sets, attachment gallery, app resource editor, resource dialogs work as expected

  • Verify that no save blockers are present nor extra dialogue when removing unsaved ranks/ resources

  • Save blocker looks good!

01-26_12.25.mp4

  • Only problem I ran into is that you get an error when deleting an empty rank in the middle of a tree, no error occurs when it's at the end of a tree or when opening and deleting just a specific rank. Not sure if it's related to this PR or not but it is different than the behavior in main so I wanted to mention it.

Error:

01-26_12.35.mp4

Examples with no error:

01-26_12.38.mp4

01-26_12.39.mp4

Main:

01-26_12.43.mp4

Hi Elizabeth thank you for catching that!, the error still occurs in main but the difference in behavior is that the page does not automatically reload immediately anymore. From what I understand that error happens wherever there is a many to one relationship within the database. it has been. bit since I've started this pr so went back and looked at it and yeah its a real bug but I'm not unsure if it should still be included in this pr specifically now. as this pr addresses the request to add save blockers to each remove button. I think its on me for forgetting about the bug itself during my dev time on this tho, my apologies.

Copy link
Collaborator

@bhumikaguptaa bhumikaguptaa left a comment

Choose a reason for hiding this comment

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

  • Verify that the save blocker dialog appears, and the page should only automatically refresh after the save button is pressed
  • Make sure save buttons on forms, record sets, attachment gallery, app resource editor, resource dialogs work as expected
  • Verify that no save blockers are present nor extra dialogue when removing unsaved ranks/ resources

Save blocker works as expected.

@CarolineDenis CarolineDenis modified the milestones: 7.13.0, 7.12.1 Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Error message when deleting tree ranks that have associated nodes

7 participants