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

[full-ci] Show single (publicly) shared file in DetailsView #8446

Merged
merged 3 commits into from
May 10, 2023

Conversation

pascalwengerter
Copy link
Contributor

@pascalwengerter pascalwengerter commented Feb 15, 2023

Description

Needs

  • [ ] extracting components from the packages/web-app-files/src/components/Sidebar/ directory (we decided that this is not necessary for now)
  • adding unit tests for the CERN/reva and the oCIS/oC10 resolving of "single shared file"
  • (perhaps) updating a lot of acceptance tests (since they 1. currently expect a table and 2. IIRC there's also expected failures for this exact feature couldn't find any)

Related Issue

@pascalwengerter pascalwengerter changed the title Show single (publicly) shared file in DetailsView [full-ci] Show single (publicly) shared file in DetailsView Feb 16, 2023
@ownclouders
Copy link
Contributor

ownclouders commented Feb 16, 2023

Results for acceptance oC10 https://drone.owncloud.com/owncloud/web/35562/13/1

💥 The acceptance tests failed on retry. Please find the screenshots inside ...

webUIWebdavLockProtection-delete_feature-L33.png

webUIWebdavLockProtection-delete_feature-L33.png

webUIWebdavLockProtection-delete_feature-L34.png

webUIWebdavLockProtection-delete_feature-L34.png

webUIWebdavLockProtection-move_feature-L36.png

webUIWebdavLockProtection-move_feature-L36.png

webUIWebdavLockProtection-move_feature-L37.png

webUIWebdavLockProtection-move_feature-L37.png

@diocas
Copy link
Contributor

diocas commented Feb 17, 2023

If you keep our original logic, you don't need to worry whether it's a share where users can upload or not and becomes as simple as a single if condition.

Basically, it's a single public share if 1) there's only 1 paginated resource and 2) there is no current folder.

Since you create a "fake space" for the current folder, you can check whether it exists or not by checking that the fileId does not exist.

So, this is enough:

      if (this.paginatedResources.length === 1 && !this.currentFolder.fileId) {
        return true
      }
      return false

(ps: for the CERN case we still need to check that this.currentFolder.path !== this.paginatedResources[0].path for the internal shares, since our webdav response is not correct.. you can put a FIXME or smth in the code, and we will remove that if our backend aligns with ocis or gets fixed)

@pascalwengerter pascalwengerter force-pushed the feature/8445 branch 2 times, most recently from 56fabff to 3c02f08 Compare February 27, 2023 18:07
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Feb 27, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Feb 27, 2023
@pascalwengerter
Copy link
Contributor Author

Hmmm we'd still need to check whether the receiver has upload rights for the current/shared folder, right? The way it's working right now is that

  • shared individual file => ResourceDetails view (creating a "fake" space)
  • shared folder with single file and no upload permissions => ResourceDetails view
  • shared folder with single file and upload permissions => table
  • shared folder with any amount of files and upload permissions => table

Or is that going against your initial feature request?

@pascalwengerter pascalwengerter marked this pull request as ready for review February 27, 2023 22:52
@pascalwengerter
Copy link
Contributor Author

@kulmann happy to receive a review here already, while figuring out the unit tests :) (acceptance tests are green)

Copy link
Member

@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.

I'm a bit confused that you introduce so much options api vue code 😁 + see one comment. Works as expected and code looks good so far.

Do you want to add unit tests in a separate PR? I'd like to have them in this PR, but not sure how easy that's to resolve for you at the moment.

}
if (
isPublicSpaceResource(this.space) &&
!this.currentFolder.canUpload({ user: this.user }) &&
Copy link
Member

Choose a reason for hiding this comment

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

Why the check on canUpload? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because (from my understanding) we'd show the table/tiles if the share/link receiver can upload - one of the usability complaints was that users don't understand that they can't upload when seeing a single shared file in the table view.
It's more of a PO decision, we could also use the ResourceDetails.vue and enable the AppBar with create/upload buttons for single files and upload permissions, and then "switch over" to table/tiles once another resource is added.
Let me know, happy to finalize this either way :)

Copy link
Contributor

@diocas diocas Mar 9, 2023

Choose a reason for hiding this comment

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

But, isn't the check of paginatedResources[0].isFolder enough? Or do you have any case where you can upload and is not a folder? (that would be strange, no?)

Copy link
Member

Choose a reason for hiding this comment

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

My understanding was that we only ever show the single file view for files, never for folders. And for a file you will never be able to upload, like @diocas said. So isPublicSpaceResource(this.space) && !this.paginatedResources[0].isFolder should be sufficient.

pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Mar 16, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Mar 16, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Apr 11, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Apr 11, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Apr 17, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Apr 17, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Apr 28, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request Apr 28, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request May 5, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request May 5, 2023
@@ -219,7 +219,7 @@ Feature: Share by public link with different roles
And the user uploads folder "PARENT" using the webUI
Then folder "PARENT" should be listed on the webUI
And folder "CHILD" should be listed in the folder "PARENT" on the webUI
And file "child.txt" should be listed in the folder "CHILD" on the webUI
And file "child.txt" should be listed in the folder "CHILD" on the webUI as single share
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kulmann not sure if expected behavior product-wise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As in "you're a user on a public link, create a folder, navigate into folder, create/upload a file and see this file as a single share (and not in a table view)"

@@ -231,7 +231,7 @@ Feature: Share by public link with different roles
And the user uploads folder "PARENT" using the webUI
Then folder "PARENT" should be listed on the webUI
And folder "CHILD" should be listed in the folder "PARENT" on the webUI
And file "child.txt" should be listed in the folder "CHILD" on the webUI
And file "child.txt" should be listed in the folder "CHILD" on the webUI as single share
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kulmann not sure if expected behavior product-wise

pascalwengerter added a commit to pascalwengerter/web that referenced this pull request May 9, 2023
pascalwengerter added a commit to pascalwengerter/web that referenced this pull request May 9, 2023
@pascalwengerter pascalwengerter force-pushed the feature/8445 branch 2 times, most recently from c40770f to 598844a Compare May 9, 2023 22:15
@sonarcloud
Copy link

sonarcloud bot commented May 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

64.4% 64.4% Coverage
0.0% 0.0% Duplication

@pascalwengerter pascalwengerter requested review from kulmann and diocas May 10, 2023 13:07
Copy link
Member

@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!

@kulmann kulmann merged commit a6fd46c into owncloud:master May 10, 2023
@pascalwengerter pascalwengerter deleted the feature/8445 branch May 10, 2023 21:37
@tbsbdr tbsbdr mentioned this pull request Jun 30, 2023
37 tasks
@tbsbdr tbsbdr added this to the CERN Web Merge milestone Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cern] Display single (publicly) shared _file_ in dedicated view
5 participants