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/fileprovider-actions] Add Actions to File Provider: Sharing & Public Links #910

Merged
merged 248 commits into from
Mar 24, 2021

Conversation

hosy
Copy link
Collaborator

@hosy hosy commented Feb 26, 2021

Description

This PR adds two custom actions to the File Provider: Sharing and Public Links, which will open the UI for adding and editing sharing and public links to the selected item directly from the file provider.

Related Issue

Motivation and Context

Provide this core features from any app which is using the file provider.

How Has This Been Tested?

  • Open file provider from Files.app our any third party app
  • Long press an item
  • Select Sharing or Public Links

Screenshots (if appropriate):

Simulator Screen Shot - iPad Pro (11-inch) (2nd generation) - 2021-02-26 at 09 10 02 Simulator Screen Shot - iPad Pro (11-inch) (2nd generation) - 2021-02-26 at 12 07 07
Simulator Screen Shot - iPad Pro (11-inch) (2nd generation) - 2021-02-26 at 12 10 12 Simulator Screen Shot - iPad Pro (11-inch) (2nd generation) - 2021-02-26 at 09 11 53

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.
  • Added changelog files for the fixed issues in folder changelog/unreleased

QA

Test plan: https://github.com/owncloud/QA/blob/master/Mobile/iOS-app/Version%2011.6/Sharing%20Files%20%20app.md

hosy and others added 30 commits March 17, 2020 10:38
…the app (#643)

* #581 Added new setting to disable dragging files inside the app

* addressed CR findings and changed the title and the default value

* changed variable name for prevent dragging files and folders
	- adapt BookmarkViewController to latest OCBookmarkManager usage patterns
- improve Illustrator ".ai" support
	- override for failing iOS MIMEType -> UTI conversion in FileProvider (-> fix grayed out items in Files app)
	- add "application/illustrator" mime type to PDFViewerViewController to allow viewing Illustrator files in-app
- improved sorting
	- replace "type" with "kind" to match Files app and change method:
		- sort by type (folder / file)
		- if identical: sort by suffix (with fallback to MIMEType if no suffix is available)
		- if identical: use "_various" for comparison
Change shall avoid upload of duplicated photos since e.g. modificationDate can change if the photo was edited.

Co-authored-by: Michael Neuwert <[email protected]>
Co-authored-by: Matthias Hühne <[email protected]>
* Document task scheduling

This relates to #484 and
owncloud/docs#1900 task scheduling

This relates to #484 and
owncloud/docs#1900.

* Document task scheduling

This relates to #484 and
owncloud/docs#1900 task scheduling

This relates to #484 and
owncloud/docs#1900.

* Update docs/modules/ROOT/pages/ios_task_scheduling.adoc

Co-Authored-By: Phil Davis <[email protected]>

* Update docs/modules/ROOT/pages/ios_task_scheduling.adoc

Co-Authored-By: Phil Davis <[email protected]>

* Changed documentation to reflect changes in instant photo upload

Co-authored-by: Matthew Setter <[email protected]>
Co-authored-by: Matthew Setter <[email protected]>
Co-authored-by: Matthew Setter <[email protected]>
Co-authored-by: Phil Davis <[email protected]>
Co-authored-by: Michael Neuwert <[email protected]>
#673)

* #671 Improve creation of public link
- enable dragging public link
- added clear button on public link name
- copy link to clipboard, after link was created

* - added in-app notifications to the app
- show a notification if a public or private link was copied to the clipboard

* implemented own notification banner class to show in-app notifications without a need of local notification permissions

* resolved crash

* - implemented own animator class
- renamed class
- added completion handler on dismissal
- added shadow
…686)

* #683 fix stop playing audio, when scrollview was swiped to next item, play again, when come back to the audio item

* moved code to given delegate methods
* #654 bring back the round shape to the button, after changes in super class

* added a new enum type to set corner radius with enum values
* - add "Show folders at the top" option in Settings
- fix DisplaySettings change propagation within the same process (relevant when using multiple scenes on iPadOS)
- restructure SortMethod and add support to show folders at the top for all sort methods

