Repository navigation
Conversation
|
| "title": "Umbenennen", | ||
| "label": "Name" | ||
| }, | ||
| "renameModal": { |
There was a problem hiding this comment.
nit: why teh change of the key?
| "description": "{{itemName}} ya existe en esta carpeta. ¿Deseas reemplazarlo o mantener los dos?", | ||
| "multipleDescription": "Más de un elemento existe en esta localización. Deseas reemplazarlos o mantenerlos?", | ||
| "selectOption": "Selecciona una opción", | ||
| "description": "{{itemName}} ya existe en esta ubicación. ¿Deseas reemplazarlo por el que estás moviendo?", |
There was a problem hiding this comment.
it is like always gonna move all the items and it is not the only action. The modal also is used for uploading
| {remainingItemsCount > 1 && ( | ||
| <div className="flex items-center"> | ||
| <Checkbox checked={applyToAll} onClick={() => setApplyToAll((prev) => !prev)} /> | ||
| <p className="ml-2 select-none text-base font-medium text-gray-80"> | ||
| {translate('modals.alreadyExistsModal.applyToAll')} | ||
| </p> | ||
| </div> | ||
| )} |
There was a problem hiding this comment.
to keep element consistency maybe we should do that pressint the text also select/unselect the checkbox
| case 'upload' + 'replace': | ||
| await replaceAndUploadSingleItem(itemToUpload as IRoot | File, itemToReplace, group.destinationUuid); | ||
| break; | ||
| case 'upload' + 'skip': |
There was a problem hiding this comment.
move + skip option should exists or is only for upload option?
|
This pull request has been inactive for 30 days. Is it still in progress? If so, please leave a comment or make an update to keep it open. Otherwise, it will be closed automatically in 15 days. |
a8f0beb to
9ce4b8b
Compare
|
The folder-merge behavior (skip keeps the existing folder and uploads only the new content) is in the follow-up #2129, stacked on this branch |
| case 'move' + 'keep': | ||
| await keepAndMoveItems([itemToUpload as DriveItemData], group.destinationUuid); | ||
| dispatch(storageActions.popItemsToDelete([itemToUpload as DriveItemData])); | ||
| break; | ||
| case 'move' + 'replace': | ||
| await replaceAndMoveItems(pairs as CollisionPair<DriveItemData>[], group.destinationUuid); | ||
| dispatch(storageActions.popItemsToDelete([itemToUpload as DriveItemData])); | ||
| break; | ||
| case 'upload' + 'keep': | ||
| await keepAndUploadItems([itemToUpload as IRoot | File], group.destinationUuid); | ||
| break; | ||
| case 'upload' + 'replace': | ||
| await replaceAndUploadItems(pairs as CollisionPair<IRoot | File>[], group.destinationUuid); | ||
| break; | ||
| case 'upload' + 'skip': | ||
| case 'move' + 'skip': | ||
| break; | ||
| } |
There was a problem hiding this comment.
This is almost duplicated, please check it. All the logic for managing the different types of items and actions can be moved out of the component, add tests to all that logic.
| const movedItem = itemToUpload as DriveItemData; | ||
| return existingItems.find( | ||
| (existing) => | ||
| !!existing.isFolder === !!movedItem.isFolder && |
There was a problem hiding this comment.
I'm not sure if existingItems items have the isFolder field.
9ce4b8b to
41817e2
Compare
41817e2 to
890333f
Compare
7091a30 to
bce942f
Compare
890333f to
c327fed
Compare
dec3bf9 to
6c5fa93
Compare
8be0b5a to
c4b1f37
Compare
Covers single and multiple duplicates, per-item and apply-to-all skipping, non-conflicting files still uploading, and Replace trashing the matching file, with auth, bootstrap and Drive endpoints mocked so the specs run without a backend. Queued uploads are asserted through the task panel because Playwright cannot intercept the bridge in Firefox.
Adds a Skip option to the name-collision dialog, next to Replace and Keep both, for both upload and move collisions. Duplicates are resolved one at a time, and a new "Apply this action to all duplicates" checkbox handles them all at once, closing the dialog immediately and running the work in the background. The renameModal i18n block is renamed to alreadyExistsModal (the dialog does not rename anything), the description text is operation-neutral and the apply-to-all label toggles the checkbox.
Skipping a colliding folder upload now keeps the existing folder and uploads only the files and subfolders that do not exist yet, merging colliding subfolders recursively so the folder structure is preserved.
Covers keep both for files and folders, replacing a folder, merging a skipped folder into the existing one, replace, keep both and skip for moved files, and versioned replace. The Drive mock now tracks folders, folder creation, moves and a versioning flag; moves are driven by dispatching the HTML5 drag events on the row's drop zone.
c4b1f37 to
c947fa0
Compare
…restore-e2e [PB-6531]: e2e coverage for same-name restore collisions
…atch [PB-6531]: resolve same-name items within a move collision batch
…ge-on-skip [PB-6531]: merge folder uploads into the existing folder on skip
[PB-6531]: e2e coverage for the skip option in name collisions
afbfe83
into
fix/name-collision-matching-and-batching
|







Description
Stacked on #2148 (which sits on #2147 and #2146). Adds a Skip option to the name-collision dialog, next to Replace and Keep both, for both upload and move collisions. Duplicates are now resolved one at a time, and a new "Apply this action to all duplicates" checkbox handles them all at once, closing the dialog immediately and running the work in the background.
The container logic lives in
nameCollision.actions.tsandnameCollision.utils.ts(extracted in #2146 and #2147), so this PR adds the skip branch to the resolvers, the pending-group bookkeeping for the one-at-a-time flow, and their unit tests. The name-based matching and batching fixes that used to be bundled here are now #2148.Also: the renameModal i18n block is renamed to alreadyExistsModal (the dialog doesn't rename anything), the description text is operation-neutral, and the apply-to-all label toggles the checkbox.
Skipping a folder is a no-op here; merging its new content into the existing folder comes in #2129, stacked on this one.
Related Issues
Related Pull Requests
Checklist
Testing Process
Tested uploading existing files, then, verified that all functions work as expected
Additional Notes