Commit 2c1f0a9
committed
resolves #4090 ([FR-1342](https://lablup.atlassian.net/browse/FR-1342))
### Add file/folder rename feature to file explorer
This PR adds the ability to rename files and folders in the file explorer. The implementation includes:
1. Created a new `EditableName` component that handles file/folder renaming with validation:
- Prevents duplicate names
- Handles file extension changes with confirmation
- Handles folder merging with confirmation
2. Added a new `BAILink` component to the UI library that provides consistent styling for links with hover states, icons, and ellipsis tooltips
3. Enhanced permission checking to disable rename functionality when the user doesn't have write permissions
4. Updated all locale files with new translation strings for rename-related messages and errors
The file explorer now allows users to click the edit icon next to file/folder names to rename them, with appropriate validation and confirmation dialogs to prevent accidental data loss.
### Expected Logic
Modify File
1. If a duplicate name exists, the name will not be modified and a failure message will be printed.
2. If you change the file extension, a confirmation modal will appear and you must click the OK button on the confirmation modal to modify the name, including the extension.
Modify Folder
1. If the name you are renaming already exists, a confirmation modal will appear, and clicking the OK button will move the modified folder inside it.
**Checklist:**
- [ ] Documentation
- [ ] Minium required manager version
- [ ] Specific setting for review (eg., KB link, endpoint or how to setup)
- [ ] Minimum requirements to check during review
- [ ] Test case(s) to demonstrate the difference of before/after
[FR-1342]: https://lablup.atlassian.net/browse/FR-1342?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent c39c167 commit 2c1f0a9
File tree
49 files changed
+709
-298
lines changed- packages/backend.ai-ui
- src
- components
- baiClient/FileExplorer
- provider/BAIClientProvider
- locale
- react
- src
- components
- Chat
- ComputeSessionNodeItems
- hooks
- pages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+709
-298
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
Lines changed: 59 additions & 93 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 18 | + | |
| 19 | + | |
26 | 20 | | |
27 | 21 | | |
28 | 22 | | |
29 | 23 | | |
| 24 | + | |
30 | 25 | | |
31 | 26 | | |
32 | 27 | | |
33 | 28 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 29 | | |
47 | 30 | | |
48 | 31 | | |
| |||
71 | 54 | | |
72 | 55 | | |
73 | 56 | | |
74 | | - | |
75 | | - | |
76 | 57 | | |
77 | 58 | | |
78 | 59 | | |
| |||
103 | 84 | | |
104 | 85 | | |
105 | 86 | | |
| 87 | + | |
106 | 88 | | |
| 89 | + | |
| 90 | + | |
107 | 91 | | |
108 | 92 | | |
109 | 93 | | |
110 | 94 | | |
111 | 95 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 96 | | |
145 | 97 | | |
146 | 98 | | |
147 | 99 | | |
148 | 100 | | |
149 | | - | |
| 101 | + | |
150 | 102 | | |
151 | 103 | | |
152 | 104 | | |
| |||
201 | 153 | | |
202 | 154 | | |
203 | 155 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
212 | 169 | | |
213 | 170 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
242 | 175 | | |
243 | 176 | | |
244 | 177 | | |
245 | | - | |
| 178 | + | |
246 | 179 | | |
247 | 180 | | |
248 | 181 | | |
| |||
284 | 217 | | |
285 | 218 | | |
286 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
287 | 252 | | |
288 | 253 | | |
289 | 254 | | |
| |||
309 | 274 | | |
310 | 275 | | |
311 | 276 | | |
| 277 | + | |
312 | 278 | | |
313 | 279 | | |
314 | 280 | | |
| |||
0 commit comments