[CCUBE-2188][GZ] refactor file upload - #1426
Conversation
There was a problem hiding this comment.
finding the split of renderModes into editingIds on the parent file list and currentMode on the child to be awkward, but will go with this
There was a problem hiding this comment.
did editingIds get removed? that's still needed to disable the sorting when at least 1 item is in edit mode
03551f0 to
c8b5e86
Compare
There was a problem hiding this comment.
did editingIds get removed? that's still needed to disable the sorting when at least 1 item is in edit mode
| const disableSave = | ||
| descriptionRequired && currentDescription.trim().length === 0; |
There was a problem hiding this comment.
nit: move below the section header
| sensors={sensors} | ||
| onDragEnd={handleDragEnd} | ||
| onDragStart={handleDragStart} | ||
| return ( |
There was a problem hiding this comment.
I think the original intention for separate rendering was to avoid initialising the dnd context and its listeners when it's not needed
| setEditingCount((prev) => | ||
| mode === "edit" ? prev + 1 : Math.max(0, prev - 1) | ||
| ); |
There was a problem hiding this comment.
this might not work if the fileItems prop updates separately; the count won't be removed?
33753ad to
2b30da4
Compare
Type of changes
Description of changes
FileListItem(display/error) andFileItemEdit(edit) into a single unified component that manages its own mode internallyFileListby removing mode-tracking state and replacing it with a simple predicateChecklist
Screenshots