[ZEPPELIN-6550] Fix trash detection in note view so trashed notes can be permanently deleted#5336
Merged
Merged
Conversation
Member
|
The CI failures here look mostly like a stale base — this branch is ~20 commits behind |
… be permanently deleted
NoteStatusService.isTrash used note.name.split('/')[1], but since
ZEPPELIN-4041 the backend sets Note.name to the last path segment only,
so that index is always undefined and isTrash always returned false. The
full path lives in note.path, which NoteListService already uses.
As a result, opening a note from the Trash showed "Move to trash"
(re-nesting it into /~Trash/~Trash/...) instead of "Remove permanently",
and the cron scheduler button stayed enabled for trashed notes.
- Use note.path instead of note.name in isTrash (mirrors NoteListService).
- Navigate back to '/' after permanent delete, matching moveNoteToTrash,
so the view leaves the now-deleted note instead of re-fetching it (404).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Thanks for catching that! You're right, the base was stale. I've rebased onto the latest |
Member
|
Merged into master (de9f896). |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is this PR for?
In the new Angular UI, opening a note that lives in the Trash showed the normal Move to trash action instead of Remove permanently, so a trashed note could not be permanently deleted from the note view — confirming the action re-nested it deeper into Trash (
/~Trash/~Trash/...). The cron scheduler button also stayed enabled for trashed notes.Root cause:
NoteStatusService.isTrashusednote.name.split('/')[1]. Since ZEPPELIN-4041 the backend setsNote.nameto the last path segment only (no/), so that index is alwaysundefinedandisTrashalways returnedfalse. The full path lives innote.path, whichNoteListService.setNotesalready uses correctly.This PR:
note.pathinstead ofnote.nameinisTrash(mirrorsNoteListService)./after a permanent delete, matchingmoveNoteToTrash, so the view leaves the now-deleted note instead of re-fetching it and surfacing a 404.What type of PR is it?
Bug Fix
What is the Jira issue?
How should this be tested?
cd zeppelin-web-angular && npm run lintQuestions:
🤖 Generated with Claude Code