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/sharing-user-groups] Implementation of Sharing with Users, Groups and Remote Users, Public Links #358

Merged
merged 144 commits into from
Jun 8, 2019

Conversation

hosy
Copy link
Collaborator

@hosy hosy commented Apr 12, 2019

Description

Implementation of User, Group and Remote Sharing for files and folders

Related Issue

#351
#275
#292

Motivation and Context

As one of a main feature of ownCloud it is now possible the share files and folders to other users.

How Has This Been Tested?

Sharing with Users, Groups

  • shared files and folders should have a shared icon in the file list (folders have a special folder icon)
  • on a file, which is currently not shared, tap on the More button
    • if sharing is possible for this item (depends on server capability, permissions) there is a new item "Share file" or "Share folder"
    • Tapping on this item will open the Sharing overview, where you can search for a new recipient
  • on an item which is shared by you, you will see how many recipients are on this share
  • if the item has public links, these are also visible, but cannot edited at the moment
  • in the Sharing overview you can edit, delete and add recipients
  • by selecting a share recipient you can change permissions, based on the item type
  • if you have reshared the item, you can edit permissions for this recipient

Public Links

  • if item is sharable, there is a menu item Create Public Link, if not there is no menu entry
  • tap on it will create a new public link with known options
  • please test it with all regarded server capabilities

Private Link

  • open the menu item Create Public Link
  • on the top of the screen there is a button Copy Private Link
  • this will copy the private link url to the pasteboard

Sorting in file list

  • you can now sort items in file list, if it is shared

In the process of implementation, the following was changed:

Issue #292:

  • Enter a search term in file list, which has no matches
  • Delete all share recipients of an item
  • If the keyboard is on screen, all text labels should be visible and not hidden by keyboard

Add Menu

  • In file list, tap on Add button
  • Menu items are now left aligned and have an left aligned icon

More Menu

  • Action items are now left aligned and have left aligned icons

Quick Access

This view was necessary to show pending shares, which needs to be accepted by the user.

Pending Shares

  • if the user has pending shares,

Shares

Collections

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)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Test plan:

https://github.com/owncloud/QA/blob/master/Mobile/iOS-app/Sharing.md

Bugfixing:

@hosy hosy added this to the 1.1.0-Next milestone Apr 12, 2019
@hosy hosy self-assigned this Apr 12, 2019
@codecov
Copy link

codecov bot commented Apr 12, 2019

Codecov Report

Merging #358 into master will decrease coverage by 3.02%.
The diff coverage is 14.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #358      +/-   ##
==========================================
- Coverage   30.04%   27.02%   -3.03%     
==========================================
  Files         245      263      +18     
  Lines       17106    19828    +2722     
==========================================
+ Hits         5140     5358     +218     
- Misses      11966    14470    +2504
Impacted Files Coverage Δ
...Client/Sharing/PublicLinkTableViewController.swift 0% <0%> (ø)
ownCloud/Client/Viewer/DisplayViewController.swift 0% <0%> (ø) ⬆️
ownCloud/SDK Extensions/OCCore+Extension.swift 0% <0%> (ø)
ownCloud/UIKit Extensions/UIImage+Extension.swift 40.62% <0%> (-21.28%) ⬇️
ownCloud/UIKit Extensions/Array+Extension.swift 0% <0%> (ø)
ownCloud/UI Elements/RoundedLabel.swift 0% <0%> (ø)
...t/Actions/Actions+Extensions/DuplicateAction.swift 10% <0%> (-0.77%) ⬇️
ownCloud/Client/Actions/MoreViewHeader.swift 0% <0%> (ø) ⬆️
ownCloud/SDK Extensions/OCShare+Extension.swift 0% <0%> (ø)
ownCloud/Client/Sharing/ShareClientItemCell.swift 0% <0%> (ø)
... and 60 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8f6b99...633b098. Read the comment docs.

hosy added 10 commits April 17, 2019 13:43
- new toggle action
- set permissions (unfinished)
- handling shared by me and shared with me in file detail view
- disable permission editing, if user is not the owner
- delete receipient
- added sorting by "shared" in file list
- add recipient to share
- fixes for recipients search
- added header title to search recipients
- fixed keyboard height constraint in MessageView
- added localization strings
- fixed updating shares handler
- More menu: left aligned text, added icons
- fixes for UI glitches in more menu (correct height)
- fixed wrong table header height in MoreStaticTableViewController, for sections without section title
- close more menu before opening sharing overview
- fixed tint color for image
- updated to new sharing SDK (which fixes update notification)
- added delete recipient by swiping in overview
@hosy hosy changed the base branch from master to release/1.0.1 April 30, 2019 07:17
@hosy hosy changed the base branch from release/1.0.1 to master April 30, 2019 08:48
…sharing-user-groups

# Conflicts:
#	ios-sdk
#	ownCloud.xcodeproj/project.pbxproj
#	ownCloud/Client/Actions/Action.swift
#	ownCloud/Client/Actions/Actions+Extensions/DuplicateAction.swift
#	ownCloud/Client/ClientQueryViewController.swift
#	ownCloud/Resources/en.lproj/Localizable.strings
- new function to detect if user can edit OCShare
@felix-schwarz
Copy link
Contributor

@jesmrec Regarding (10): that's fixed with the latest commit

@hosy
Copy link
Collaborator Author

hosy commented Jun 6, 2019

(32)

  1. Share several items with an user in another server (federated)
  2. Open the recipient

Current: Notification is correct, but in the list of pending invites, only one share appears. Once you accept or decline the next one is there
Expected: List of pending invites

@jesmrec fixed!

@jesmrec
Copy link
Contributor

jesmrec commented Jun 6, 2019

about (10), not posible to share if the username last character is '@'

Jun-06-2019 11-52-49

Request is sent with shareType: 6 instead of shareType: 0

@jesmrec
Copy link
Contributor

jesmrec commented Jun 7, 2019

with commit a951f4d (10) is still reproducible. Is it pointing to the right SDK commit? @felix-schwarz

@jesmrec
Copy link
Contributor

jesmrec commented Jun 7, 2019

(10) -> fixed!

@jesmrec
Copy link
Contributor

jesmrec commented Jun 7, 2019

(33) [FIXED]

  1. Share with user/group a folder
  2. Browse into the folder and try to delete items (permission was granted in the creation)

Current: Unshare option available, no way to delete.
Expected: Unsharing is an option for the "source" item (shared folder in step 1.), the items inside can be removed (if granted)

@jesmrec
Copy link
Contributor

jesmrec commented Jun 7, 2019

(34) (improvement)

  1. Open "Share this file/folder"
  2. Search and choose a recipient
  3. Remove connection
  4. Save

Current: error can be improved

Screenshot 2019-06-07 at 10 42 26

- Fixed retain cycle
- Code cosmetics
@hosy
Copy link
Collaborator Author

hosy commented Jun 7, 2019

(33)

  1. Share with user/group a folder
  2. Browse into the folder and try to delete items (permission was granted in the creation)

Current: Unshare option available, no way to delete.
Expected: Unsharing is an option for the "source" item (shared folder in step 1.), the items inside can be removed (if granted)

@jesmrec good catch!

…em(from: core) methods

- Adapted DeleteAction and UnshareAction so that deletion is available inside shared folders where the owner allowed deletion
@felix-schwarz
Copy link
Contributor

(33)

  1. Share with user/group a folder
  2. Browse into the folder and try to delete items (permission was granted in the creation)

Current: Unshare option available, no way to delete.
Expected: Unsharing is an option for the "source" item (shared folder in step 1.), the items inside can be removed (if granted)

@jesmrec Fixed as of c06f6b9. The "Unshare" option is only shown for the actually shared "root item", not the items inside it though. Would've found it confusing otherwise.

@jesmrec
Copy link
Contributor

jesmrec commented Jun 7, 2019

(35) [FIXED]

In web UI:

Screenshot 2019-06-07 at 12 25 27

In app:

Screenshot 2019-06-07 at 12 26 16

Current: Share and Delete are hidden
Expected: Share and Delete are visible and unchecked

@hosy
Copy link
Collaborator Author

hosy commented Jun 7, 2019

(35)

In web UI:

Screenshot 2019-06-07 at 12 25 27

In app:

Screenshot 2019-06-07 at 12 26 16

Current: Share and Delete are hidden
Expected: Share and Delete are visible and unchecked

@jesmrec it was decided to hide elements, which cannot be selected -> [WON`T FIX]

@jesmrec
Copy link
Contributor

jesmrec commented Jun 7, 2019

But they can be selected, this option is to mark permissions by default when the share is being created.

F. ex, in webUI, with the set up:

Screenshot 2019-06-07 at 12 25 27

when you create a share:

Screenshot 2019-06-07 at 13 51 00

which behaviour is the correct, then?

CC @pmaier1

@hosy
Copy link
Collaborator Author

hosy commented Jun 7, 2019

But they can be selected, this option is to mark by default when the share is being created.

F. ex, in webUI, with the set up:

Screenshot 2019-06-07 at 12 25 27

when you create a share:

Screenshot 2019-06-07 at 13 51 00

which behaviour is the correct, then?

CC @pmaier1

@jesmrec what do you mean exactly? Sharing and Deleting is not allowed or is not a default permission?

@jesmrec
Copy link
Contributor

jesmrec commented Jun 7, 2019

i mean.

You see this in the webUI

Screenshot 2019-06-07 at 13 51 00

options "Share" and "delete" unchecked, but you can check them if you want to grant those permissions.

In the app:

Screenshot 2019-06-07 at 14 14 47

"Share" and "Delete" are hidden, and you do no have the choice to grant those permissions.

@jesmrec jesmrec self-requested a review June 7, 2019 13:05
hosy added 2 commits June 7, 2019 16:22
- disable public link section, if not enabled
- do not show share menu item, if sharing api is disabled
@hosy hosy merged commit 0bd5944 into master Jun 8, 2019
@delete-merged-branch delete-merged-branch bot deleted the feature/sharing-user-groups branch June 8, 2019 07:09
@jesmrec jesmrec mentioned this pull request Jun 14, 2019
45 tasks
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.

8 participants