Skip to content

Commit

Permalink
Add merge to folders
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Sep 6, 2022
1 parent fade050 commit dc7615d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,8 @@ export default defineComponent({
allConflictsCount - count,
this.$gettext,
this.$gettextInterpolate,
false
false,
isFolder
)
count += 1
if (resolvedConflict.doForAllConflicts) {
Expand Down Expand Up @@ -859,10 +860,6 @@ export default defineComponent({
const foldersToSkip = resolvedFolderConflicts
.filter((e) => e.strategy === ResolveStrategy.SKIP)
.map((e) => e.name)
// needs a solution how to handle overwrite
const foldersToOverwrite = resolvedFolderConflicts
.filter((e) => e.strategy === ResolveStrategy.REPLACE)
.map((e) => e.name)
const foldersToKeepBoth = resolvedFolderConflicts
.filter((e) => e.strategy === ResolveStrategy.KEEP_BOTH)
.map((e) => e.name)
Expand Down
12 changes: 7 additions & 5 deletions packages/web-app-files/src/helpers/resource/copyMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { DavProperties } from 'web-pkg/src/constants'
export enum ResolveStrategy {
SKIP,
REPLACE,
KEEP_BOTH
KEEP_BOTH,
MERGE
}
export interface ResolveConflict {
strategy: ResolveStrategy
Expand All @@ -25,7 +26,8 @@ export const resolveFileExists = (
conflictCount,
$gettext,
$gettextInterpolate,
isSingleConflict
isSingleConflict,
suggestMerge=false
): Promise<ResolveConflict> => {
return new Promise<ResolveConflict>((resolve) => {
let doForAllConflicts = false
Expand All @@ -41,8 +43,8 @@ export const resolveFileExists = (
true
),
cancelText: $gettext('Skip'),
confirmText: $gettext('Keep both'),
buttonSecondaryText: $gettext('Replace'),
confirmText: $gettext('Keep both') ,
buttonSecondaryText: suggestMerge ? $gettext('Merge') : $gettext('Replace'),
checkboxLabel: isSingleConflict
? ''
: $gettextInterpolate(
Expand All @@ -59,7 +61,7 @@ export const resolveFileExists = (
},
onConfirmSecondary: () => {
hideModal()
const strategy = ResolveStrategy.REPLACE
const strategy = suggestMerge ? ResolveStrategy.MERGE : ResolveStrategy.REPLACE
resolve({ strategy, doForAllConflicts } as ResolveConflict)
},
onConfirm: () => {
Expand Down

0 comments on commit dc7615d

Please sign in to comment.