Commit 4021aac
authored
fix: Handle deletion of unsaved copied file in NotebookPanel (#1557)
* Previously, duplicating a notebook file and then trying to delete it
without saving it first will cause an error to occur
* Added a `fileExists` function to `FileUtils` to handle this check
* Added a `getUniqueCopyFileName` function to `FileUtils`
* Behaviour of copying a file from `NotebookPanel` changed from opening
an unsaved copy of the file to duplicating the file in `FileStorage`
first
* Related to #1359
#### Testing Instructions:
* Open a file in the notebook panel
* Copy the opened file by using the 'Copy File' option in the overflow
menu
* Delete the file by using the overflow menu (No error should occur)
* Repeat the same steps but copy the file by right clicking the file in
the file explorer
* Delete the copied file again, this time it should also disappear from
the file explorer
---------
Co-authored-by: georgecwan <georgecwan@users.noreply.github.com>1 parent 327bcb6 commit 4021aac
3 files changed
Lines changed: 61 additions & 20 deletions
File tree
- packages
- dashboard-core-plugins/src/panels
- file-explorer/src
Lines changed: 4 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
182 | 172 | | |
183 | 173 | | |
184 | 174 | | |
| |||
Lines changed: 26 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
| 684 | + | |
| 685 | + | |
685 | 686 | | |
686 | 687 | | |
687 | | - | |
688 | 688 | | |
689 | 689 | | |
690 | | - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
691 | 694 | | |
692 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
693 | 709 | | |
694 | 710 | | |
695 | 711 | | |
696 | 712 | | |
697 | 713 | | |
698 | 714 | | |
699 | 715 | | |
700 | | - | |
| 716 | + | |
701 | 717 | | |
702 | 718 | | |
703 | 719 | | |
| |||
708 | 724 | | |
709 | 725 | | |
710 | 726 | | |
711 | | - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
712 | 732 | | |
713 | 733 | | |
714 | 734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
19 | 37 | | |
20 | 38 | | |
21 | 39 | | |
| |||
80 | 98 | | |
81 | 99 | | |
82 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
83 | 114 | | |
84 | 115 | | |
85 | 116 | | |
| |||
0 commit comments