Skip to content

Commit

Permalink
Merge pull request #7797 from owncloud/fix-file-list-update-after-copy
Browse files Browse the repository at this point in the history
fix: file list update after copying resources
kulmann authored Oct 14, 2022
2 parents 8b001ef + becaa67 commit 83fc6c8
Showing 6 changed files with 10 additions and 13 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/enhancement-id-based-routing
Original file line number Diff line number Diff line change
@@ -12,3 +12,4 @@ https://github.com/owncloud/web/issues/6247
https://github.com/owncloud/web/pull/7725
https://github.com/owncloud/web/issues/7714
https://github.com/owncloud/web/issues/7715
https://github.com/owncloud/web/pull/7797
Original file line number Diff line number Diff line change
@@ -324,8 +324,7 @@ export default defineComponent({
showMessage: this.showMessage,
$gettext: this.$gettext,
$gettextInterpolate: this.$gettextInterpolate,
$ngettext: this.$ngettext,
upsertResource: this.UPSERT_RESOURCE
$ngettext: this.$ngettext
}).then(() => {
;(document.activeElement as HTMLElement).blur()
})
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@ export default defineComponent({
'toggleFileSelection'
]),
...mapMutations('Files', {
upsertResource: 'UPSERT_RESOURCE',
setLatestSelectedFile: 'SET_LATEST_SELECTED_FILE_ID',
setFileSelection: 'SET_FILE_SELECTION',
addFileSelection: 'ADD_FILE_SELECTION'
@@ -264,8 +263,7 @@ export default defineComponent({
showMessage: this.showMessage,
$gettext: this.$gettext,
$gettextInterpolate: this.$gettextInterpolate,
$ngettext: this.$ngettext,
upsertResource: this.upsertResource
$ngettext: this.$ngettext
})
},
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ export class ResourceTransfer extends ConflictDialog {
const movedResources: Resource[] = []

for (let resource of this.resourcesToMove) {
// shallow copy of resources to prevent modifing existing rows
// shallow copy of resources to prevent modifying existing rows
resource = { ...resource }
const hasConflict = resolvedConflicts.some((e) => e.resource.id === resource.id)
let targetName = resource.name
@@ -164,6 +164,8 @@ export class ResourceTransfer extends ConflictDialog {
{ path: join(this.targetFolder.path, targetName) },
{ overwrite: overwriteTarget }
)
resource.id = undefined
resource.fileId = undefined
} else if (transferType === TransferType.MOVE) {
await this.clientService.webdav.moveFiles(
this.sourceSpace,
6 changes: 2 additions & 4 deletions packages/web-app-files/src/mixins/actions/paste.js
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import {
isLocationPublicActive,
isLocationSpacesActive
} from '../../router'
import { mapActions, mapMutations, mapGetters } from 'vuex'
import { mapActions, mapGetters } from 'vuex'

export default {
computed: {
@@ -58,7 +58,6 @@ export default {
methods: {
...mapActions(['showMessage', 'createModal', 'hideModal']),
...mapActions('Files', ['pasteSelectedFiles']),
...mapMutations('Files', ['UPSERT_RESOURCE']),

$_paste_trigger() {
this.pasteSelectedFiles({
@@ -69,8 +68,7 @@ export default {
showMessage: this.showMessage,
$gettext: this.$gettext,
$gettextInterpolate: this.$gettextInterpolate,
$ngettext: this.$ngettext,
upsertResource: this.UPSERT_RESOURCE
$ngettext: this.$ngettext
})
}
}
5 changes: 2 additions & 3 deletions packages/web-app-files/src/store/actions.ts
Original file line number Diff line number Diff line change
@@ -72,8 +72,7 @@ export default {
showMessage,
$gettext,
$gettextInterpolate,
$ngettext,
upsertResource
$ngettext
}
) {
const copyMove = new ResourceTransfer(
@@ -105,7 +104,7 @@ export default {
targetSpace,
resource
)
upsertResource(movedResource)
context.commit('UPSERT_RESOURCE', movedResource)
})()
)
}

0 comments on commit 83fc6c8

Please sign in to comment.