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

[milestone/12.1] Milestone 12.1 #1257

Merged
merged 19 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
99608c9
- CreateDocumentAction: make availability dependant on OCAppProvider.…
felix-schwarz Jun 28, 2023
4b9b483
- add support for TUS upload mtime metadata header (fixing #1227)
felix-schwarz Jul 3, 2023
4cee115
- FileProviderExtension: add additional debug output for enumerator
felix-schwarz Jul 4, 2023
ce2ab28
FileProvider:
felix-schwarz Jul 10, 2023
bc1327a
- FIleProviderContentEnumerator: add/refine more debug logging
felix-schwarz Jul 10, 2023
59736f7
- bump version to 12.0.3 and build number to 271
felix-schwarz Jul 10, 2023
9cb4d8c
- update SDK to fix https://github.com/owncloud/enterprise/issues/5811
felix-schwarz Jul 11, 2023
4a95da9
- OCSavedSearch+Interactions: add attribute .useSortDescriptor and ut…
felix-schwarz Jul 13, 2023
58b28d0
- SortBar:
felix-schwarz Jul 14, 2023
bfa2a5d
- OCCore+Extension: new convenience method to update the .lastUsed da…
felix-schwarz Jul 14, 2023
f13b349
- replace AvailableOfflineAction and MakeAvailableOfflineAction with …
felix-schwarz Jul 17, 2023
e2c3e42
- change name of AvailableOfflineAction from "Available offline" to "…
felix-schwarz Jul 17, 2023
1c19c52
Configuration documentation updated
felix-schwarz Jul 17, 2023
8a63d79
- AvailableOfflineAction: only show action for items not already avai…
felix-schwarz Jul 17, 2023
4144c18
- AvailableOfflineAction: only show action for items not already avai…
felix-schwarz Jul 17, 2023
50a41f4
Merge branch 'master' into milestone/12.1
felix-schwarz Oct 6, 2023
10e0921
Merge from milestone/12.0.4:
felix-schwarz Oct 6, 2023
1e9ab3a
Merge branch 'master' into milestone/12.1
felix-schwarz Dec 18, 2023
f55527c
Calens changelog updated
felix-schwarz Dec 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
438 changes: 236 additions & 202 deletions CHANGELOG.md

Large diffs are not rendered by default.

36 changes: 12 additions & 24 deletions doc/CONFIGURATION.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
"key" : "allowed",
"label" : "action.allowed",
"possibleValues" : [
{
"description" : "Make available offline",
"value" : "com.owncloud.action.availableOffline"
},
{
"description" : "Sharing",
"value" : "com.owncloud.action.collaborate"
Expand Down Expand Up @@ -88,14 +92,6 @@
"description" : "Paste",
"value" : "com.owncloud.action.importpasteboard"
},
{
"description" : "Make available offline",
"value" : "com.owncloud.action.makeAvailableOffline"
},
{
"description" : "Available Offline",
"value" : "com.owncloud.action.makeUnavailableOffline"
},
{
"description" : "Markup",
"value" : "com.owncloud.action.markup"
Expand Down Expand Up @@ -190,6 +186,10 @@
"key" : "disallowed",
"label" : "action.disallowed",
"possibleValues" : [
{
"description" : "Make available offline",
"value" : "com.owncloud.action.availableOffline"
},
{
"description" : "Sharing",
"value" : "com.owncloud.action.collaborate"
Expand Down Expand Up @@ -226,14 +226,6 @@
"description" : "Paste",
"value" : "com.owncloud.action.importpasteboard"
},
{
"description" : "Make available offline",
"value" : "com.owncloud.action.makeAvailableOffline"
},
{
"description" : "Available Offline",
"value" : "com.owncloud.action.makeUnavailableOffline"
},
{
"description" : "Markup",
"value" : "com.owncloud.action.markup"
Expand Down Expand Up @@ -1667,6 +1659,10 @@
"description" : "Extension with the identifier auth-race-condition.",
"value" : "auth-race-condition"
},
{
"description" : "Extension with the identifier com.owncloud.action.availableOffline.",
"value" : "com.owncloud.action.availableOffline"
},
{
"description" : "Extension with the identifier com.owncloud.action.background_update.",
"value" : "com.owncloud.action.background_update"
Expand Down Expand Up @@ -1711,14 +1707,6 @@
"description" : "Extension with the identifier com.owncloud.action.instant_media_upload.",
"value" : "com.owncloud.action.instant_media_upload"
},
{
"description" : "Extension with the identifier com.owncloud.action.makeAvailableOffline.",
"value" : "com.owncloud.action.makeAvailableOffline"
},
{
"description" : "Extension with the identifier com.owncloud.action.makeUnavailableOffline.",
"value" : "com.owncloud.action.makeUnavailableOffline"
},
{
"description" : "Extension with the identifier com.owncloud.action.markup.",
"value" : "com.owncloud.action.markup"
Expand Down
27 changes: 9 additions & 18 deletions doc/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ tag::actions[]
!===
! Value
! Description
! `com.owncloud.action.availableOffline`
! Make available offline

! `com.owncloud.action.collaborate`
! Sharing

Expand Down Expand Up @@ -44,12 +47,6 @@ tag::actions[]
! `com.owncloud.action.importpasteboard`
! Paste

! `com.owncloud.action.makeAvailableOffline`
! Make available offline

! `com.owncloud.action.makeUnavailableOffline`
! Available Offline

! `com.owncloud.action.markup`
! Markup

Expand Down Expand Up @@ -121,6 +118,9 @@ action.create-document-mode
!===
! Value
! Description
! `com.owncloud.action.availableOffline`
! Make available offline

! `com.owncloud.action.collaborate`
! Sharing

Expand Down Expand Up @@ -148,12 +148,6 @@ action.create-document-mode
! `com.owncloud.action.importpasteboard`
! Paste

! `com.owncloud.action.makeAvailableOffline`
! Make available offline

! `com.owncloud.action.makeUnavailableOffline`
! Available Offline

! `com.owncloud.action.markup`
! Markup

Expand Down Expand Up @@ -1008,6 +1002,9 @@ tag::extensions[]
! `auth-race-condition`
! Extension with the identifier auth-race-condition.

! `com.owncloud.action.availableOffline`
! Extension with the identifier com.owncloud.action.availableOffline.

! `com.owncloud.action.background_update`
! Extension with the identifier com.owncloud.action.background_update.

Expand Down Expand Up @@ -1041,12 +1038,6 @@ tag::extensions[]
! `com.owncloud.action.instant_media_upload`
! Extension with the identifier com.owncloud.action.instant_media_upload.

! `com.owncloud.action.makeAvailableOffline`
! Extension with the identifier com.owncloud.action.makeAvailableOffline.

! `com.owncloud.action.makeUnavailableOffline`
! Extension with the identifier com.owncloud.action.makeUnavailableOffline.

! `com.owncloud.action.markup`
! Extension with the identifier com.owncloud.action.markup.

Expand Down
12 changes: 4 additions & 8 deletions ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@
DC2A68D529D492B300BFF393 /* space.tvg in Resources */ = {isa = PBXBuildFile; fileRef = DC2A68D429D492B200BFF393 /* space.tvg */; };
DC2A68D729D4E93300BFF393 /* SharedKeyCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC2A68D629D4E93300BFF393 /* SharedKeyCommands.swift */; };
DC2FE2DA24C30586002AFDB3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 593A821320C7D4C5000E2A90 /* Localizable.strings */; };
DC33939622E0747400DD3DA4 /* MakeAvailableOfflineAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC33939522E0747400DD3DA4 /* MakeAvailableOfflineAction.swift */; };
DC33939D22E076E300DD3DA4 /* MakeUnavailableOfflineAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC33939C22E076E300DD3DA4 /* MakeUnavailableOfflineAction.swift */; };
DC36885824DC98BF00333600 /* OCFileProviderServiceSession.h in Headers */ = {isa = PBXBuildFile; fileRef = DC36885624DC98BF00333600 /* OCFileProviderServiceSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
DC36885924DC98BF00333600 /* OCFileProviderServiceSession.m in Sources */ = {isa = PBXBuildFile; fileRef = DC36885724DC98BF00333600 /* OCFileProviderServiceSession.m */; };
DC36885D24DD916800333600 /* ownCloudApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCC0855C2293F1FD008CC05C /* ownCloudApp.framework */; };
Expand Down Expand Up @@ -359,6 +357,7 @@
DC7C101124B5FA7700227085 /* OCBookmark+AppExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = DC7C100E24B5F81E00227085 /* OCBookmark+AppExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; };
DC7C101224B5FD6500227085 /* OCBookmark+AppExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = DC7C100F24B5F81E00227085 /* OCBookmark+AppExtensions.m */; };
DC7DBA37207F84BF00E7337D /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC7DBA36207F84BF00E7337D /* main.swift */; };
DC815C3F2A65D9CB00BFF393 /* AvailableOfflineAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC815C3E2A65D9CB00BFF393 /* AvailableOfflineAction.swift */; };
DC825E352A05083C00BFF393 /* GitInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC825E342A05083C00BFF393 /* GitInfo.swift */; };
DC82663C28168D2800F91F7D /* ClientContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC82663B28168D2800F91F7D /* ClientContext.swift */; };
DC82D6FA23171339001551C5 /* ScanAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC82D6F923171339001551C5 /* ScanAction.swift */; };
Expand Down Expand Up @@ -1263,8 +1262,6 @@
DC2A68D429D492B200BFF393 /* space.tvg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = space.tvg; path = "img/filetypes-tvg/space.tvg"; sourceTree = SOURCE_ROOT; };
DC2A68D629D4E93300BFF393 /* SharedKeyCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedKeyCommands.swift; sourceTree = "<group>"; };
DC321260207EB01B00DB171D /* ThemeImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeImage.swift; sourceTree = "<group>"; };
DC33939522E0747400DD3DA4 /* MakeAvailableOfflineAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MakeAvailableOfflineAction.swift; sourceTree = "<group>"; };
DC33939C22E076E300DD3DA4 /* MakeUnavailableOfflineAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MakeUnavailableOfflineAction.swift; sourceTree = "<group>"; };
DC3393A722E0C4ED00DD3DA4 /* icon-available-offline.tvg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "icon-available-offline.tvg"; path = "../img/filetypes-tvg/icon-available-offline.tvg"; sourceTree = "<group>"; };
DC36885624DC98BF00333600 /* OCFileProviderServiceSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OCFileProviderServiceSession.h; sourceTree = "<group>"; };
DC36885724DC98BF00333600 /* OCFileProviderServiceSession.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OCFileProviderServiceSession.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1370,6 +1367,7 @@
DC7DBA36207F84BF00E7337D /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
DC7DBA52207F8BD600E7337D /* img */ = {isa = PBXFileReference; lastKnownFileType = folder; path = img; sourceTree = SOURCE_ROOT; };
DC7DBA53207FA80C00E7337D /* TVGImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TVGImage.swift; sourceTree = "<group>"; };
DC815C3E2A65D9CB00BFF393 /* AvailableOfflineAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvailableOfflineAction.swift; sourceTree = "<group>"; };
DC825E342A05083C00BFF393 /* GitInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GitInfo.swift; sourceTree = "<group>"; };
DC82663B28168D2800F91F7D /* ClientContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientContext.swift; sourceTree = "<group>"; };
DC82D6F923171339001551C5 /* ScanAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanAction.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2156,8 +2154,7 @@
6E91F37D21ECA6FD009436D2 /* CopyAction.swift */,
6E586CFF2199A78E00F680C4 /* DeleteAction.swift */,
6E3A104C219D6F0100F90C96 /* DuplicateAction.swift */,
DC33939522E0747400DD3DA4 /* MakeAvailableOfflineAction.swift */,
DC33939C22E076E300DD3DA4 /* MakeUnavailableOfflineAction.swift */,
DC815C3E2A65D9CB00BFF393 /* AvailableOfflineAction.swift */,
6E586CFD2199A75900F680C4 /* MoveAction.swift */,
6E586CFB2199A72600F680C4 /* OpenInAction.swift */,
6E3A103D219D5BBA00F90C96 /* RenameAction.swift */,
Expand Down Expand Up @@ -4307,7 +4304,6 @@
4C7295D8228C384E00FA4E68 /* LogFilesViewController.swift in Sources */,
DC01CDCC212EDDF600FC8E38 /* TextViewController.swift in Sources */,
4CB8ADE622DF6C2B00F1FEBC /* CIImage+Extensions.swift in Sources */,
DC33939D22E076E300DD3DA4 /* MakeUnavailableOfflineAction.swift in Sources */,
3998F5D72241486F00B66713 /* OCCertificate+Extension.swift in Sources */,
6E4F1734217749910049A71B /* ImageDisplayViewController.swift in Sources */,
DC8EB271239308E5009148F9 /* LicenseOffersViewController.swift in Sources */,
Expand All @@ -4332,6 +4328,7 @@
4C464BF02187AF1500D30602 /* PDFTocTableViewController.swift in Sources */,
3961281622F8730A0087BD3A /* SceneDelegate.swift in Sources */,
DCA35D8124D1707100DBE2B0 /* OCSyncRecordActivity+DiagnosticGenerator.swift in Sources */,
DC815C3F2A65D9CB00BFF393 /* AvailableOfflineAction.swift in Sources */,
4CB8ADE022DF5EC500F1FEBC /* UIAlertViewController+SystemPermissions.swift in Sources */,
392DDB1424CF024D009E5406 /* ImportFilesController.swift in Sources */,
396C82FB2319AFDD00938262 /* CollaborateAction.swift in Sources */,
Expand Down Expand Up @@ -4425,7 +4422,6 @@
DCDA83852A9CE6C300BFF393 /* InitialSetupViewController.swift in Sources */,
23EC77592137F3DD0032D4E6 /* DisplayExtension.swift in Sources */,
DCDF58B323CE82E100080BEB /* LicenseInAppPurchaseFeatureView.swift in Sources */,
DC33939622E0747400DD3DA4 /* MakeAvailableOfflineAction.swift in Sources */,
02D4C82A255208E60000E299 /* PDFSearchResultsView.swift in Sources */,
39057AA3233BA7A60008E6C0 /* Intents.intentdefinition in Sources */,
6E586CFE2199A75900F680C4 /* MoveAction.swift in Sources */,
Expand Down
3 changes: 1 addition & 2 deletions ownCloud/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
OCExtensionManager.shared.addExtension(UploadMediaAction.actionExtension)
OCExtensionManager.shared.addExtension(UploadCameraMediaAction.actionExtension)
OCExtensionManager.shared.addExtension(UnshareAction.actionExtension)
OCExtensionManager.shared.addExtension(MakeAvailableOfflineAction.actionExtension)
OCExtensionManager.shared.addExtension(MakeUnavailableOfflineAction.actionExtension)
OCExtensionManager.shared.addExtension(AvailableOfflineAction.actionExtension)
OCExtensionManager.shared.addExtension(CollaborateAction.actionExtension)
OCExtensionManager.shared.addExtension(FavoriteAction.actionExtension)
OCExtensionManager.shared.addExtension(UnfavoriteAction.actionExtension)
Expand Down
2 changes: 2 additions & 0 deletions ownCloud/Bookmarks/BookmarkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,15 @@ class BookmarkViewController: StaticTableViewController {
self?.composeSectionsAndRows(animated: true)
}
}, placeholder: "Username".localized, autocorrectionType: .no, identifier: "row-credentials-username", accessibilityLabel: "Server Username".localized)
usernameRow?.textField?.textContentType = .username

passwordRow = StaticTableViewRow(secureTextFieldWithAction: { [weak self] (_, sender, action) in
if (sender as? UITextField) != nil, self?.bookmark?.authenticationData != nil, action == .changed {
self?.bookmark?.authenticationData = nil
self?.composeSectionsAndRows(animated: true)
}
}, placeholder: "Password".localized, autocorrectionType: .no, identifier: "row-credentials-password", accessibilityLabel: "Server Password".localized)
passwordRow?.textField?.textContentType = .password

addPasswordManagerButton()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
//
// AvailableOfflineAction.swift
// ownCloud
//
// Created by Felix Schwarz on 17.07.23.
// Copyright © 2023 ownCloud GmbH. All rights reserved.
//

/*
* Copyright (C) 2023, ownCloud GmbH.
*
* This code is covered by the GNU Public License Version 3.
*
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>.
*
*/

import UIKit
import ownCloudSDK
import ownCloudAppShared

class AvailableOfflineAction: Action {
override class var identifier : OCExtensionIdentifier? { return OCExtensionIdentifier("com.owncloud.action.availableOffline") }
override class var category : ActionCategory? { return .normal }
override class var name : String? { return "Make available offline".localized }
override class var locations : [OCExtensionLocationIdentifier]? { return [.moreItem, .moreDetailItem, .moreFolder, .keyboardShortcut, .contextMenuItem] }
override class var keyCommand : String? { return "O" }
override class var keyModifierFlags: UIKeyModifierFlags? { return [.command, .alternate] }

// MARK: - Extension matching
override class func applicablePosition(forContext context: ActionContext) -> ActionPosition {
guard context.items.count > 0, let core = context.core else {
return .none
}

for item in context.items {
if let itemLocation = item.location, let policies = core.retrieveAvailableOfflinePoliciesCovering(item, completionHandler: nil) {
for policy in policies {
// Only show if item is not already available offline via parent item
if let policyLocation = policy.location, itemLocation.isLocated(in: policyLocation) && itemLocation != policyLocation {
return .none
}
}
}
}

return .middle
}

var isAvailableOffline: Bool {
get {
var availableOfflineCount: Int = 0

if let core {
for item in context.items {
if let policies = core.retrieveAvailableOfflinePoliciesCovering(item, completionHandler: nil) {
if policies.count > 0 {
availableOfflineCount += 1
}
}
}
}

return (availableOfflineCount == context.items.count)
}

set {
if let core {
if newValue {
// Make available offline
for item in context.items {
core.makeAvailableOffline(item, options: [.skipRedundancyChecks : true, .convertExistingLocalDownloads : true], completionHandler: nil)
}
} else {
// Make unavailable offline
for item in context.items {
if let itemPolicies = core.retrieveAvailableOfflinePoliciesCovering(item, completionHandler: nil) {
for itemPolicy in itemPolicies {
if (itemPolicy.location == item.location) || (itemPolicy.localID == item.localID) {
core.removeAvailableOfflinePolicy(itemPolicy, completionHandler: nil)
}
}
}
}
}
}
}
}

// MARK: - Action implementation
override func run() {
guard context.items.count > 0 else {
completed(with: NSError(ocError: .insufficientParameters))
return
}

let newAvailableOffline = !isAvailableOffline

isAvailableOffline = newAvailableOffline
availableOfflineSwitch?.isOn = isAvailableOffline

self.completed()
}

var availableOfflineSwitch: UISwitch?

override func provideStaticRow() -> StaticTableViewRow? {
if let staticRow = super.provideStaticRow() {
availableOfflineSwitch = UISwitch(frame: .zero, primaryAction: UIAction(handler: { [weak self] action in
if let self, let availableOfflineSwitch = self.availableOfflineSwitch {
self.isAvailableOffline = availableOfflineSwitch.isOn
}
}))

availableOfflineSwitch?.isOn = isAvailableOffline

staticRow.cell?.accessoryView = availableOfflineSwitch

return staticRow
}
return nil
}

override class func iconForLocation(_ location: OCExtensionLocationIdentifier) -> UIImage? {
return UIImage(named: "available-offline")?.withRenderingMode(.alwaysTemplate)
}

}
Loading
Loading