* - Update CONFIGURATION.md to include new and previously undocumented configuration options
* Resign script with instructions how to resign an IPA file with an other certificate and provisioning profiles

* Using correct markdown format

* changed formatting for better readability

* Updated readme file

* changed new lines

* changed formatting

* changed formatting

* changed wording

* - changed folder structure
- added a parameter check for the signing method

* - show available certificate identities in usage
- check provisioning profiles fingerprint if matches with signing identity fingerprint
* Adapted to latest SDK changes in develop branch

* Implemented support for private links

- Support for opening links using custom URL scheme owncloud://
- Support for associated domains added
- Test associated domain configured

* Some small fix for presenting linked item

* Fixed an issue with universal links not being opened if the app was terminated in iOS13

* Triggering item download if necessary when core connection status changes to online

* Added a comment requested in code review

* Fixed build issues

* Iterating through multiple bookmarks possibly related to same URL

* Fixed review finding

* Fixed various swift Lint findings

* Fixed minor swift lint warnings

* - Licensing: add finishTransaction call for SKPaymentTransactionStateRestored transactions

* Fixes an issue with private link not being opened

This would happen in case user has kept opened a card with actions (via 3 dots button)

* Removed dead code and ensured that no item is opened at next launch if user returns to server list

* Handling going back in state restoration

* Added error message in case link can’t be resolved

* Swiflit trailing space warnings fixed

* - Update SDK to resolve issues

* Made download dependant on state of the connection

More reliable download mechanism for file previews:
- Trigger download only if network connectivity is available
- React to connection state changes

* Fixed an issue with owncloud:// schemed links not opened

* Trying to trigger download when network becomes available

* Fixed swift lint warning

* Avoiding multiple update of display view state

* Updated to the latest SDK

* Fixed an issue with DispatchGroup.leave() sometimes not being called

* Adapted for a new connection status .connecting

* Some swift lint warnings fixed

* Some refactoring in the DisplayViewController

* Tried to make DisplayViewController more maintenance friendly

- Code restructuring
- Handling of connection status
- Re-worked view state handling
- Tried to unwind some deeply nested hard to understand if conditions

* Included a fix in the SDK which brings back missing parent OCItems

* Showing “Connecting…” before OCCore switches connection status to online

* Several small changes

* Improved private link handling

- Refactored to avoid unnecessary code duplication
- Improved error messages
- Showing progress HUD while link is being resolved since it might take time espeially with multiple configured bookmarks and so on

* Updated to the develop/latest SDK revision

* Changed how error message is chosen if the item for private link is not found

* Using OCCoreConnectionStatusSignal instead of OCCore.connectionStatus

* Fixed “Connecting…” visual glitch and added spinner shown while connecting

* Fixed opening of app registered scheme on iOS13

As well as eventually a bug concerning file imports in case the app was not launched

* Added a delay for iOS 12.x for the private link resolution

So when the root view controller is instantiated it might already start some operations like opening a root of bookmark etc. Otherwise it would probably require some complex coordination managed centrally. On iOS 13 such hack would be unnecessary since there UIApplicationDelegate callbacks are not used anymore.

* Improvement for QA finding

If the bookmark to which private link has pointed is not configured,  wrong error message has been shown

* Fixed an issue with incorrect error message being shown

In case item was removed

* Fixed an issue with file previews

- Not downloading by default if file can’t be previewed
- Downloading and opening files which can be previewed by QLPreviewController

* Fixed an issue with renderSpecificView() called at inapropriate time

Co-authored-by: Michael Neuwert <[email protected]>
Co-authored-by: Felix Schwarz <[email protected]>
* Set accessibility properties on the actions menu drag handle

* Fixed accessibility label for the favorite / unfavorite button

* Fixed wrong order of accesibility labels for star button (favorite)

* Added accesibility label for button activating multiple item selection

* Added proper accessibility labels to the toolbar items

* added mouse pointer hover effect to drag view

Co-authored-by: Michael Neuwert <[email protected]>
Co-authored-by: Matthias Hühne <[email protected]>
Co-authored-by: Matthias Hühne <[email protected]>
* First draft of take photo and upload feature

* Don’t allow image editing when taking new pic

* Next iteration of “Take photo or video”

- Preserving image meta-data
- Conversion HEIC -> JPEG depending on media upload settings
- Conversion MOV -> MP4
- Localized action name

* Fixed media naming and added some error logs

* Some cosmetic code changes

* Changed keyboard shortcut to Cmd+Shift+3

* Added logs to camera upload action

* Added progress hud in case photo / video export would take longer

* Added more logs

* Added a check for HEIC support

Warning added to the log in case HEIC is not supported

Co-authored-by: Michael Neuwert <[email protected]>
Co-authored-by: Matthias Hühne <[email protected]>
- add Xcode scheme env var templates to simplify testing
* Correct some typos (#620)

Fix small errors in typos

Co-authored-by: Matthias Hühne <[email protected]>

* add extra check in release checklist, to avoid missing translations in some languages (#640)

Co-authored-by: Matthias Hühne <[email protected]>

* Fix docs build errors (#666)

Co-authored-by: Matthias Hühne <[email protected]>

* #717 Implemented a contextual menu for the file list which includes the same items as the more menu card

* - UIMenu title removed
- use table row label color as image tint color (UIMenu background color is wrong in simulator and dark mode)

* solved tint color problems for UIAction icon

* fixed wording and localization

Co-authored-by: Carlos Damken <[email protected]>
Co-authored-by: Jesús Recio <[email protected]>
Co-authored-by: Matthew Setter <[email protected]>
- Do not embed entitlements into library binaries when signing frameworks. Otherwise leading to validation issue with AppStore Connect.
- Set NSExtensionFileProviderDocumentGroup to appropriate app group. This was missing

Co-authored-by: Michael Neuwert <[email protected]>
Delete tmp.plist after it is no longer being used, otherwise leads to ITMS-90048 Bundle is invalid.
* Improved various aspects of media uploads

- Changed a way how assets are exported which photo uploads significantly faster
- Refactored PHAsset+Upload.swift extensions which is now way more readable.
- Improved naming of assets
- Changed default naming of uploaded assets to the scheme legacy app was using
- Added an option allowing to preserve “original” asset names as used by iOS photo library
- Prepared code for future enhancments (exporting additional assets like RAW images and live photo video clips

* Localization of strings and other tiny changes

* Made a mechanism deriving original media asset name more reliable

* Fixed requesting image data

* Using PHAsset.creationDate as lastModifiedDate when uploading media asset

The timestamp is then set into corresponding property in the WebDAV request allowing to have proper file creation date when uploaded to oC server instance.

* Picking edited version of the photo when uploading by default

* Moved files around to have a cleaner structure in Xcode

* Using PHAssetResourceManager for export whenever possible

* Fixed small issues

* Corrected some comments

* Fixes issue (1) found in QA testing

Fixed duplicated .MP4 extension when uploading videos

Co-authored-by: Michael Neuwert <[email protected]>
Co-authored-by: Felix Schwarz <[email protected]>
- add additional env parameters for logging, auth methods
…cate issue, eliminating redundant issues, respecting and remembering choices to either retry or put the connection offline
* - FileProvider: extend hardcoded MIME/Suffix -> UTI maps so files of these types are properly displayed in the Files app

* - add new ItemContainer protocol allowing the retrieval of an item from another object
- UIImageView+Thumbnails
	- fix item version comparison for thumbnails requested from the SDK (using ItemContainer)
	- add item version comparison for thumbnails generated locally via QLThumbnailGenerator (using ItemContainer)

* - Update SDK
- only show sharing items, if sharing is enabled and core is online
* Activate editing mode in viewDidAppear()

Sort of a hack but there is apparently no other way of achieving this

* Display more button in the PDF viewer. Preserving already configured UIBarButtonItem instances when adding more button.

* Re-rendering content if it has got modified locally

E.g. user could open markup editor and scribble on picture or PDF. Without this fix, he would need to go back to the file list and re-open document to see the changes.

* Fix for auto-tapping markup button

Co-authored-by: Michael Neuwert <[email protected]>
@delete-merged-branch delete-merged-branch bot deleted the branch milestone/11.6 March 16, 2021 09:28
@hosy hosy changed the base branch from feature/fileprovider-passcode-ui to milestone/11.6 March 16, 2021 09:28
@felix-schwarz
Copy link
Contributor

Thanks for the changes! Noticed after reviewing and approving the changes that there are merge conflicts that you might want to look into.

# Conflicts:
#	ownCloud File Provider UI/Base.lproj/MainInterface.storyboard
#	ownCloud File Provider UI/DocumentActionViewController.swift
#	ownCloud File Provider UI/Info.plist
#	ownCloud.xcodeproj/project.pbxproj
#	ownCloud/Resources/de.lproj/Localizable.strings
#	ownCloud/Resources/en.lproj/Localizable.strings
@jesmrec
Copy link
Contributor

jesmrec commented Mar 23, 2021

(1)

This is not something that happens every time, but i can reproduce easily after selecting the new Sharing options. The view stucks in Connecting. The only way is cancelling and trying again.

Video-2021-03-23-14-16-23_1423.MP4

iPhoneXR v14.4 8bad1fb

@jesmrec
Copy link
Contributor

jesmrec commented Mar 23, 2021

(2) [FIXED]

Dark theme is set by default in the sharing view inside Files App, no matter which theme is selected in the app.

Is this something fixable?

@hosy
Copy link
Collaborator Author

hosy commented Mar 23, 2021

@jesmrec (2) should be fixed.

hosy and others added 3 commits March 23, 2021 15:59
- CancelLabelViewController: add configurable cancelAction
- DocumentActionViewController:
	- replace OCCoreManager instantiation with shared instance
	- route all completions and error returns through a single method that returns the OCCore before exiting
@jesmrec
Copy link
Contributor

jesmrec commented Mar 24, 2021

(2) is fixed

@hosy
Copy link
Collaborator Author

hosy commented Mar 24, 2021

@jesmrec you can check (1) too.

@jesmrec
Copy link
Contributor

jesmrec commented Mar 24, 2021

(3) [FIXED]

  1. Alice share a folder with Bob
  2. Bob opens Files App
  3. Bob select the shared item and the option Share with user/group
  4. Bob taps on Unshare

Current: Spinner forever
Expected: Folder unshared

iPhoneXR v14.4
0f7b667

@jesmrec
Copy link
Contributor

jesmrec commented Mar 24, 2021

(1) is fixed

@jesmrec
Copy link
Contributor

jesmrec commented Mar 24, 2021

(4) [FIXED]

  1. In webUI, go to admin dashboard -> Sharing, and disable Allow apps to use the Share API. From now on, no sharing with users and public link creation will be allowed.
  2. Open Files App, ownCloud account

Current:

Sharing with users/groups: it is enabled and it is allowed to search a recipient. Finally, you get the proper error because API is not enabled.
Share Link: Not allowed to create from scratch

Expected:

Both Share with users/groups and Share link should behave in the same way: both allowing to create and then returning an error, or both disabled from scratch preventing users to do actions that will finish with an error.

In the app, both are disabled when Sharing API is disabled, as reference.

iPhoneXR v14.4
0f7b667

- fixed not open sharing view, when sharing is disabled
@hosy
Copy link
Collaborator Author

hosy commented Mar 24, 2021

@jesmrec (3), (4) is fixed now. Regarding (4): it is not possible to hide the menu item, instead a message will be shown, that sharing is not allowed.

@jesmrec
Copy link
Contributor

jesmrec commented Mar 24, 2021

@jesmrec (3), (4) is fixed now. Regarding (4): it is not possible to hide the menu item, instead a message will be shown, that sharing is not allowed.

yes, i know. The option is there and then, the message inside. This is totally correct.

(3) and (4) are fixed and test plan execution is completed

Approved

@jesmrec jesmrec added the Approved by QA Approved by QA label Mar 24, 2021
@hosy hosy merged commit 9f9747c into milestone/11.6 Mar 24, 2021
@delete-merged-branch delete-merged-branch bot deleted the feature/fileprovider-actions branch March 24, 2021 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved by QA Approved by QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants