Skip to content

Commit

Permalink
fix variable name in error object
Browse files Browse the repository at this point in the history
  • Loading branch information
individual-it committed Feb 11, 2022
1 parent 2146660 commit 33a101b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/bugfix-error-message-move
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Failed move by drag'n'drop doesn't show the resource name in the error

We fixed the error message when moving an item via drag-and-drop failed, now it shows the correct name of the item.

https://github.com/owncloud/web/issues/6412
2 changes: 1 addition & 1 deletion packages/web-app-files/src/views/Personal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export default {
if (exists) {
const message = this.$gettext('Resource with name %{name} already exists')
errors.push({
resource: resource.name,
resourceName: resource.name,
message: this.$gettextInterpolate(message, { name: resource.name }, true)
})
return
Expand Down
5 changes: 5 additions & 0 deletions packages/web-app-files/tests/unit/views/Personal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ describe('Personal view', () => {
const spyOnMoveFiles = jest.spyOn(localVue.prototype.$client.files, 'move')

const wrapper = createWrapper([resourceDocumentsFolder])
const spyOnshowMessage = jest.spyOn(wrapper.vm, 'showMessage')
await wrapper.vm.fileDropped(resourcePdfsFolder.id)
expect(spyOnMoveFiles).not.toBeCalled()
expect(spyOnshowMessage).toBeCalledWith({
status: 'danger',
title: 'Failed to move "Documents"'
})

spyOnMoveFiles.mockReset()
spyOnGetFolderItems.mockReset()
Expand Down

0 comments on commit 33a101b

Please sign in to comment.