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

Feature/move #3739

Merged
merged 50 commits into from
Jul 9, 2020
Merged

Feature/move #3739

merged 50 commits into from
Jul 9, 2020

Conversation

LukasHirt
Copy link
Collaborator

@LukasHirt LukasHirt commented Jul 7, 2020

Description

We've added move action to the files list. It is possible now to move folders and files.
The move is executed via a new page called location picker.

Related Issue

How Has This Been Tested?

  • Acceptance tests

Screenshots (if appropriate):

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

@LukasHirt LukasHirt requested review from PVince81 and kulmann July 7, 2020 11:44
@LukasHirt LukasHirt self-assigned this Jul 7, 2020
@LukasHirt LukasHirt requested a review from DeepDiver1975 July 7, 2020 11:44
Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor things like code duplication.

Otherwise the code looks good overall. I haven't tested it.

},

moveResources() {
const resources = JSON.parse(JSON.stringify(this.selectedFiles))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange gymnastics ? is that a trick to do a deep copy ?
would it make sense to only gather the file ids ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This copies only the values without the watchers, etc. related to the vuex state. By doing this we are safe that we don't get any errors later on in case of modifying the values + we do not modify the original state. It looks a bit odd but I haven't yet found in any vue issue/forum different way to do this. Well, I saw one with lodash but I'd prefer to avoid that 🤷

},

target() {
return JSON.parse(JSON.stringify(this.$route.query.target))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another weird copy

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we maybe create our own utility function then ? the name of the function will already be explicit enough so we know what and why this is used

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one bug:

  1. start a move operation on a resource within Home (doesn't happen on subfolders)
  2. cancel the location picker
  3. sidebar is empty, except for the ownCloud logo.
    Menu items re-appear on page reload or when navigating into a subfolder.

The javascript console shows this:
Screenshot 2020-07-08 at 00 29 16

In general, this is really nice quality work! 🚀

desc: this.$gettext('Multiple resources could not be moved'),
status: 'danger'
})
console.error('Move failed:', errors)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugging leftover?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's left on purpose. Until we have added the logic to notifications to "stack" and then display all of the resources that failed, this is a "workaround" to be able to still see all the errors separately.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

:key="item.viewId"
:item="item"
:name="$_ocTrashbin_fileName(item)"
:display-preview="false"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why hide the thumbnails within the trash bin? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thumbnails are not yet being displayed in trashbin at all and I do not think implementing that should be part of this PR so disabling them until it's done is good enough here IMO.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@LukasHirt
Copy link
Collaborator Author

@PVince81 @kulmann All comments addressed. Pls re-review

@LukasHirt
Copy link
Collaborator Author

Seems that the breadcrumbs step is failing on mobile resolution. I'll investigate

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 from me on the code (haven't tested)

@LukasHirt
Copy link
Collaborator Author

Found the issue with breadcrumbs. The tests found them twice on mobile resolution which resulted in error. Until we fix the breadcrumbs in ODS, I adjusted it to look for the mobile ones only if the "normal" ones are not found.

Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

I found one tiny issue, but that might be unrelated to this PR:

  1. During move, navigate into a folder structure like this
    Screenshot 2020-07-09 at 08 34 43

  2. Navigate back by clicking on the folder name with a blank. The blank converts to %20 after navigating to the folder. Only happens in the title breadcrumb, not in the regular breadcrumbs we have above the files list.
    Screenshot 2020-07-09 at 08 34 50

@LukasHirt
Copy link
Collaborator Author

@kulmann I opened a ticket for the breadcrumbs bug #3753

@LukasHirt LukasHirt merged commit 20a3b0b into master Jul 9, 2020
@LukasHirt LukasHirt deleted the feature/move branch July 9, 2020 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move files to another location
4 participants