Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: file list update after copying resources #7797

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/unreleased/enhancement-id-based-routing
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
})
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
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
Expand Up @@ -3,7 +3,7 @@ import {
isLocationPublicActive,
isLocationSpacesActive
} from '../../router'
import { mapActions, mapMutations, mapGetters } from 'vuex'
import { mapActions, mapGetters } from 'vuex'

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

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