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
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export class NotebookActionBarComponent extends MessageListenersManager implemen

deleteNote() {
this.messageService.deleteNote(this.note.id);
this.router.navigate(['/']);
}

moveNoteToTrash() {
Expand Down
6 changes: 4 additions & 2 deletions zeppelin-web-angular/src/app/services/note-status.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ export class NoteStatusService {
}

isTrash(note: Exclude<Note['note'], undefined>) {
// TODO(hsuanxyz) https://github.com/apache/zeppelin/pull/3365/files
return note.name.split('/')[1] === this.TRASH_FOLDER_ID;
// Detect trash by note.path, not note.name: the trash folder is the second
// path segment (see apache/zeppelin#3365), and since ZEPPELIN-4041 note.name
// holds only the last path segment. Mirrors NoteListService.
return note.path.split('/')[1] === this.TRASH_FOLDER_ID;
}

viewOnly(note: Exclude<Note['note'], undefined>): boolean {
Expand Down
Loading