-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[full-ci] Improve UX of the conflict dialog (#7983)
Improve UX of the conflict dialog
- Loading branch information
1 parent
070a131
commit 75729e9
Showing
10 changed files
with
157 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Enhancement: Conflict dialog UX | ||
|
||
The UX of the conflict dialog has been improved slightly: | ||
|
||
* The name of the conflicting resource is now written in quotes | ||
* The title of the dialog now tells the difference between files and folders | ||
* The "Skip"-dialog now tells the difference between files and folders | ||
|
||
https://github.com/owncloud/web/pull/7983 | ||
https://github.com/owncloud/web/issues/7682 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/web-app-files/tests/unit/helpers/resource/conflictHandling/conflictDialog.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { mockDeep } from 'jest-mock-extended' | ||
import { Resource } from 'web-client' | ||
import { ConflictDialog, ResolveConflict } from 'web-app-files/src/helpers/resource' | ||
|
||
const getConflictDialogInstance = ({ createModal = jest.fn() } = {}) => { | ||
return new ConflictDialog(createModal, jest.fn(), jest.fn(), jest.fn(), jest.fn(), jest.fn()) | ||
} | ||
|
||
describe('conflict dialog', () => { | ||
describe('method "resolveAllConflicts"', () => { | ||
it('should return the resolved conflicts including the resource(s) and the strategy', async () => { | ||
const conflictDialog = getConflictDialogInstance() | ||
const strategy = mockDeep<ResolveConflict>() | ||
conflictDialog.resolveFileExists = jest.fn().mockImplementation(() => ({ | ||
strategy, | ||
doForAllConflicts: false | ||
})) | ||
const resource = mockDeep<Resource>({ name: 'someFile.txt' }) | ||
const targetFolder = mockDeep<Resource>({ path: '/' }) | ||
const targetFolderResources = [mockDeep<Resource>({ path: '/someFile.txt' })] | ||
const resolvedConflicts = await conflictDialog.resolveAllConflicts( | ||
[resource], | ||
targetFolder, | ||
targetFolderResources | ||
) | ||
|
||
expect(resolvedConflicts.length).toBe(1) | ||
expect(resolvedConflicts[0].resource).toEqual(resource) | ||
expect(resolvedConflicts[0].strategy).toEqual(strategy) | ||
}) | ||
}) | ||
describe('method "resolveFileExists"', () => { | ||
it('should create the modal in the end', () => { | ||
const createModal = jest.fn() | ||
const conflictDialog = getConflictDialogInstance({ createModal }) | ||
conflictDialog.resolveFileExists(mockDeep<Resource>(), 2, true) | ||
expect(createModal).toHaveBeenCalledTimes(1) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters