From ac069c0002d94dec357bf32e271d6b59136608d1 Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Wed, 3 Jun 2026 03:58:16 +0000 Subject: [PATCH 01/67] fix(l10n): Update translations from Transifex Signed-off-by: Nextcloud bot --- .../tr.lproj/Localizable.strings | Bin 104126 -> 104144 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/iOSClient/Supporting Files/tr.lproj/Localizable.strings b/iOSClient/Supporting Files/tr.lproj/Localizable.strings index 9fa83a0366add9fef023c90e267e0c2a23188b6e..f0d7c9a86b265130f6c699626675e7f7692a5b2c 100644 GIT binary patch delta 177 zcmdnDmhHk?wuUW?eW8;rJ_|)uG9)r6Fo4J+h7<-v#$1MEAgRER%}@#yDP_oE$OX#f z0>$DP^?)j!fMN;^#XvF-h?9XBVnQUE36uBT5aZ567&ZN)J)@{@CBrwMzEp-1hD@N| kOdvaxp$ceTCeWT#Ae|1BFJkz^5YPCBA#b~97-Oje0MPO(b^rhX delta 206 zcmcbxmTli!wuUW?eWCS^48=g03B)A~i41u_QUT0U0J8I;ygaCE4nqz@DnklTMLtkg z0VtaRRa*=cFJdSIlX^fIkg3@~x)P|e6eyzrG&_YM7pOW9YF80Zq=X^g1}q6=0F{6w bA Date: Wed, 31 Jan 2024 10:02:05 +0100 Subject: [PATCH 02/67] Add custom build for debugging merge --- .github/workflows/nmc-custom-client.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/nmc-custom-client.yml diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml new file mode 100644 index 0000000000..71ce2a4f46 --- /dev/null +++ b/.github/workflows/nmc-custom-client.yml @@ -0,0 +1,37 @@ +### +# SPDX-License-Identifier: AGPL-3.0 +# +# Author: Bernd rederlechner +# +# Builds a stable release package based on a release assembly +# customisation-- +# +# As soon as a package is deployed to production, the tag and the branch +# MUST STAY FOR 2 years and not deleted. +# +# Release packages, tags and customisation branches not delivered to production should +# be deleted asap a newer release is available. +# + +name: MCLOUD custom client merge + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Custom build from base branch + options: + - master + - stable-4.9.7 + # - v3.0.8 + default: master + +jobs: + assemble-custom: + uses: nextmcloud/.github/.github/workflows/nmc-custom-client.yml@master + with: + trunk: 'master' + stable: ${{ inputs.branch }} + result: ${{ format('customisation-{0}-{1}', github.actor, inputs.branch) }} + secrets: inherit \ No newline at end of file From f37d89f2f9f26da5b7bfbae5d6e59161e779440a Mon Sep 17 00:00:00 2001 From: "Bernd.Rederlechner@t-systems.com" Date: Mon, 12 Feb 2024 16:37:32 +0100 Subject: [PATCH 03/67] Add script for automatic backport PR creation --- .github/workflows/nmc-custom-stables.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/nmc-custom-stables.yml diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml new file mode 100644 index 0000000000..8062414c0f --- /dev/null +++ b/.github/workflows/nmc-custom-stables.yml @@ -0,0 +1,36 @@ +### +# SPDX-License-Identifier: AGPL-3.0 +# +# Author: Bernd rederlechner +# +# Builds a stable release package based on a release assembly +# customisation-- +# +# As soon as a package is deployed to production, the tag and the branch +# MUST STAY FOR 2 years and not deleted. +# +# Release packages, tags and customisation branches not delivered to production should +# be deleted asap a newer release is available. +# + +name: MCLOUD create stable backports + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Custom build from base branch + options: + - stable-4.9.7 + - 4.9.6 + - 4.9.5 + default: stable-4.9.7 + +jobs: + backport-custom: + uses: nextmcloud/.github/.github/workflows/nmc-custom-stables.yml@master + with: + trunk: 'master' + stable: ${{ inputs.branch }} + secrets: inherit \ No newline at end of file From e8f94c1b16a6fa19cdc522a9b0c28378ecac312b Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:09:32 +0530 Subject: [PATCH 04/67] Update script for adding new stable branch --- .github/workflows/nmc-custom-stables.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 8062414c0f..9058d719ed 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,10 +22,11 @@ on: type: choice description: Custom build from base branch options: + - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-4.9.7 + default: stable-5.2.1 jobs: backport-custom: @@ -33,4 +34,4 @@ jobs: with: trunk: 'master' stable: ${{ inputs.branch }} - secrets: inherit \ No newline at end of file + secrets: inherit From e28e7f91fd98850176b79d87045dda30d9c27005 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 15 Apr 2024 18:28:46 +0530 Subject: [PATCH 05/67] Update stable branch 5.2.7 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 9058d719ed..c1b444820d 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,11 +22,12 @@ on: type: choice description: Custom build from base branch options: + - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.2.1 + default: stable-5.2.7 jobs: backport-custom: From c8324af1e62fe5b18544f2c17fdecd168180e4d2 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 22 May 2024 12:27:39 +0530 Subject: [PATCH 06/67] Update new version 5.2.7 --- .github/workflows/nmc-custom-client.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 71ce2a4f46..bffac0f70b 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -24,6 +24,8 @@ on: options: - master - stable-4.9.7 + - stable-5.2.1 + - stable-5.2.7 # - v3.0.8 default: master @@ -34,4 +36,4 @@ jobs: trunk: 'master' stable: ${{ inputs.branch }} result: ${{ format('customisation-{0}-{1}', github.actor, inputs.branch) }} - secrets: inherit \ No newline at end of file + secrets: inherit From 8ef00a7befceec42ada81104eff08f7cb3fb28a1 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:58:51 +0530 Subject: [PATCH 07/67] Update nmc-custom-client.yml --- .github/workflows/nmc-custom-client.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index bffac0f70b..42f6190758 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -26,6 +26,7 @@ on: - stable-4.9.7 - stable-5.2.1 - stable-5.2.7 + - stable-5.5.0 # - v3.0.8 default: master From 0e559453ab49cb8de25b6b495b1fd8016f5a2b3a Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:07:07 +0530 Subject: [PATCH 08/67] Update nmc-custom-stables.yml Added new stable 5.5.4 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index c1b444820d..aa1b6ca733 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,12 +22,13 @@ on: type: choice description: Custom build from base branch options: + - stable-5.5.4 - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.2.7 + default: stable-5.5.4 jobs: backport-custom: From 44c941a4d1b3ccc1e7aa27d0574f7f0b1a8b6d2e Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:41:09 +0530 Subject: [PATCH 09/67] Update nmc-custom-stables.yml for NC stable 5.5.5 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index aa1b6ca733..a9c6fa2b9d 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,13 +22,14 @@ on: type: choice description: Custom build from base branch options: + - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.5.4 + default: stable-5.5.5 jobs: backport-custom: From fe2018a161d72edb9659af7111152c320b8f2b81 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:42:57 +0530 Subject: [PATCH 10/67] Update nmc-custom-client.yml for NC Stable 5.5.5 --- .github/workflows/nmc-custom-client.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 42f6190758..1c140fefec 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -27,6 +27,7 @@ on: - stable-5.2.1 - stable-5.2.7 - stable-5.5.0 + - stable-5.5.5 # - v3.0.8 default: master From 1dd2df86718177be7d4a9becfa59abc69dbf3a84 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 18 Nov 2024 14:57:36 +0530 Subject: [PATCH 11/67] Update nmc-custom-stables.yml for stable-6.1.3 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index a9c6fa2b9d..58cb823f28 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.1.3 - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 @@ -29,7 +30,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.5.5 + default: stable-6.1.3 jobs: backport-custom: From 9dfa40111e829da53dec5c246bd62c3bbd4e46cf Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 31 Mar 2025 14:56:50 +0530 Subject: [PATCH 12/67] Update nmc-custom-stables.yml Update nmc-custom-stables.yml for NC stable-6.2.7 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 58cb823f28..6494e6bb04 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 - stable-5.5.4 @@ -30,7 +31,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.1.3 + default: stable-6.2.7 jobs: backport-custom: From cb7637ea655234f08a121bf124d7410f82b0ffd5 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 31 Mar 2025 14:59:30 +0530 Subject: [PATCH 13/67] Update nmc-custom-client.yml Update nmc-custom-client.yml for NC Stable 6.2.7 --- .github/workflows/nmc-custom-client.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 1c140fefec..d7f0c57da2 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -28,6 +28,8 @@ on: - stable-5.2.7 - stable-5.5.0 - stable-5.5.5 + - stable-6.1.3 + - stable-6.2.7 # - v3.0.8 default: master From 192e83f9d1edf5185dfc394cabd526309e13964d Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Wed, 16 Apr 2025 17:45:12 +0530 Subject: [PATCH 14/67] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 6494e6bb04..5ddb738302 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.6.0 - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 @@ -31,7 +32,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.2.7 + default: stable-6.6.0 jobs: backport-custom: From fdee6fdf9c61fcd5567854613d3b97a94064c21d Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 13:56:34 +0530 Subject: [PATCH 15/67] Update nmc-custom-stables.yml for NC Stable 6.5.0 --- .github/workflows/nmc-custom-stables.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 5ddb738302..d418101a89 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,7 +22,7 @@ on: type: choice description: Custom build from base branch options: - - stable-6.6.0 + - stable-6.5.0 - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 @@ -32,7 +32,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.6.0 + default: stable-6.5.0 jobs: backport-custom: From ad7a1c72606333b844d5bdf422fa25391f055ea4 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 15:23:20 +0530 Subject: [PATCH 16/67] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index d418101a89..ac0f14243f 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.6.0 - stable-6.5.0 - stable-6.2.7 - stable-6.1.3 @@ -32,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.5.0 + default: stable-6.6.0 jobs: backport-custom: From f96421322491f7887216afc525969adbebbb9b0c Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 17/67] NMC 2161 - Menu option images and color theming changes --- .../File Provider Extension UI.xcscheme | 1 - .../WidgetDashboardIntentHandler.xcscheme | 1 - .../NCSelectableNavigationView.swift | 104 ++++++ iOSClient/Menu/AppDelegate+Menu.swift | 319 ++++++++++++++++++ 4 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 iOSClient/Main/Collection Common/NCSelectableNavigationView.swift create mode 100644 iOSClient/Menu/AppDelegate+Menu.swift diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 1427acf032..49c9d063cb 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 7b72936fb9..58dc296fe0 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift new file mode 100644 index 0000000000..6f337e7f5a --- /dev/null +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -0,0 +1,104 @@ +// +// NCSelectableNavigationView.swift +// Nextcloud +// +// Created by Henrik Storch on 27.01.22. +// Copyright © 2022 Henrik Storch. All rights reserved. +// +// Author Marino Faggiana +// Author Henrik Storch +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +import NextcloudKit +import Realm +import UIKit + +extension RealmSwiftObject { + var primaryKeyValue: String? { + guard let primaryKeyName = self.objectSchema.primaryKeyProperty?.name else { return nil } + return value(forKey: primaryKeyName) as? String + } +} + +public protocol NCSelectableViewTabBar { + var tabBarController: UITabBarController? { get } + var hostingController: UIViewController? { get } +} + +protocol NCSelectableNavigationView: AnyObject { + var viewController: UIViewController { get } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } + var selectIndexPaths: [IndexPath] { get set } + var titleCurrentFolder: String { get } + var navigationItem: UINavigationItem { get } + var navigationController: UINavigationController? { get } + var layoutKey: String { get } + var serverUrl: String { get } + var tabBarSelect: NCSelectableViewTabBar? { get set } + + func reloadDataSource(withQueryDB: Bool) + func setNavigationLeftItems() + func setNavigationRightItems(enableMenu: Bool) + func createMenuActions() -> [NCMenuAction] + + func toggleSelect(isOn: Bool?) + func onListSelected() + func onGridSelected() +} + +extension NCSelectableNavigationView { + func setNavigationLeftItems() {} + + func saveLayout(_ layoutForView: NCDBLayoutForView) { + NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView) + NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource) + setNavigationRightItems(enableMenu: false) + } + + /// If explicit `isOn` is not set, it will invert `isEditMode` + func toggleSelect(isOn: Bool? = nil) { + DispatchQueue.main.async { + self.isEditMode = isOn ?? !self.isEditMode + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() + self.setNavigationLeftItems() + self.setNavigationRightItems(enableMenu: true) + self.collectionView.reloadData() + } + } + + func collectionViewSelectAll() { + selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) + collectionView.reloadData() + setNavigationRightItems(enableMenu: false) + } + + func tapNotification() { + if let viewController = UIStoryboard(name: "NCNotification", bundle: nil).instantiateInitialViewController() as? NCNotification { + navigationController?.pushViewController(viewController, animated: true) + } + } +} + +extension NCSelectableNavigationView where Self: UIViewController { + var viewController: UIViewController { + self + } +} diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift new file mode 100644 index 0000000000..7041b8eaa9 --- /dev/null +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -0,0 +1,319 @@ +// +// AppDelegate+Menu.swift +// Nextcloud +// +// Created by Philippe Weidmann on 24.01.20. +// Copyright © 2020 Philippe Weidmann. All rights reserved. +// Copyright © 2020 Marino Faggiana All rights reserved. +// +// Author Philippe Weidmann +// Author Marino Faggiana +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +import UIKit +import FloatingPanel +import NextcloudKit + +extension AppDelegate { + func toggleMenu(controller: NCMainTabBarController, sender: Any?) { + var actions: [NCMenuAction] = [] + let session = NCSession.shared.getSession(controller: controller) + let utilityFileSystem = NCUtilityFileSystem() + let serverUrl = controller.currentServerUrl() + let isDirectoryE2EE = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, account: session.account) + let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) + let utility = NCUtility() + let capabilities = NKCapabilities.shared.getCapabilitiesBlocking(for: session.account) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_upload_photos_videos_", comment: ""), + icon: utility.loadImage(named: "photo", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in + if hasPermission {NCPhotosPickerViewController(controller: controller, maxSelectedAssets: 0, singleSelectedMode: false) + } + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_upload_file_", comment: ""), + icon: utility.loadImage(named: "doc", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) + } + ) + ) + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "text" }), + !isDirectoryE2EE { + actions.append( + NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), + icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + Task { + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + creator.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + NCCreateDocument().createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "text", creatorId: creator.identifier, templateId: "document", account: session.account) + } +// let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! +// guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { +// return +// } +// navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorText +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.editorText +// viewController.serverUrl = appDelegate.activeServerUrl +// viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") +// appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil) +// } + }) + ) + } + + actions.append( + NCMenuAction( + title: NSLocalizedString("_scans_document_", comment: ""), + icon: utility.loadImage(named: "doc.text.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCDocumentCamera.shared.openScannerDocument(viewController: controller) + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_voice_memo_", comment: ""), + icon: utility.loadImage(named: "mic", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in + if hasPermission { + if let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController { + viewController.controller = controller + viewController.modalTransitionStyle = .crossDissolve + viewController.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext + controller.present(viewController, animated: true, completion: nil) + } + } + } + } + ) + ) + + if NCKeychain().isEndToEndEnabled(account: session.account) { + actions.append(.seperator(order: 0, sender: sender)) + } + + let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") + let imageCreateFolder = isDirectoryE2EE ? NCImageCache.shared.getFolderEncrypted(account: session.account) : NCImageCache.shared.getFolder(account: session.account) + actions.append( + NCMenuAction(title: titleCreateFolder, + icon: imageCreateFolder, + sender: sender, + action: { _ in + let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, sceneIdentifier: controller.sceneIdentifier) + controller.present(alertController, animated: true, completion: nil) + } + ) + ) + + // Folder encrypted + if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { + // Folder encrypted (ONLY ROOT) +// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: appDelegate.account) && (NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) == appDelegate.activeServerUrl) { + actions.append( + NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), + icon: NCImageCache.shared.getFolderEncrypted(account: session.account), + sender: sender, + action: { _ in + let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) + controller.present(alertController, animated: true, completion: nil) + }) + ) + } + + if NCKeychain().isEndToEndEnabled(account: session.account) { + actions.append(.seperator(order: 0, sender: sender)) + } + + if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { + actions.append( + NCMenuAction( + title: NSLocalizedString("_add_folder_info_", comment: ""), + icon: NCUtility().loadImage(named: "list.dash.header.rectangle", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + let richWorkspaceCommon = NCRichWorkspaceCommon() + if let viewController = controller.currentViewController() { + if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", + session.account, + serverUrl, + NCGlobal.shared.fileNameRichWorkspace.lowercased())) == nil { + richWorkspaceCommon.createViewerNextcloudText(serverUrl: serverUrl, viewController: viewController, session: session) + } else { + richWorkspaceCommon.openViewerNextcloudText(serverUrl: serverUrl, viewController: viewController, session: session) + } + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_docx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_document_", comment: ""), + icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.documentIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_xlsx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), + icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_pptx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_presentation_", comment: ""), + icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if capabilities.richDocumentsEnabled { + if NextcloudKit.shared.isNetworkReachable() && !isDirectoryE2EE { + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_document_", comment: ""), + icon: utility.loadImage(named: "doc.richtext", colors: [NCBrandColor.shared.documentIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), + icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_presentation_", comment: ""), + icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + } + + controller.presentMenu(with: actions, controller: controller, sender: sender) + } +} From 0f6c22c8f64d00ea6d47618ea7e1b9ace14cd758 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 18/67] NMC 2161 - Menu option images and color theming and other changes --- Nextcloud.xcodeproj/project.pbxproj | 10 +- .../File Provider Extension UI.xcscheme | 1 + .../WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 127 ++++++++++++++---- 4 files changed, 112 insertions(+), 27 deletions(-) diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index da11cd9ed5..910db2b50b 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -85,6 +85,10 @@ AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */; }; AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; }; CB3666201AF7550816B5CD6A /* NCContextMenuComment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8932E90EC4278026D86CCCC9 /* NCContextMenuComment.swift */; }; + AFCE353927E5DE0500FEA6C2 /* NCShare+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */; }; + B52FAED52DA8F616001AB1BD /* NCSelectableNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */; }; + C04E2F232A17BB4D001BAD85 /* FilesIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04E2F222A17BB4D001BAD85 /* FilesIntegrationTests.swift */; }; + D575039F27146F93008DC9DC /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; }; D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; }; F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */; }; F31165022F9674A1009A1E37 /* AppIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = F31165012F9674A1009A1E37 /* AppIcon.icon */; }; @@ -1261,8 +1265,8 @@ AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+Extension.swift"; sourceTree = ""; }; AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareCells.swift; sourceTree = ""; }; AFCE353827E5DE0400FEA6C2 /* Shareable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shareable.swift; sourceTree = ""; }; - B4C7A5B36D1ED178FB6B76CB /* NCContextMenuPlayerTracks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCContextMenuPlayerTracks.swift; sourceTree = ""; }; - BB7697C94BA14450A0867940 /* NCContextMenuProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCContextMenuProfile.swift; sourceTree = ""; }; + AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCShare+Helper.swift"; sourceTree = ""; }; + B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSelectableNavigationView.swift; sourceTree = ""; }; C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = ""; }; @@ -2549,6 +2553,7 @@ F7603298252F0E550015A421 /* Collection Common */ = { isa = PBXGroup; children = ( + B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */, F75FE06B2BB01D0D00A0EFEF /* Cell */, F70D7C3525FFBF81002B9E34 /* NCCollectionViewCommon.swift */, F76995F32F9A4AC000291FA7 /* NCCollectionViewCommon+UIEditMenuInteractionDelegate.swift */, @@ -4854,6 +4859,7 @@ F7FFFCA22FB300600015441E /* NCAssistantSharedTextStore.swift in Sources */, F3DDFE0F2F15453900A784C8 /* NCAssistantChat.swift in Sources */, F7D68FCC28CB9051009139F3 /* NCManageDatabase+DashboardWidget.swift in Sources */, + B52FAED52DA8F616001AB1BD /* NCSelectableNavigationView.swift in Sources */, F76882292C0DD1E7001CF441 /* NCManageE2EEModel.swift in Sources */, F7CCAB512ECF316700F8E68B /* NCCollectionViewCommon+SyncMetadata.swift in Sources */, AA8E041D2D300FDE00E7E89C /* NCShareNetworkingDelegate.swift in Sources */, diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 49c9d063cb..1427acf032 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 58dc296fe0..7b72936fb9 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index 7041b8eaa9..a06680d3e9 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -41,7 +41,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_upload_photos_videos_", comment: ""), - icon: utility.loadImage(named: "photo", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in @@ -55,7 +55,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_upload_file_", comment: ""), - icon: utility.loadImage(named: "doc", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) @@ -68,7 +68,7 @@ extension AppDelegate { !isDirectoryE2EE { actions.append( NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), - icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in Task { @@ -86,9 +86,9 @@ extension AppDelegate { // viewController.editorId = NCGlobal.shared.editorText // viewController.creatorId = directEditingCreator.identifier // viewController.typeTemplate = NCGlobal.shared.editorText -// viewController.serverUrl = appDelegate.activeServerUrl +// viewController.serverUrl = serverUrl // viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") -// appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil) +// controller.present(navigationController, animated: true, completion: nil) // } }) ) @@ -97,7 +97,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_scans_document_", comment: ""), - icon: utility.loadImage(named: "doc.text.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), + icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCDocumentCamera.shared.openScannerDocument(viewController: controller) @@ -108,7 +108,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_voice_memo_", comment: ""), - icon: utility.loadImage(named: "mic", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in @@ -130,7 +130,7 @@ extension AppDelegate { } let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") - let imageCreateFolder = isDirectoryE2EE ? NCImageCache.shared.getFolderEncrypted(account: session.account) : NCImageCache.shared.getFolder(account: session.account) + let imageCreateFolder = isDirectoryE2EE ? UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50) : UIImage(named: "addFolder")! actions.append( NCMenuAction(title: titleCreateFolder, icon: imageCreateFolder, @@ -145,10 +145,10 @@ extension AppDelegate { // Folder encrypted if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { // Folder encrypted (ONLY ROOT) -// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: appDelegate.account) && (NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) == appDelegate.activeServerUrl) { +// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { actions.append( NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), - icon: NCImageCache.shared.getFolderEncrypted(account: session.account), + icon: UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) @@ -165,7 +165,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_add_folder_info_", comment: ""), - icon: NCUtility().loadImage(named: "list.dash.header.rectangle", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in let richWorkspaceCommon = NCRichWorkspaceCommon() @@ -190,17 +190,30 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_document_", comment: ""), - icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.documentIconColor]), + icon: UIImage(named: "create_file_document")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + // if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + // viewController.editorId = NCGlobal.shared.editorOnlyoffice + // viewController.creatorId = directEditingCreator.identifier + // viewController.typeTemplate = NCGlobal.shared.templateDocument + // viewController.serverUrl = serverUrl + // viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") + // + // controller.present(navigationController, animated: true, completion: nil) + // } } } ) @@ -213,10 +226,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + icon: UIImage(named: "create_file_xls")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) @@ -224,6 +241,15 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorOnlyoffice +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -236,10 +262,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + icon: UIImage(named: "create_file_ppt")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) @@ -247,6 +277,15 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorOnlyoffice +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.templatePresentation +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -258,10 +297,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_document_", comment: ""), - icon: utility.loadImage(named: "doc.richtext", colors: [NCBrandColor.shared.documentIconColor]), + icon: UIImage(named: "create_file_document")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) @@ -269,6 +312,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templateDocument +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -277,10 +328,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + icon: UIImage(named: "create_file_xls")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) @@ -288,6 +343,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -296,10 +359,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + icon: UIImage(named: "create_file_ppt")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) @@ -307,6 +374,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templatePresentation +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -314,6 +389,8 @@ extension AppDelegate { } } - controller.presentMenu(with: actions, controller: controller, sender: sender) +// controller.presentMenu(with: actions, controller: controller, sender: sender) + AnalyticsHelper.shared.trackEvent(eventName: .EVENT__ACTION_BUTTON) + controller.presentMenu(with: actions) } } From 314cdced60eed2da77ad0c3df60b199e9931ffc2 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 19/67] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 22 +- iOSClient/Menu/AppDelegate+Menu.swift | 262 ++++++------------ 2 files changed, 94 insertions(+), 190 deletions(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 6f337e7f5a..94715d4e44 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,20 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } - var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } - var selectOcId: [String] { get set } - var selectIndexPaths: [IndexPath] { get set } + var fileSelect: [String] { get set } var titleCurrentFolder: String { get } var navigationItem: UINavigationItem { get } var navigationController: UINavigationController? { get } var layoutKey: String { get } var serverUrl: String { get } - var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] @@ -76,8 +73,7 @@ extension NCSelectableNavigationView { func toggleSelect(isOn: Bool? = nil) { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode - self.selectOcId.removeAll() - self.selectIndexPaths.removeAll() + self.fileSelect.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -85,7 +81,8 @@ extension NCSelectableNavigationView { } func collectionViewSelectAll() { - selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) + + fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } @@ -95,6 +92,15 @@ extension NCSelectableNavigationView { navigationController?.pushViewController(viewController, animated: true) } } + + func tapTransfer() { + if let navController = UIStoryboard(name: "NCTransfers", bundle: nil).instantiateInitialViewController() as? UINavigationController, + let viewController = navController.topViewController as? NCTransfers { + viewController.modalPresentationStyle = .pageSheet +// self.present(navigationController, animated: true, completion: nil) + navigationController?.present(navController, animated: true, completion: nil) + } + } } extension NCSelectableNavigationView where Self: UIViewController { diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index a06680d3e9..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -28,22 +28,18 @@ import FloatingPanel import NextcloudKit extension AppDelegate { - func toggleMenu(controller: NCMainTabBarController, sender: Any?) { + func toggleMenu(controller: NCMainTabBarController) { var actions: [NCMenuAction] = [] let session = NCSession.shared.getSession(controller: controller) - let utilityFileSystem = NCUtilityFileSystem() + let directEditingCreators = NCManageDatabase.shared.getDirectEditingCreators(account: session.account) let serverUrl = controller.currentServerUrl() let isDirectoryE2EE = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, account: session.account) let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) let utility = NCUtility() - let capabilities = NKCapabilities.shared.getCapabilitiesBlocking(for: session.account) actions.append( NCMenuAction( - title: NSLocalizedString("_upload_photos_videos_", comment: ""), - icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_upload_photos_videos_", comment: ""), icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in if hasPermission {NCPhotosPickerViewController(controller: controller, maxSelectedAssets: 0, singleSelectedMode: false) } @@ -54,52 +50,35 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_upload_file_", comment: ""), - icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_upload_file_", comment: ""), icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) } ) ) - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "text" }), - !isDirectoryE2EE { + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorText}) && !isDirectoryE2EE { actions.append( - NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), - icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in - Task { - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + creator.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - - NCCreateDocument().createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "text", creatorId: creator.identifier, templateId: "document", account: session.account) - } -// let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! -// guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { -// return -// } -// navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorText -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.editorText -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") -// controller.present(navigationController, animated: true, completion: nil) -// } + NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorText + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.editorText + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") + controller.present(navigationController, animated: true, completion: nil) + } }) ) } actions.append( NCMenuAction( - title: NSLocalizedString("_scans_document_", comment: ""), - icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_scans_document_", comment: ""), icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCDocumentCamera.shared.openScannerDocument(viewController: controller) } ) @@ -107,10 +86,7 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_voice_memo_", comment: ""), - icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_create_voice_memo_", comment: ""), icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in if hasPermission { if let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController { @@ -126,30 +102,25 @@ extension AppDelegate { ) if NCKeychain().isEndToEndEnabled(account: session.account) { - actions.append(.seperator(order: 0, sender: sender)) + actions.append(.seperator(order: 0)) } let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") let imageCreateFolder = isDirectoryE2EE ? UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50) : UIImage(named: "addFolder")! actions.append( NCMenuAction(title: titleCreateFolder, - icon: imageCreateFolder, - sender: sender, - action: { _ in + icon: imageCreateFolder, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, sceneIdentifier: controller.sceneIdentifier) controller.present(alertController, animated: true, completion: nil) } ) ) - // Folder encrypted - if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { // Folder encrypted (ONLY ROOT) -// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { + if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { actions.append( NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), icon: UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) controller.present(alertController, animated: true, completion: nil) @@ -158,16 +129,13 @@ extension AppDelegate { } if NCKeychain().isEndToEndEnabled(account: session.account) { - actions.append(.seperator(order: 0, sender: sender)) + actions.append(.seperator(order: 0)) } - if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { + if NCCapabilities.shared.getCapabilities(account: session.account).capabilityServerVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { actions.append( NCMenuAction( - title: NSLocalizedString("_add_folder_info_", comment: ""), - icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_add_folder_info_", comment: ""), icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in let richWorkspaceCommon = NCRichWorkspaceCommon() if let viewController = controller.currentViewController() { if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", @@ -184,142 +152,95 @@ extension AppDelegate { ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_docx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeDocx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeDocx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_document_", comment: ""), - icon: UIImage(named: "create_file_document")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_document_", comment: ""), icon: UIImage(named: "create_file_document")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) - // if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { - // viewController.editorId = NCGlobal.shared.editorOnlyoffice - // viewController.creatorId = directEditingCreator.identifier - // viewController.typeTemplate = NCGlobal.shared.templateDocument - // viewController.serverUrl = serverUrl - // viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") - // - // controller.present(navigationController, animated: true, completion: nil) - // } + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templateDocument + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") + + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_xlsx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeXlsx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeXlsx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: UIImage(named: "create_file_xls")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: UIImage(named: "create_file_xls")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorOnlyoffice -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_pptx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficePptx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficePptx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: UIImage(named: "create_file_ppt")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: UIImage(named: "create_file_ppt")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templatePresentation + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorOnlyoffice -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.templatePresentation -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if capabilities.richDocumentsEnabled { + if NCCapabilities.shared.getCapabilities(account: session.account).capabilityRichDocumentsEnabled { if NextcloudKit.shared.isNetworkReachable() && !isDirectoryE2EE { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_document_", comment: ""), - icon: UIImage(named: "create_file_document")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_document_", comment: ""), icon: UIImage(named: "create_file_document")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templateDocument + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templateDocument -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -327,30 +248,19 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: UIImage(named: "create_file_xls")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: UIImage(named: "create_file_xls")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -358,30 +268,19 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: UIImage(named: "create_file_ppt")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: UIImage(named: "create_file_ppt")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templatePresentation + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templatePresentation -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -389,7 +288,6 @@ extension AppDelegate { } } -// controller.presentMenu(with: actions, controller: controller, sender: sender) AnalyticsHelper.shared.trackEvent(eventName: .EVENT__ACTION_BUTTON) controller.presentMenu(with: actions) } From d80143586ce81d96c537d4fef5801052ae0b1f44 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 13:56:34 +0530 Subject: [PATCH 20/67] Update nmc-custom-stables.yml for NC Stable 6.5.0 --- .github/workflows/nmc-custom-stables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index ac0f14243f..2ec6976ef2 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -33,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.6.0 + default: stable-6.5.0 jobs: backport-custom: From ae8df13cca62d9fca7f84402b44cb23e16c37cb7 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 15:23:20 +0530 Subject: [PATCH 21/67] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 2ec6976ef2..ac0f14243f 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -33,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.5.0 + default: stable-6.6.0 jobs: backport-custom: From 3138a187012ede7980612a1b38e95aa5db36372e Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 22/67] NMC 2161 - Menu option images and color theming changes --- .../xcschemes/File Provider Extension UI.xcscheme | 1 - .../xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 - .../Main/Collection Common/NCSelectableNavigationView.swift | 5 +++++ iOSClient/Menu/AppDelegate+Menu.swift | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 1427acf032..49c9d063cb 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 7b72936fb9..58dc296fe0 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 94715d4e44..04b08c5606 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -44,6 +44,8 @@ protocol NCSelectableNavigationView: AnyObject { var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } + var appDelegate: AppDelegate { get } + var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } var navigationItem: UINavigationItem { get } var navigationController: UINavigationController? { get } @@ -51,6 +53,9 @@ protocol NCSelectableNavigationView: AnyObject { var serverUrl: String { get } // func reloadDataSource(withQueryDB: Bool) + var tabBarSelect: NCSelectableViewTabBar? { get set } + + func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index c2f3307daf..f228bdd55a 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,6 +170,7 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) + } } ) From a05c2cc95c5d0c3cb42790f4b35620ffdcd453a3 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 23/67] NMC 2161 - Menu option images and color theming and other changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 + .../xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 49c9d063cb..1427acf032 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 58dc296fe0..7b72936fb9 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index f228bdd55a..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,7 +170,6 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) - } } ) From bd1e8fe57c6e18c39419c7e7b7ae746d06f100f9 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 24/67] NMC 2161 - Menu option changes --- .../Main/Collection Common/NCSelectableNavigationView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 04b08c5606..2e07da992e 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -55,7 +55,7 @@ protocol NCSelectableNavigationView: AnyObject { // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] From b24508f8bfc8146d09dd2b3aa276abc749be12ab Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Tue, 16 Dec 2025 14:59:08 +0530 Subject: [PATCH 25/67] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 2e07da992e..17dbb04c03 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,10 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } +// var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } +// var selectIndexPaths: [IndexPath] { get set } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -51,10 +58,13 @@ protocol NCSelectableNavigationView: AnyObject { var navigationController: UINavigationController? { get } var layoutKey: String { get } var serverUrl: String { get } +// var tabBarSelect: NCSelectableViewTabBar? { get set } +// var dataSource: NCCollectionViewDataSource { get set } // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } + func reloadDataSource(withQueryDB: Bool) // func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) @@ -79,6 +89,9 @@ extension NCSelectableNavigationView { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() +// self.selectIndexPaths.removeAll() + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -88,6 +101,8 @@ extension NCSelectableNavigationView { func collectionViewSelectAll() { fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) +// fileSelect = NCCollectionViewDataSource().getMetadataSourceForAllSections().compactMap({ $0.primaryKeyValue }) +// selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } From 9c0461c6e7e6f1940b3bae8292e5d80dc4986141 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:09:32 +0530 Subject: [PATCH 26/67] Update script for adding new stable branch --- .github/workflows/nmc-custom-stables.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index ac0f14243f..176c03eb96 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -29,10 +29,6 @@ on: - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 - - stable-5.2.1 - - stable-4.9.7 - - 4.9.6 - - 4.9.5 default: stable-6.6.0 jobs: From 721f437a97a61eaa7ff04117ff2d9c8794f64f2f Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 27/67] NMC 2161 - Menu option images and color theming changes --- .../xcschemes/File Provider Extension UI.xcscheme | 1 - .../xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 - .../Collection Common/NCSelectableNavigationView.swift | 9 --------- 3 files changed, 11 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 1427acf032..49c9d063cb 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 7b72936fb9..58dc296fe0 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 17dbb04c03..9581332e68 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -46,11 +46,6 @@ protocol NCSelectableNavigationView: AnyObject { var isEditMode: Bool { get set } var fileSelect: [String] { get set } // var selectIndexPaths: [IndexPath] { get set } - var appDelegate: AppDelegate { get } - var selectableDataSource: [RealmSwiftObject] { get } - var collectionView: UICollectionView! { get set } - var isEditMode: Bool { get set } - var selectOcId: [String] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -90,8 +85,6 @@ extension NCSelectableNavigationView { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() // self.selectIndexPaths.removeAll() - self.selectOcId.removeAll() - self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -101,8 +94,6 @@ extension NCSelectableNavigationView { func collectionViewSelectAll() { fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) -// fileSelect = NCCollectionViewDataSource().getMetadataSourceForAllSections().compactMap({ $0.primaryKeyValue }) -// selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } From db21636ba28e57af8fe987766c0969fdb1f46c7a Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 28/67] NMC 2161 - Menu option images and color theming and other changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 + .../xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 + 2 files changed, 2 insertions(+) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 49c9d063cb..1427acf032 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 58dc296fe0..7b72936fb9 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> From 77162549bf9c267ecece298665acba35a3f2700c Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 29/67] NMC 2161 - Menu option changes --- .../Main/Collection Common/NCSelectableNavigationView.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 9581332e68..a7e5405e7b 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,7 +40,6 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } -// var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } @@ -84,7 +83,6 @@ extension NCSelectableNavigationView { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() -// self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() From 78a553290441278449cca6969e7a33d09ff3c021 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 30/67] NMC 2161 - Menu option images and color theming changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 - .../xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 - .../Main/Collection Common/NCSelectableNavigationView.swift | 2 -- iOSClient/Menu/AppDelegate+Menu.swift | 1 + 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 1427acf032..49c9d063cb 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 7b72936fb9..58dc296fe0 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index a7e5405e7b..befcfa43a7 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -44,7 +44,6 @@ protocol NCSelectableNavigationView: AnyObject { var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } -// var selectIndexPaths: [IndexPath] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -59,7 +58,6 @@ protocol NCSelectableNavigationView: AnyObject { var tabBarSelect: NCSelectableViewTabBar? { get set } func reloadDataSource(withQueryDB: Bool) -// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index c2f3307daf..f228bdd55a 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,6 +170,7 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) + } } ) From 51d6313e3fdde8f63904462739b48601a947cdfd Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 31/67] NMC 2161 - Menu option images and color theming and other changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 + .../xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 49c9d063cb..1427acf032 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 58dc296fe0..7b72936fb9 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index f228bdd55a..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,7 +170,6 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) - } } ) From dd232bb79ac3134be422e6dffe7b4a0102b4a9ba Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 32/67] NMC 2161 - Menu option changes --- .../Main/Collection Common/NCSelectableNavigationView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index befcfa43a7..5a11221cf8 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -57,7 +57,7 @@ protocol NCSelectableNavigationView: AnyObject { // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] From 264b643b42aac933ae453fb67843a47b936c5b3a Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Tue, 16 Dec 2025 14:59:08 +0530 Subject: [PATCH 33/67] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 5a11221cf8..17dbb04c03 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,10 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } +// var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } +// var selectIndexPaths: [IndexPath] { get set } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -57,6 +64,7 @@ protocol NCSelectableNavigationView: AnyObject { // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } + func reloadDataSource(withQueryDB: Bool) // func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) @@ -81,6 +89,9 @@ extension NCSelectableNavigationView { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() +// self.selectIndexPaths.removeAll() + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -90,6 +101,8 @@ extension NCSelectableNavigationView { func collectionViewSelectAll() { fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) +// fileSelect = NCCollectionViewDataSource().getMetadataSourceForAllSections().compactMap({ $0.primaryKeyValue }) +// selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } From 6ad9fb0655909ab65a9c817c5ff23e0d0f07fe4d Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Wed, 3 Jun 2026 14:29:47 +0200 Subject: [PATCH 34/67] Read owner and permissions from PUT response on new file creation (#4105) * WIP Signed-off-by: Milen Pivchev * WIP Signed-off-by: Milen Pivchev * WIP Signed-off-by: Milen Pivchev * WIP Signed-off-by: Milen Pivchev * Refactor Signed-off-by: Milen Pivchev * Refactor Signed-off-by: Milen Pivchev * Fix compile Signed-off-by: Milen Pivchev * down Signed-off-by: Marino Faggiana * prj Signed-off-by: Marino Faggiana * up Signed-off-by: Marino Faggiana * main Signed-off-by: Marino Faggiana * varie Signed-off-by: Marino Faggiana * dele Signed-off-by: Marino Faggiana * delegate Signed-off-by: Marino Faggiana * header2 Signed-off-by: Marino Faggiana * delegate Signed-off-by: Marino Faggiana * nk main Signed-off-by: Marino Faggiana * code cleaning Signed-off-by: Marino Faggiana * ownerDisplayName Signed-off-by: Marino Faggiana * ownerDisplayName Signed-off-by: Marino Faggiana * lint Signed-off-by: Marino Faggiana * fix query Signed-off-by: Marino Faggiana * Refactor Signed-off-by: Milen Pivchev --------- Signed-off-by: Milen Pivchev Signed-off-by: Marino Faggiana Co-authored-by: Marino Faggiana --- Brand/NCBrand.swift | 52 ++++++++++++++----- .../FileProviderData.swift | 24 ++++++--- Nextcloud.xcodeproj/project.pbxproj | 16 +++++- iOSClient/Assistant/NCAssistantModel.swift | 2 +- .../Data/NCManageDatabase+Metadata.swift | 16 ++++++ .../Data/NCMetadataTranfersSuccess.swift | 18 ++++++- iOSClient/Extensions/Optional+Extension.swift | 7 +++ ...ionViewCommon+CollectionViewDelegate.swift | 2 +- .../NCCollectionViewCommon+Search.swift | 2 +- .../Upload Assets/NCUploadAssetsModel.swift | 2 +- iOSClient/Media/NCMedia+Netwoking.swift | 17 ++---- iOSClient/Media/NCMediaDataSource.swift | 26 ++-------- iOSClient/Menu/NCContextMenuPlus.swift | 2 +- iOSClient/Menu/NCContextMenuProfile.swift | 2 +- iOSClient/NCGlobal.swift | 22 -------- .../E2EE/NCNetworkingE2EEUpload.swift | 26 ++++++++-- iOSClient/Networking/NCAutoUpload.swift | 4 +- .../Networking/NCNetworking+Download.swift | 33 +++++------- .../NCNetworking+NextcloudKitDelegate.swift | 43 +++++++-------- .../Networking/NCNetworking+ServerError.swift | 34 ++++++------ iOSClient/Networking/NCNetworking+Task.swift | 22 ++++---- .../NCNetworking+TermsOfService.swift | 12 ++--- .../NCNetworking+TransferDelegate.swift | 9 ++-- .../Networking/NCNetworking+Upload.swift | 51 ++++++++++++++---- .../Networking/NCNetworking+WebDAV.swift | 2 +- iOSClient/Networking/NCNetworking.swift | 1 + iOSClient/Networking/NCService.swift | 2 +- iOSClient/Utility/NCLivePhoto.swift | 2 +- .../NCPlayer/NCPlayerToolBar.swift | 6 ++- .../NCViewerRichDocument.swift | 18 ++++++- 30 files changed, 286 insertions(+), 189 deletions(-) diff --git a/Brand/NCBrand.swift b/Brand/NCBrand.swift index 0fd9b5b6a7..00550b2a58 100755 --- a/Brand/NCBrand.swift +++ b/Brand/NCBrand.swift @@ -20,6 +20,43 @@ let userAgent: String = { The codename embodies the concept of dynamic, living matter — reflecting our vision of a platform that is not only powerful and reliable, but also capable of continuous transformation and intelligent adaptation. */ +struct NextcloudVersion: Comparable { + let major: Int + let minor: Int + let micro: Int + + init(_ major: Int, _ minor: Int = 0, _ micro: Int = 0) { + self.major = major + self.minor = minor + self.micro = micro + } + + init(_ capabilities: NKCapabilities.Capabilities) { + self.major = capabilities.serverVersionMajor + self.minor = capabilities.serverVersionMinor + self.micro = capabilities.serverVersionMicro + } + + static let v18 = NextcloudVersion(18) + static let v20 = NextcloudVersion(20) + static let v23 = NextcloudVersion(23) + static let v24 = NextcloudVersion(24) + static let v25 = NextcloudVersion(25) + static let v26 = NextcloudVersion(26) + static let v27 = NextcloudVersion(27) + static let v28 = NextcloudVersion(28) + static let v30 = NextcloudVersion(30) + static let v31 = NextcloudVersion(31) + static let v32 = NextcloudVersion(32) + static let v32_0_2 = NextcloudVersion(32, 0, 2) + static let v33 = NextcloudVersion(33) + static let v34 = NextcloudVersion(34) + + static func < (lhs: NextcloudVersion, rhs: NextcloudVersion) -> Bool { + (lhs.major, lhs.minor, lhs.micro) < (rhs.major, rhs.minor, rhs.micro) + } +} + final class NCBrandOptions: @unchecked Sendable { static let shared = NCBrandOptions() @@ -129,19 +166,8 @@ final class NCBrandOptions: @unchecked Sendable { } func isServerVersion(_ capabilities: NKCapabilities.Capabilities, - greaterOrEqualTo major: Int, - _ minor: Int, - _ micro: Int) -> Bool { - - let server = ( - capabilities.serverVersionMajor, - capabilities.serverVersionMinor, - capabilities.serverVersionMicro - ) - - let required = (major, minor, micro) - - return server >= required + greaterOrEqualTo version: NextcloudVersion) -> Bool { + return NextcloudVersion(capabilities) >= version } } diff --git a/File Provider Extension/FileProviderData.swift b/File Provider Extension/FileProviderData.swift index 9c36bb5bf0..172beb53fe 100644 --- a/File Provider Extension/FileProviderData.swift +++ b/File Provider Extension/FileProviderData.swift @@ -90,7 +90,7 @@ class FileProviderData: NSObject { return isPaginated } else if serverUrl == NCUtilityFileSystem().getHomeServer(session: session), let capabilities = await NextcloudKit.shared.getCapabilitiesAsync(account: session.account).capabilities, - NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: 32, 0, 2) { + NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v32_0_2) { isPaginated = true return true } @@ -147,10 +147,7 @@ class FileProviderData: NSObject { func downloadComplete(fileName: String, serverUrl: String, - etag: String?, - date: Date?, - dateLastModified: Date?, - length: Int64, + allHeaderFields: [AnyHashable: Any]?, task: URLSessionTask, error: NKError) async { let taskIdentifier = task.taskIdentifier @@ -165,6 +162,7 @@ class FileProviderData: NSObject { } let ocId = metadata.ocId + let etag = NextcloudKit.shared.nkCommonInstance.findHeader("oc-etag", allHeaderFields: allHeaderFields) await NCManageDatabase.shared.setMetadataSessionAsync(ocId: ocId, session: "", @@ -196,7 +194,8 @@ class FileProviderData: NSObject { ocId: String?, etag: String?, date: Date?, - size: Int64, + ownerId: String?, + permissions: String?, task: URLSessionTask, error: NKError) async { guard let metadata = await NCManageDatabase.shared.getMetadataAsync(predicate: NSPredicate(format: "serverUrl == %@ AND fileName == %@ AND sessionTaskIdentifier == %d", serverUrl, fileName, task.taskIdentifier)) else { @@ -225,11 +224,22 @@ class FileProviderData: NSObject { metadata.uploadDate = (date as? NSDate) ?? NSDate() metadata.etag = etag ?? "" metadata.ocId = ocId - metadata.size = size + if let fileId = fileProviderUtility().ocIdToFileId(ocId: ocId) { metadata.fileId = fileId } + if let ownerId, !ownerId.isEmpty { + metadata.ownerId = ownerId + if let ownerDisplayName = await NCManageDatabase.shared.getOwnerDisplayName(account: metadata.account, ownerId: ownerId) { + metadata.ownerDisplayName = ownerDisplayName + } + } + + if let permissions, !permissions.isEmpty { + metadata.permissions = permissions + } + metadata.sceneIdentifier = nil metadata.session = "" metadata.sessionError = "" diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index da11cd9ed5..a3788d3efc 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -441,6 +441,13 @@ F75DD765290ABB25002EB562 /* Intent.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F75DD769290ABB25002EB562 /* Intent.intentdefinition */; }; F75DD766290ABB25002EB562 /* Intent.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F75DD769290ABB25002EB562 /* Intent.intentdefinition */; }; F75DD767290ABB25002EB562 /* Intent.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = F75DD769290ABB25002EB562 /* Intent.intentdefinition */; }; + F75F4BC02FD008D7009E55ED /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extension.swift */; }; + F75F4BC12FD008D7009E55ED /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extension.swift */; }; + F75F4BC22FD008D7009E55ED /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extension.swift */; }; + F75F4BC32FD008D7009E55ED /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extension.swift */; }; + F75F4BC42FD008D7009E55ED /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extension.swift */; }; + F75F4BC52FD008D7009E55ED /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extension.swift */; }; + F75F4BC62FD008D7009E55ED /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F343A4BA2A1E734600DDA874 /* Optional+Extension.swift */; }; F760DE032AE66EA80027D78A /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F760DE022AE66EA80027D78A /* KeychainAccess */; }; F760DE052AE66EBE0027D78A /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F760DE042AE66EBE0027D78A /* KeychainAccess */; }; F760DE072AE66EC70027D78A /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F760DE062AE66EC70027D78A /* KeychainAccess */; }; @@ -4163,6 +4170,7 @@ buildActionMask = 2147483647; files = ( F73EF7BD2B0224AB0087E6E9 /* NCManageDatabase+ExternalSites.swift in Sources */, + F75F4BC62FD008D7009E55ED /* Optional+Extension.swift in Sources */, F73EF7C52B02250B0087E6E9 /* NCManageDatabase+GPS.swift in Sources */, 2C1D5D7923E2DE9100334ABB /* NCBrand.swift in Sources */, F770768A263A8A2500A1BA94 /* NCUtilityFileSystem.swift in Sources */, @@ -4257,6 +4265,7 @@ buildActionMask = 2147483647; files = ( F78E2D6A29AF02DB0024D4F3 /* Database.swift in Sources */, + F75F4BC52FD008D7009E55ED /* Optional+Extension.swift in Sources */, F7490E6E29882B56009DCE94 /* NCBrand.swift in Sources */, F7D61E942EBF1366007F865B /* UIColor+Extension.swift in Sources */, F71F6D0C2B6A6A5E00F1EB15 /* ThreadSafeArray.swift in Sources */, @@ -4327,6 +4336,7 @@ F77C973A2953143A00FDDD09 /* NCCameraRoll.swift in Sources */, F740BEF02A35C2AD00E9B6D5 /* UILabel+Extension.swift in Sources */, F7C30E01291BD2610017149B /* NCNetworkingE2EERename.swift in Sources */, + F75F4BC22FD008D7009E55ED /* Optional+Extension.swift in Sources */, AF4BF61A27562A4B0081CEEF /* NCManageDatabase+Metadata.swift in Sources */, AF4BF615275629E20081CEEF /* NCManageDatabase+Account.swift in Sources */, F798F0E225880608000DAFFD /* UIColor+Extension.swift in Sources */, @@ -4477,6 +4487,7 @@ F72EA95228B7BA2A00C88F0C /* DashboardWidgetProvider.swift in Sources */, F77E8C242E79717D00EAE68F /* NCManageDatabase+LivePhoto.swift in Sources */, F76340F72EBDE9760056F538 /* NCManageDatabaseCore.swift in Sources */, + F75F4BC02FD008D7009E55ED /* Optional+Extension.swift in Sources */, F7D496FD2EBFA6D9004F9823 /* String+Extension.swift in Sources */, F7D7A7702DCDD437003D2007 /* NCManageDatabase+AutoUpload.swift in Sources */, F72EA95828B7BC4F00C88F0C /* FilesData.swift in Sources */, @@ -4514,6 +4525,7 @@ F3E173C42C9B1067006D177A /* AwakeMode.swift in Sources */, F7D61E932EBF1366007F865B /* UIColor+Extension.swift in Sources */, F76340F42EBDE9760056F538 /* NCManageDatabaseCore.swift in Sources */, + F75F4BC42FD008D7009E55ED /* Optional+Extension.swift in Sources */, F7CAFE212F17A37C00DB35A5 /* NCNetworking+Actor.swift in Sources */, F76340EE2EBDE74C0056F538 /* NCManageDatabase.swift in Sources */, F763410A2EBDFCB10056F538 /* NCManageDatabase+CreateMetadata.swift in Sources */, @@ -4909,6 +4921,7 @@ F7C55C8E2FB5B03D004A974F /* NCGlobal.swift in Sources */, F7C55CC92FB5CE74004A974F /* ActionViewController.swift in Sources */, F7C55C9B2FB5B1A7004A974F /* UIColor+Extension.swift in Sources */, + F75F4BC32FD008D7009E55ED /* Optional+Extension.swift in Sources */, F7C55C8D2FB5B02C004A974F /* NCAssistantSharedTextStore.swift in Sources */, F7C55C9A2FB5B127004A974F /* ThreadSafeDictionary.swift in Sources */, ); @@ -4965,6 +4978,7 @@ F71F6D092B6A6A5E00F1EB15 /* ThreadSafeArray.swift in Sources */, F757CC8429E7F88B00F31428 /* NCManageDatabase+Groupfolders.swift in Sources */, F78E2D6729AF02DB0024D4F3 /* Database.swift in Sources */, + F75F4BC12FD008D7009E55ED /* Optional+Extension.swift in Sources */, F77DD6AA2C5CC093009448FB /* NCSession.swift in Sources */, F7A8D73628F17E1A008BBE1C /* NCManageDatabase+Activity.swift in Sources */, ); @@ -6346,7 +6360,7 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/nextcloud/NextcloudKit"; requirement = { - branch = 7.3.2; + branch = main; kind = branch; }; }; diff --git a/iOSClient/Assistant/NCAssistantModel.swift b/iOSClient/Assistant/NCAssistantModel.swift index 7b796643ca..02dbc8c11f 100644 --- a/iOSClient/Assistant/NCAssistantModel.swift +++ b/iOSClient/Assistant/NCAssistantModel.swift @@ -43,7 +43,7 @@ class NCAssistantModel { self.session = NCSession.shared.getSession(controller: controller) let capabilities = NCNetworking.shared.capabilities[session.account] ?? NKCapabilities.Capabilities() - useV2 = capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion30 + useV2 = NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v30) loadAllTypes() } diff --git a/iOSClient/Data/NCManageDatabase+Metadata.swift b/iOSClient/Data/NCManageDatabase+Metadata.swift index dc32ea891c..011ddbf681 100644 --- a/iOSClient/Data/NCManageDatabase+Metadata.swift +++ b/iOSClient/Data/NCManageDatabase+Metadata.swift @@ -1028,6 +1028,22 @@ extension NCManageDatabase { } } + func getOwnerDisplayName(account: String?, ownerId: String?) async -> String? { + guard let account = account.isNotEmpty, + let ownerId = ownerId.isNotEmpty else { + return nil + } + + return await core.performRealmReadAsync { realm in + let ownerDisplayName = realm.objects(tableMetadata.self) + .filter("account == %@ AND ownerId == %@", account, ownerId) + .first? + .ownerDisplayName + + return ownerDisplayName.isNotEmpty + } + } + /// Asynchronously retrieves the metadata for a folder, based on its session and serverUrl. /// Handles the home directory case rootFileName) and detaches the Realm object before returning. func getMetadataFolderAsync(session: NCSession.Session, serverUrl: String) async -> tableMetadata? { diff --git a/iOSClient/Data/NCMetadataTranfersSuccess.swift b/iOSClient/Data/NCMetadataTranfersSuccess.swift index 5b53798df9..fdd2d984dc 100644 --- a/iOSClient/Data/NCMetadataTranfersSuccess.swift +++ b/iOSClient/Data/NCMetadataTranfersSuccess.swift @@ -30,7 +30,12 @@ actor NCMetadataTranfersSuccess { delegates.removeAll { $0 as AnyObject === delegate as AnyObject } } - func append(metadata: tableMetadata, ocId: String, date: Date?, etag: String?) async { + func append(metadata: tableMetadata, + ocId: String, + date: Date?, + etag: String?, + ownerId: String? = nil, + permissions: String? = nil) async { let status = metadata.status metadata.ocId = ocId @@ -42,6 +47,17 @@ actor NCMetadataTranfersSuccess { metadata.fileId = fileId } + if let ownerId = ownerId.isNotEmpty { + metadata.ownerId = ownerId + if let ownerDisplayName = await NCManageDatabase.shared.getOwnerDisplayName(account: metadata.account, ownerId: ownerId) { + metadata.ownerDisplayName = ownerDisplayName + } + } + + if let permissions = permissions.isNotEmpty { + metadata.permissions = permissions + } + metadata.session = "" metadata.sessionError = "" metadata.sessionTaskIdentifier = 0 diff --git a/iOSClient/Extensions/Optional+Extension.swift b/iOSClient/Extensions/Optional+Extension.swift index 5a9b2e5f59..d7f7ed696d 100644 --- a/iOSClient/Extensions/Optional+Extension.swift +++ b/iOSClient/Extensions/Optional+Extension.swift @@ -28,4 +28,11 @@ extension Optional where Wrapped: Collection { var isEmptyOrNil: Bool { return self?.isEmpty ?? true } + + var isNotEmpty: Wrapped? { + guard let value = self, !value.isEmpty else { + return nil + } + return value + } } diff --git a/iOSClient/Main/Collection Common/NCCollectionViewCommon+CollectionViewDelegate.swift b/iOSClient/Main/Collection Common/NCCollectionViewCommon+CollectionViewDelegate.swift index 9b9a422625..4a57032ba3 100644 --- a/iOSClient/Main/Collection Common/NCCollectionViewCommon+CollectionViewDelegate.swift +++ b/iOSClient/Main/Collection Common/NCCollectionViewCommon+CollectionViewDelegate.swift @@ -78,7 +78,7 @@ extension NCCollectionViewCommon: UICollectionViewDelegate { await banner.dismissAsync() } - if results.nkError == .success || results.afError?.isExplicitlyCancelledError ?? false { + if results.nkError == .success || results.nkError == .cancelled { print("ok") } else { await showErrorBanner(windowScene: windowScene, text: results.nkError.errorDescription, errorCode: results.nkError.errorCode) diff --git a/iOSClient/Main/Collection Common/NCCollectionViewCommon+Search.swift b/iOSClient/Main/Collection Common/NCCollectionViewCommon+Search.swift index 4a836e1c82..d748b07ac6 100644 --- a/iOSClient/Main/Collection Common/NCCollectionViewCommon+Search.swift +++ b/iOSClient/Main/Collection Common/NCCollectionViewCommon+Search.swift @@ -29,7 +29,7 @@ extension NCCollectionViewCommon { setSearchBarLoading(true) networkSearchInProgress = true - if capabilities.serverVersionMajor >= global.nextcloudVersion20 { + if NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v20) { await unifiedSearch(text: text) } else { await searchLiteral(text: text) diff --git a/iOSClient/Main/Create/Upload Assets/NCUploadAssetsModel.swift b/iOSClient/Main/Create/Upload Assets/NCUploadAssetsModel.swift index 04f9521bd1..2172b5c7dc 100644 --- a/iOSClient/Main/Create/Upload Assets/NCUploadAssetsModel.swift +++ b/iOSClient/Main/Create/Upload Assets/NCUploadAssetsModel.swift @@ -172,7 +172,7 @@ class NCUploadAssetsModel: ObservableObject, NCCreateFormUploadConflictDelegate self.uploadInProgress.toggle() return } - let autoMkcol = capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion33 + let autoMkcol = NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v33) func createProcessUploads() { if !self.dismissView { diff --git a/iOSClient/Media/NCMedia+Netwoking.swift b/iOSClient/Media/NCMedia+Netwoking.swift index f64ad08fd5..e00c439176 100644 --- a/iOSClient/Media/NCMedia+Netwoking.swift +++ b/iOSClient/Media/NCMedia+Netwoking.swift @@ -18,23 +18,12 @@ extension NCMedia { guard let nkSession = NextcloudKit.shared.nkCommonInstance.nksessions.session(forAccount: account) else { return (account, nil, .urlError) } - let capabilities = await NKCapabilities.shared.getCapabilities(for: account) let files: [NKFile] = [] let href = "/files/" + nkSession.userId + path - let elementDate: String - var lessDateString: String - var greaterDateString: String - - if capabilities.serverVersionMajor >= self.global.nextcloudVersionFuture { - elementDate = "nc:metadata-photos-original_date_time" - lessDateString = String(lessDate.timeIntervalSince1970) - greaterDateString = String(greaterDate.timeIntervalSince1970) - } else { - elementDate = "d:getlastmodified" - lessDateString = lessDate.formatted(using: "yyyy-MM-dd'T'HH:mm:ssZZZZZ") - greaterDateString = greaterDate.formatted(using: "yyyy-MM-dd'T'HH:mm:ssZZZZZ") - } + let elementDate = "d:getlastmodified" + let lessDateString = lessDate.formatted(using: "yyyy-MM-dd'T'HH:mm:ssZZZZZ") + let greaterDateString = greaterDate.formatted(using: "yyyy-MM-dd'T'HH:mm:ssZZZZZ") let httpBodyString = String(format: getRequestBodySearchMedia( createProperties: options.createProperties, diff --git a/iOSClient/Media/NCMediaDataSource.swift b/iOSClient/Media/NCMediaDataSource.swift index ecbc2a9d6c..fee20fe315 100644 --- a/iOSClient/Media/NCMediaDataSource.swift +++ b/iOSClient/Media/NCMediaDataSource.swift @@ -11,17 +11,11 @@ extension NCMedia { guard let tblAccount = await self.database.getTableAccountAsync(predicate: NSPredicate(format: "account == %@", self.session.account)) else { return } - let capabilities = await NKCapabilities.shared.getCapabilities(for: self.session.account) let mediaPredicate = self.imageCache.getMediaPredicate(session: self.session, mediaPath: tblAccount.mediaPath, showOnlyImages: self.showOnlyImages, showOnlyVideos: self.showOnlyVideos) - var sortedByKeyPath: String - if capabilities.serverVersionMajor >= self.global.nextcloudVersionFuture { - sortedByKeyPath = "datePhotosOriginal" - } else { - sortedByKeyPath = "date" - } + let sortedByKeyPath = "date" if let metadatas = await self.database.getMetadatasAsync(predicate: mediaPredicate, sortedByKeyPath: sortedByKeyPath, ascending: false) { self.database.filterAndNormalizeLivePhotos(from: metadatas) { metadatas in @@ -71,7 +65,6 @@ extension NCMedia { return } - let capabilities = await NKCapabilities.shared.getCapabilities(for: session.account) var lessDate = Date.distantFuture var greaterDate = Date.distantPast var visibleCells: [NCMediaCell] = [] @@ -175,18 +168,11 @@ extension NCMedia { showOnlyImages: self.showOnlyImages, showOnlyVideos: self.showOnlyVideos) - var predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [ + let predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [ NSPredicate(format: "date >= %@ AND date <= %@ AND mediaSearch == true", greaterDate as NSDate, lessDate as NSDate), mediaPredicate ]) - if capabilities.serverVersionMajor >= self.global.nextcloudVersionFuture { - predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [ - NSPredicate(format: "datePhotosOriginal >= %@ AND datePhotosOriginal <= %@ AND mediaSearch == true", greaterDate as NSDate, lessDate as NSDate), - mediaPredicate - ]) - } - let localMetadatas = await self.database.getMetadatasAsync(predicate: predicate) await MainActor.run { @@ -257,13 +243,7 @@ public class NCMediaDataSource: NSObject { } private func getMetadataFromTableMetadata(_ metadata: tableMetadata) -> Metadata { - let capabilities = NCNetworking.shared.capabilities[metadata.account] ?? NKCapabilities.Capabilities() - let date: Date - if capabilities.serverVersionMajor >= self.global.nextcloudVersionFuture { - date = metadata.datePhotosOriginal as Date - } else { - date = metadata.date as Date - } + let date = metadata.date as Date return Metadata(date: date, etag: metadata.etag, imageSize: CGSize(width: metadata.width, height: metadata.height), diff --git a/iOSClient/Menu/NCContextMenuPlus.swift b/iOSClient/Menu/NCContextMenuPlus.swift index 0782aed87d..19d41fd1d3 100644 --- a/iOSClient/Menu/NCContextMenuPlus.swift +++ b/iOSClient/Menu/NCContextMenuPlus.swift @@ -153,7 +153,7 @@ class NCContextMenuPlus: NSObject { // ------------------------------- RICHDOCUMENT TEXT - if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18, + if NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v18), directory?.richWorkspace == nil, !isDirectoryE2EE, isNetworkReachable { diff --git a/iOSClient/Menu/NCContextMenuProfile.swift b/iOSClient/Menu/NCContextMenuProfile.swift index bc4b64ab47..615b895fff 100644 --- a/iOSClient/Menu/NCContextMenuProfile.swift +++ b/iOSClient/Menu/NCContextMenuProfile.swift @@ -36,7 +36,7 @@ class NCContextMenuProfile: NSObject { func viewMenu() -> UIMenu { let capabilities = NCNetworking.shared.capabilities[session.account] ?? NKCapabilities.Capabilities() - guard capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion23 else { + guard NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v23) else { return UIMenu() } diff --git a/iOSClient/NCGlobal.swift b/iOSClient/NCGlobal.swift index 2e6ad38aee..81f58bb5f2 100644 --- a/iOSClient/NCGlobal.swift +++ b/iOSClient/NCGlobal.swift @@ -40,27 +40,6 @@ final class NCGlobal: Sendable { let twoFactorNotificatioName = "twofactor_nextcloud_notification" let termsOfServiceName = "terms_of_service" - // Nextcloud version - // - let nextcloudVersion18: Int = 18 - let nextcloudVersion20: Int = 20 - let nextcloudVersion23: Int = 23 - let nextcloudVersion24: Int = 24 - let nextcloudVersion25: Int = 25 - let nextcloudVersion26: Int = 26 - let nextcloudVersion27: Int = 27 - let nextcloudVersion28: Int = 28 - let nextcloudVersion30: Int = 30 - let nextcloudVersion31: Int = 31 - let nextcloudVersion32: Int = 32 - let nextcloudVersion33: Int = 33 - let nextcloudVersionFuture: Int = 99999 - - - // Nextcloud unsupported - // - let nextcloud_unsupported_version: Int = 20 - // Intro selector // let introLogin: Int = 0 @@ -146,7 +125,6 @@ final class NCGlobal: Sendable { // Error // - let errorRequestExplicityCancelled: Int = 15 let errorNotModified: Int = 304 let errorBadRequest: Int = 400 let errorUnauthorized401: Int = 401 diff --git a/iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift b/iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift index aa64cea15a..f43a4fbcd5 100644 --- a/iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift +++ b/iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift @@ -195,8 +195,16 @@ class NCNetworkingE2EEUpload: NSObject { if let fileId = self.utility.ocIdToFileId(ocId: ocId) { metadata.fileId = fileId } + if let ownerId = resultsSendFile.ownerId.isNotEmpty { + metadata.ownerId = ownerId + if let ownerDisplayName = await self.database.getOwnerDisplayName(account: metadata.account, ownerId: ownerId) { + metadata.ownerDisplayName = ownerDisplayName + } + } + if let permissions = resultsSendFile.permissions.isNotEmpty { + metadata.permissions = permissions + } metadata.chunk = 0 - metadata.session = "" metadata.sessionTaskIdentifier = 0 metadata.sessionError = "" @@ -238,7 +246,7 @@ class NCNetworkingE2EEUpload: NSObject { tokenBanner: Int?, requestHandle: @escaping (_ request: UploadRequest) -> Void = { _ in }, currentUploadTask: @escaping (_ task: Task<(account: String, file: NKFile?, error: NKError), Never>?) -> Void = { _ in }) - async -> (ocId: String?, etag: String?, date: Date?, error: NKError) { + async -> (ocId: String?, etag: String?, date: Date?, ownerId: String?, permissions: String?, error: NKError) { if metadata.chunk > 0 { let payload = LucidBannerPayload.Update( title: NSLocalizedString("_wait_file_preparation_", comment: ""), @@ -289,7 +297,12 @@ class NCNetworkingE2EEUpload: NSObject { currentUploadTask(task) let results = await task.value - return (results.file?.ocId, results.file?.etag, results.file?.date, results.error) + return (results.file?.ocId, + results.file?.etag, + results.file?.date, + results.file?.ownerId, + results.file?.permissions, + results.error) } else { let payload = LucidBannerPayload.Update( title: NSLocalizedString("_keep_active_for_upload_", comment: ""), @@ -320,7 +333,12 @@ class NCNetworkingE2EEUpload: NSObject { } } - return (results.ocId, results.etag, results.date, results.error) + return (results.ocId, + results.etag, + results.date, + results.ownerId, + results.permissions, + results.error) } } } diff --git a/iOSClient/Networking/NCAutoUpload.swift b/iOSClient/Networking/NCAutoUpload.swift index c99d1085e9..4e4fbe34c1 100644 --- a/iOSClient/Networking/NCAutoUpload.swift +++ b/iOSClient/Networking/NCAutoUpload.swift @@ -87,7 +87,7 @@ class NCAutoUpload: NSObject { assets: [PHAsset], fileNames: [String]) async -> Int { let capabilities = await NKCapabilities.shared.getCapabilities(for: tblAccount.account) - let autoMkcol = capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion33 + let autoMkcol = NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v33) let session = NCSession.shared.getSession(account: tblAccount.account) let autoUploadServerUrlBase = await self.database.getAccountAutoUploadServerUrlBaseAsync(account: tblAccount.account, urlBase: tblAccount.urlBase, userId: tblAccount.userId) var metadatas: [tableMetadata] = [] @@ -306,7 +306,7 @@ class NCAutoUpload: NSObject { // If server supports auto MKCOL (Nextcloud >= 33), skip manual folder creation. if let capabilities = capabilitiesByAccount[metadata.account] { - let autoMkcol = capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion33 + let autoMkcol = NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v33) if autoMkcol { continue } diff --git a/iOSClient/Networking/NCNetworking+Download.swift b/iOSClient/Networking/NCNetworking+Download.swift index 1889fe83ed..4d9fe0c51c 100644 --- a/iOSClient/Networking/NCNetworking+Download.swift +++ b/iOSClient/Networking/NCNetworking+Download.swift @@ -21,14 +21,12 @@ extension NCNetworking { etag: String?, date: Date?, length: Int64, - headers: [AnyHashable: Any]?, - afError: AFError?, nkError: NKError ) { - let options = NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue) + let options = NKRequestOptions(queue: nkComm.backgroundQueue) let fileNameLocalPath = utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, fileName: metadata.fileName, userId: metadata.userId, urlBase: metadata.urlBase) if metadata.status == global.metadataStatusDownloading || metadata.status == global.metadataStatusUploading { - return(metadata.account, metadata.etag, metadata.date as Date, metadata.size, nil, nil, .success) + return(metadata.account, metadata.etag, metadata.date as Date, metadata.size, .success) } let results = await NextcloudKit.shared.downloadAsync(serverUrlFileName: metadata.serverUrlFileName, @@ -76,22 +74,17 @@ extension NCNetworking { progressHandler(progress) } - Task { - await progressQuantizer.clear(serverUrlFileName: metadata.serverUrlFileName) - var error = NKError() + await progressQuantizer.clear(serverUrlFileName: metadata.serverUrlFileName) + let allHeaderFields = results.response?.response?.allHeaderFields + let etag = nkComm.normalizedETag(nkComm.findHeader("oc-etag", allHeaderFields: allHeaderFields)) - if results.afError?.isExplicitlyCancelledError ?? false || (results.afError?.underlyingError as? URLError)?.code.rawValue == -999 { - error = NKError(errorCode: self.global.errorRequestExplicityCancelled, errorDescription: "error request explicity cancelled") - } - - if error == .success { - await downloadSuccess(withMetadata: metadata, etag: results.etag) - } else { - await downloadError(withMetadata: metadata, error: error) - } + if results.nkError == .success { + await downloadSuccess(withMetadata: metadata, etag: etag) + } else { + await downloadError(withMetadata: metadata, error: results.nkError) } - return results + return(metadata.account, etag, metadata.date as Date, metadata.size, results.nkError) } // MARK: - Download file in background @@ -181,7 +174,7 @@ extension NCNetworking { // MARK: - DOWNLOAD ERROR func downloadError(withMetadata metadata: tableMetadata, error: NKError) async { - await NextcloudKit.shared.nkCommonInstance.appendServerErrorAccount(metadata.account, errorCode: error.errorCode) + await nkComm.appendServerErrorAccount(metadata.account, errorCode: error.errorCode) nkLog(error: "Downloaded file: " + metadata.serverUrlFileName + ", result: error \(error.errorCode)") @@ -190,7 +183,7 @@ extension NCNetworking { await NCManageDatabase.shared.deleteLocalFileAsync(id: metadata.ocId) await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocId) - } else if error.errorCode == NSURLErrorCancelled || error.errorCode == self.global.errorRequestExplicityCancelled { + } else if error.errorCode == NSURLErrorCancelled { await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, session: "", sessionTaskIdentifier: 0, @@ -233,7 +226,7 @@ extension NCNetworking { internal func synchronizationDownload(account: String, serverUrl: String, userId: String, urlBase: String, metadatasInDownload: [tableMetadata]?) async { let showHiddenFiles = NCPreferences().getShowHiddenFiles(account: account) - let options = NKRequestOptions(timeout: 300, taskDescription: NCGlobal.shared.taskDescriptionSynchronization, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue) + let options = NKRequestOptions(timeout: 300, taskDescription: NCGlobal.shared.taskDescriptionSynchronization, queue: nkComm.backgroundQueue) nkLog(tag: self.global.logTagSync, emoji: .start, message: "Start read infinite folder: \(serverUrl)") diff --git a/iOSClient/Networking/NCNetworking+NextcloudKitDelegate.swift b/iOSClient/Networking/NCNetworking+NextcloudKitDelegate.swift index 3b84a934eb..ffc8874b2c 100644 --- a/iOSClient/Networking/NCNetworking+NextcloudKitDelegate.swift +++ b/iOSClient/Networking/NCNetworking+NextcloudKitDelegate.swift @@ -9,7 +9,6 @@ import Alamofire import LucidBanner extension NCNetworking { - #if !EXTENSION func networkReachabilityObserver(_ typeReachability: NKTypeReachability) { if typeReachability == NKTypeReachability.reachableCellular || typeReachability == NKTypeReachability.reachableEthernetOrWiFi { @@ -38,24 +37,16 @@ extension NCNetworking { // MARK: - Download NextcloudKitDelegate - func downloadComplete(fileName: String, - serverUrl: String, - etag: String?, - date: Date?, - dateLastModified: Date?, - length: Int64, - task: URLSessionTask, - error: NKError) { + func downloadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable: Any]?, task: URLSessionTask, error: NKError) { Task { await progressQuantizer.clear(serverUrlFileName: serverUrl + "/" + fileName) + let etag = nkComm.normalizedETag(nkComm.findHeader("oc-etag", allHeaderFields: allHeaderFields)) + #if EXTENSION_FILE_PROVIDER_EXTENSION await FileProviderData.shared.downloadComplete(fileName: fileName, serverUrl: serverUrl, - etag: etag, - date: date, - dateLastModified: dateLastModified, - length: length, + allHeaderFields: allHeaderFields, task: task, error: error) #else @@ -119,24 +110,24 @@ extension NCNetworking { // MARK: - Upload NextcloudKitDelegate - func uploadComplete(fileName: String, - serverUrl: String, - ocId: String?, - etag: String?, - date: Date?, - size: Int64, - task: URLSessionTask, - error: NKError) { + func uploadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable: Any]?, task: URLSessionTask, error: NKError) { Task { await progressQuantizer.clear(serverUrlFileName: serverUrl + "/" + fileName) + let ocId = nkComm.findHeader("oc-fileid", allHeaderFields: allHeaderFields) + let etag = nkComm.normalizedETag(nkComm.findHeader("oc-etag", allHeaderFields: allHeaderFields)) + let date = nkComm.findHeader("date", allHeaderFields: allHeaderFields)?.parsedDate(using: "EEE, dd MMM y HH:mm:ss zzz") + let ownerId = nkComm.findHeader("x-nc-ownerid", allHeaderFields: allHeaderFields) + let permissions = nkComm.findHeader("x-nc-permissions", allHeaderFields: allHeaderFields) + #if EXTENSION_FILE_PROVIDER_EXTENSION await FileProviderData.shared.uploadComplete(fileName: fileName, serverUrl: serverUrl, ocId: ocId, etag: etag, date: date, - size: size, + ownerId: ownerId, + permissions: permissions, task: task, error: error) @@ -152,14 +143,18 @@ extension NCNetworking { await self.uploadSuccess(withMetadata: metadata, ocId: ocId, etag: etag, - date: date) + date: date, + ownerId: ownerId, + permissions: permissions) } else { #if !EXTENSION await NCManageDatabase.shared.deleteMetadataAsync(ocId: metadata.ocId) await NCNetworking.shared.metadataTranfersSuccess.append(metadata: metadata, ocId: ocId, date: date, - etag: etag) + etag: etag, + ownerId: ownerId, + permissions: permissions) #endif } } else { diff --git a/iOSClient/Networking/NCNetworking+ServerError.swift b/iOSClient/Networking/NCNetworking+ServerError.swift index 97a0697f4d..e427de3eb1 100644 --- a/iOSClient/Networking/NCNetworking+ServerError.swift +++ b/iOSClient/Networking/NCNetworking+ServerError.swift @@ -8,13 +8,13 @@ import NextcloudKit extension NCNetworking { func noServerErrorAccount(_ account: String) -> Bool { - guard let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier) + guard let groupDefaults = UserDefaults(suiteName: nkComm.groupIdentifier) else { return true } - let unavailableArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnavailable) as? [String] ?? [] - let unauthorizedArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) as? [String] ?? [] - let tosArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) as? [String] ?? [] + let unavailableArray = groupDefaults.array(forKey: nkComm.groupDefaultsUnavailable) as? [String] ?? [] + let unauthorizedArray = groupDefaults.array(forKey: nkComm.groupDefaultsUnauthorized) as? [String] ?? [] + let tosArray = groupDefaults.array(forKey: nkComm.groupDefaultsToS) as? [String] ?? [] if unavailableArray.contains(account) || unauthorizedArray.contains(account) || tosArray.contains(account) { return false @@ -24,34 +24,34 @@ extension NCNetworking { } func removeServerErrorAccount(_ account: String) { - guard let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier) + guard let groupDefaults = UserDefaults(suiteName: nkComm.groupIdentifier) else { return } - var unauthorizedArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) as? [String] ?? [] - var unavailableArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnavailable) as? [String] ?? [] - var tosArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) as? [String] ?? [] + var unauthorizedArray = groupDefaults.array(forKey: nkComm.groupDefaultsUnauthorized) as? [String] ?? [] + var unavailableArray = groupDefaults.array(forKey: nkComm.groupDefaultsUnavailable) as? [String] ?? [] + var tosArray = groupDefaults.array(forKey: nkComm.groupDefaultsToS) as? [String] ?? [] unauthorizedArray.removeAll { $0 == account } - groupDefaults.set(unauthorizedArray, forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) + groupDefaults.set(unauthorizedArray, forKey: nkComm.groupDefaultsUnauthorized) unavailableArray.removeAll { $0 == account } - groupDefaults.set(unavailableArray, forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnavailable) + groupDefaults.set(unavailableArray, forKey: nkComm.groupDefaultsUnavailable) tosArray.removeAll { $0 == account } - groupDefaults.set(tosArray, forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) + groupDefaults.set(tosArray, forKey: nkComm.groupDefaultsToS) groupDefaults.synchronize() } func checkServerError(account: String, controller: NCMainTabBarController?) async { - guard let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier) + guard let groupDefaults = UserDefaults(suiteName: nkComm.groupIdentifier) else { return } - var unavailableArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnavailable) as? [String] ?? [] - let unauthorizedArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) as? [String] ?? [] - let tosArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) as? [String] ?? [] + var unavailableArray = groupDefaults.array(forKey: nkComm.groupDefaultsUnavailable) as? [String] ?? [] + let unauthorizedArray = groupDefaults.array(forKey: nkComm.groupDefaultsUnauthorized) as? [String] ?? [] + let tosArray = groupDefaults.array(forKey: nkComm.groupDefaultsToS) as? [String] ?? [] // Unavailable if unavailableArray.contains(account) { @@ -65,9 +65,9 @@ extension NCNetworking { switch resultsServerStatus.result { case .success(let serverInfo): unavailableArray.removeAll { $0 == account } - groupDefaults.set(unavailableArray, forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnavailable) + groupDefaults.set(unavailableArray, forKey: nkComm.groupDefaultsUnavailable) unavailableArray.removeAll { $0 == account } - groupDefaults.set(unavailableArray, forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnavailable) + groupDefaults.set(unavailableArray, forKey: nkComm.groupDefaultsUnavailable) if serverInfo.maintenance { Task { diff --git a/iOSClient/Networking/NCNetworking+Task.swift b/iOSClient/Networking/NCNetworking+Task.swift index e6256aeca0..f28830b583 100644 --- a/iOSClient/Networking/NCNetworking+Task.swift +++ b/iOSClient/Networking/NCNetworking+Task.swift @@ -98,7 +98,7 @@ extension NCNetworking { } // UPLOAD } else if metadata.session.contains("upload") { - if metadata.session == NextcloudKit.shared.nkCommonInstance.identifierSessionUpload { + if metadata.session == nkComm.identifierSessionUpload { cancelUploadTasks(metadata: metadata) } else { cancelUploadBackgroundTask(metadata: metadata) @@ -125,7 +125,7 @@ extension NCNetworking { } func cancelAllDataTask() { - NextcloudKit.shared.nkCommonInstance.nksessions.forEach { session in + nkComm.nksessions.forEach { session in session.sessionData.session.getTasksWithCompletionHandler { dataTasks, _, _ in dataTasks.forEach { task in task.cancel() @@ -144,7 +144,7 @@ extension NCNetworking { self.global.metadataStatusDownloadError, sessionDownload) Task { - NextcloudKit.shared.nkCommonInstance.nksessions.forEach { session in + nkComm.nksessions.forEach { session in session.sessionData.session.getTasksWithCompletionHandler { _, _, downloadTasks in downloadTasks.forEach { task in if targetTaskId == nil || (task.taskIdentifier == targetTaskId) { @@ -169,7 +169,7 @@ extension NCNetworking { self.global.metadataStatusDownloadError, sessionDownloadBackground) - NextcloudKit.shared.nkCommonInstance.nksessions.forEach { session in + nkComm.nksessions.forEach { session in Task { let tasksBackground = await session.sessionDownloadBackground.tasks @@ -200,7 +200,7 @@ extension NCNetworking { sessionUpload) Task { - NextcloudKit.shared.nkCommonInstance.nksessions.forEach { nkSession in + nkComm.nksessions.forEach { nkSession in nkSession.sessionData.session.getTasksWithCompletionHandler { _, uploadTasks, _ in uploadTasks.forEach { task in if targetTaskId == nil || (account == nkSession.account && targetTaskId == task.taskIdentifier) { @@ -227,7 +227,7 @@ extension NCNetworking { sessionUploadBackgroundWWan, sessionUploadBackgroundExt) - NextcloudKit.shared.nkCommonInstance.nksessions.forEach { nkSession in + nkComm.nksessions.forEach { nkSession in Task { var nkSession = nkSession let tasksBackground = await nkSession.sessionUploadBackground.tasks @@ -269,7 +269,7 @@ extension NCNetworking { // MARK: - func getAllDataTask() async -> [URLSessionDataTask] { - let nkSessions = NextcloudKit.shared.nkCommonInstance.nksessions.all + let nkSessions = nkComm.nksessions.all var taskArray: [URLSessionDataTask] = [] for nkSession in nkSessions { @@ -291,7 +291,7 @@ extension NCNetworking { sessionUpload, self.global.metadataStatusUploading)) { for metadata in metadatas { - guard let nkSession = NextcloudKit.shared.nkCommonInstance.nksessions.session(forAccount: metadata.account) else { + guard let nkSession = nkComm.nksessions.session(forAccount: metadata.account) else { await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocId) utilityFileSystem.removeFile(atPath: utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, userId: metadata.userId, @@ -333,7 +333,7 @@ extension NCNetworking { sessionUploadBackgroundWWan, self.global.metadataStatusUploading)) { for metadata in metadatas { - guard var nkSession = NextcloudKit.shared.nkCommonInstance.nksessions.session(forAccount: metadata.account) else { + guard var nkSession = nkComm.nksessions.session(forAccount: metadata.account) else { await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocId) utilityFileSystem.removeFile(atPath: utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, userId: metadata.userId, @@ -384,7 +384,7 @@ extension NCNetworking { sessionDownload, self.global.metadataStatusDownloadingAllMode)) { for metadata in metadatas { - guard let nkSession = NextcloudKit.shared.nkCommonInstance.nksessions.session(forAccount: metadata.account) else { + guard let nkSession = nkComm.nksessions.session(forAccount: metadata.account) else { await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocId) utilityFileSystem.removeFile(atPath: utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, userId: metadata.userId, @@ -417,7 +417,7 @@ extension NCNetworking { sessionDownloadBackground, self.global.metadataStatusDownloading)) { for metadata in metadatas { - guard let nkSession = NextcloudKit.shared.nkCommonInstance.nksessions.session(forAccount: metadata.account) else { + guard let nkSession = nkComm.nksessions.session(forAccount: metadata.account) else { await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocId) utilityFileSystem.removeFile(atPath: utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, userId: metadata.userId, diff --git a/iOSClient/Networking/NCNetworking+TermsOfService.swift b/iOSClient/Networking/NCNetworking+TermsOfService.swift index add29d2807..5115dc0afa 100644 --- a/iOSClient/Networking/NCNetworking+TermsOfService.swift +++ b/iOSClient/Networking/NCNetworking+TermsOfService.swift @@ -12,14 +12,14 @@ extension NCNetworking { func termsOfService(account: String) async { let capabilities = await NKCapabilities.shared.getCapabilities(for: account) guard capabilities.termsOfService, - let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier), + let groupDefaults = UserDefaults(suiteName: nkComm.groupIdentifier), let controller = SceneManager.shared.getControllers().first(where: { $0.account == account }), controller.presentedViewController as? UIHostingController == nil else { return } - var tosArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) as? [String] ?? [] + var tosArray = groupDefaults.array(forKey: nkComm.groupDefaultsToS) as? [String] ?? [] let options = NKRequestOptions(checkInterceptor: false) let resultsGetToS = await NextcloudKit.shared.getTermsOfServiceAsync(account: account, options: options, taskHandler: { task in @@ -31,7 +31,7 @@ extension NCNetworking { }) guard resultsGetToS.error == .success, let tos = resultsGetToS.tos, !tos.hasUserSigned() else { tosArray.removeAll { $0 == account } - groupDefaults.set(tosArray, forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) + groupDefaults.set(tosArray, forKey: nkComm.groupDefaultsToS) return } @@ -45,11 +45,11 @@ extension NCNetworking { func signTermsOfService(account: String, termId: Int) async -> NKError? { let capabilities = await NKCapabilities.shared.getCapabilities(for: account) guard capabilities.termsOfService, - let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier) + let groupDefaults = UserDefaults(suiteName: nkComm.groupIdentifier) else { return nil } - var tosArray = groupDefaults.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) as? [String] ?? [] + var tosArray = groupDefaults.array(forKey: nkComm.groupDefaultsToS) as? [String] ?? [] let options = NKRequestOptions(checkInterceptor: false) let resultsSignToS = await NextcloudKit.shared.signTermsOfServiceAsync(termId: "\(termId)", account: account, options: options) { task in @@ -62,7 +62,7 @@ extension NCNetworking { } if resultsSignToS.error == .success { tosArray.removeAll { $0 == account } - groupDefaults.set(tosArray, forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsToS) + groupDefaults.set(tosArray, forKey: nkComm.groupDefaultsToS) } return resultsSignToS.error diff --git a/iOSClient/Networking/NCNetworking+TransferDelegate.swift b/iOSClient/Networking/NCNetworking+TransferDelegate.swift index 82362b7324..9e3ee32fc5 100644 --- a/iOSClient/Networking/NCNetworking+TransferDelegate.swift +++ b/iOSClient/Networking/NCNetworking+TransferDelegate.swift @@ -261,7 +261,7 @@ extension NCNetworking: NCTransferDelegate { return } - let download = await NextcloudKit.shared.downloadAsync( + let results = await NextcloudKit.shared.downloadAsync( serverUrlFileName: metadata.serverUrlFileName, fileNameLocalPath: fileNameLocalPath, account: account) { _ in @@ -281,14 +281,17 @@ extension NCNetworking: NCTransferDelegate { } + let allHeaderFields = results.response?.response?.allHeaderFields + let etag = nkComm.findHeader("oc-etag", allHeaderFields: allHeaderFields) + await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, session: "", sessionTaskIdentifier: 0, sessionError: "", status: self.global.metadataStatusNormal, - etag: download.etag) + etag: etag) - if download.nkError == .success { + if results.nkError == .success { await NCManageDatabase.shared.addLocalFilesAsync(metadatas: [metadata]) if let vc = await NCViewer().getViewerController(metadata: metadata, delegate: viewController) { viewController.navigationController?.pushViewController(vc, animated: true) diff --git a/iOSClient/Networking/NCNetworking+Upload.swift b/iOSClient/Networking/NCNetworking+Upload.swift index 50ba5fb80a..3bd13a4c56 100644 --- a/iOSClient/Networking/NCNetworking+Upload.swift +++ b/iOSClient/Networking/NCNetworking+Upload.swift @@ -24,10 +24,10 @@ extension NCNetworking { ocId: String?, etag: String?, date: Date?, - size: Int64, - response: AFDataResponse?, + ownerId: String?, + permissions: String?, error: NKError) { - let options = NKRequestOptions(customHeader: customHeaders, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue) + let options = NKRequestOptions(customHeader: customHeaders, queue: nkComm.backgroundQueue) let results = await NextcloudKit.shared.uploadAsync(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: creationDate, @@ -48,7 +48,21 @@ extension NCNetworking { progressHandler(progress.completedUnitCount, progress.totalUnitCount, progress.fractionCompleted) } - return results + let allHeaderFields = results.response?.response?.allHeaderFields + + let ocId = nkComm.findHeader("oc-fileid", allHeaderFields: allHeaderFields) + let etag = nkComm.normalizedETag(nkComm.findHeader("oc-etag", allHeaderFields: allHeaderFields)) + let date = nkComm.findHeader("date", allHeaderFields: allHeaderFields)?.parsedDate(using: "EEE, dd MMM y HH:mm:ss zzz") + let ownerId = nkComm.findHeader("x-nc-ownerid", allHeaderFields: allHeaderFields) + let permissions = nkComm.findHeader("x-nc-permissions", allHeaderFields: allHeaderFields) + + return (results.account, + ocId, + etag, + date, + ownerId, + permissions, + results.error) } // MARK: - Upload chunk file in foreground @@ -72,7 +86,7 @@ extension NCNetworking { if networkReachability == NKTypeReachability.reachableEthernetOrWiFi { chunkSize = self.global.chunkSizeMBEthernetOrWiFi } - let options = NKRequestOptions(customHeader: customHeaders, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue) + let options = NKRequestOptions(customHeader: customHeaders, queue: nkComm.backgroundQueue) var backupError = NKError() var backupFile: NKFile? @@ -148,7 +162,12 @@ extension NCNetworking { directory: directory) if performPostProcessing, let file { - await uploadSuccess(withMetadata: metadata, ocId: file.ocId, etag: file.etag, date: file.date) + await uploadSuccess(withMetadata: metadata, + ocId: file.ocId, + etag: file.etag, + date: file.date, + ownerId: file.ownerId, + permissions: file.permissions) } backupFile = file @@ -232,7 +251,9 @@ extension NCNetworking { func uploadSuccess(withMetadata metadata: tableMetadata, ocId: String, etag: String?, - date: Date?) async { + date: Date?, + ownerId: String? = nil, + permissions: String? = nil) async { nkLog(success: "Uploaded file: " + metadata.serverUrlFileName) metadata.uploadDate = (date as? NSDate) ?? NSDate() @@ -244,6 +265,17 @@ extension NCNetworking { metadata.fileId = fileId } + if let ownerId = ownerId.isNotEmpty { + metadata.ownerId = ownerId + if let ownerDisplayName = await NCManageDatabase.shared.getOwnerDisplayName(account: metadata.account, ownerId: ownerId) { + metadata.ownerDisplayName = ownerDisplayName + } + } + + if let permissions = permissions.isNotEmpty { + metadata.permissions = permissions + } + metadata.session = "" metadata.sessionError = "" metadata.sessionTaskIdentifier = 0 @@ -283,11 +315,11 @@ extension NCNetworking { // MARK: - UPLOAD ERROR func uploadError(withMetadata metadata: tableMetadata, error: NKError) async { - await NextcloudKit.shared.nkCommonInstance.appendServerErrorAccount(metadata.account, errorCode: error.errorCode) + await nkComm.appendServerErrorAccount(metadata.account, errorCode: error.errorCode) nkLog(error: "Upload file: " + metadata.serverUrlFileName + ", result: error \(error.errorCode)") - if error.errorCode == NSURLErrorCancelled || error.errorCode == self.global.errorRequestExplicityCancelled { + if error.errorCode == NSURLErrorCancelled { await uploadCancelFile(metadata: metadata) } else if (error.errorCode == self.global.errorBadRequest || error.errorCode == self.global.errorUnsupportedMediaType) && error.errorDescription.localizedCaseInsensitiveContains("virus") { await uploadCancelFile(metadata: metadata) @@ -504,4 +536,5 @@ extension NCNetworking { return (localFile: localFile, livePhoto: livePhoto, autoUpload: autoUpload) } + } diff --git a/iOSClient/Networking/NCNetworking+WebDAV.swift b/iOSClient/Networking/NCNetworking+WebDAV.swift index 3be5c033db..a495bb4f13 100644 --- a/iOSClient/Networking/NCNetworking+WebDAV.swift +++ b/iOSClient/Networking/NCNetworking+WebDAV.swift @@ -91,7 +91,7 @@ extension NCNetworking { } func fileExists(serverUrlFileName: String, account: String) async -> NKError { - let requestBody = NKDataFileXML(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).getRequestBodyFileExists().data(using: .utf8) + let requestBody = NKDataFileXML(nkCommonInstance: nkComm).getRequestBodyFileExists().data(using: .utf8) let results = await NextcloudKit.shared.readFileOrFolderAsync(serverUrlFileName: serverUrlFileName, depth: "0", diff --git a/iOSClient/Networking/NCNetworking.swift b/iOSClient/Networking/NCNetworking.swift index fe827a1a34..516b0e64e1 100644 --- a/iOSClient/Networking/NCNetworking.swift +++ b/iOSClient/Networking/NCNetworking.swift @@ -57,6 +57,7 @@ class NCNetworking: @unchecked Sendable, NextcloudKitDelegate { let utilityFileSystem = NCUtilityFileSystem() let global = NCGlobal.shared let backgroundSession = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance) + let nkComm = NextcloudKit.shared.nkCommonInstance var lastReachability: Bool = true var networkReachability: NKTypeReachability? diff --git a/iOSClient/Networking/NCService.swift b/iOSClient/Networking/NCService.swift index 9c79b399d4..f6715693d3 100644 --- a/iOSClient/Networking/NCService.swift +++ b/iOSClient/Networking/NCService.swift @@ -69,7 +69,7 @@ class NCService: NSObject { systemImage: "xmark.icloud.fill", imageAnimation: .none) return false - } else if serverInfo.versionMajor <= NCGlobal.shared.nextcloud_unsupported_version { + } else if NextcloudVersion(serverInfo.versionMajor) <= .v20 { await showWarningBanner(windowScene: windowScene, subtitle: "_warning_unsupported_", systemImage: "xmark.icloud.fill", diff --git a/iOSClient/Utility/NCLivePhoto.swift b/iOSClient/Utility/NCLivePhoto.swift index b53706a253..6849887f53 100644 --- a/iOSClient/Utility/NCLivePhoto.swift +++ b/iOSClient/Utility/NCLivePhoto.swift @@ -723,7 +723,7 @@ extension NCLivePhoto { Task { let capabilities = await NKCapabilities.shared.getCapabilities(for: metadata1.account) - guard capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion28 else { + guard NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v28) else { return } diff --git a/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift b/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift index 742d90fddf..7304ddafbb 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift @@ -373,13 +373,17 @@ extension NCPlayerToolBar: NCSelectDelegate { banner?.update(payload: LucidBannerPayload.Update(progress: Double(progress.fractionCompleted)), for: token) } - }) { _, etag, _, _, _, _, error in + }) { _, response, error in Task { if let banner { banner.dismiss() } let ocId = metadata.ocId + let allHeaderFields = response?.response?.allHeaderFields + let nkComm = NextcloudKit.shared.nkCommonInstance + let etag = nkComm.normalizedETag(nkComm.findHeader("oc-etag", allHeaderFields: allHeaderFields)) + await self.database.setMetadataSessionAsync(ocId: ocId, session: "", sessionTaskIdentifier: 0, diff --git a/iOSClient/Viewer/NCViewerRichdocument/NCViewerRichDocument.swift b/iOSClient/Viewer/NCViewerRichdocument/NCViewerRichDocument.swift index d26410c757..388c528524 100644 --- a/iOSClient/Viewer/NCViewerRichdocument/NCViewerRichDocument.swift +++ b/iOSClient/Viewer/NCViewerRichdocument/NCViewerRichDocument.swift @@ -220,10 +220,16 @@ class NCViewerRichDocument: UIViewController, WKNavigationDelegate, WKScriptMess status: self.global.metadataStatusDownloading) } }, progressHandler: { _ in - }, completionHandler: { account, etag, _, _, headers, _, error in + }, completionHandler: { account, response, error in NCActivityIndicator.shared.stop() + let allHeaderFields = response?.response?.allHeaderFields + Task { + let nkComm = NextcloudKit.shared.nkCommonInstance let ocId = self.metadata.ocId + let allHeaderFields = response?.response?.allHeaderFields + let etag = nkComm.normalizedETag(nkComm.findHeader("oc-etag", allHeaderFields: allHeaderFields)) + await self.database.setMetadataSessionAsync(ocId: ocId, session: "", sessionTaskIdentifier: 0, @@ -233,8 +239,15 @@ class NCViewerRichDocument: UIViewController, WKNavigationDelegate, WKScriptMess } if error == .success && account == self.metadata.account { var item = fileNameLocalPath + if let disposition = NextcloudKit.shared.nkCommonInstance.findHeader("Content-Disposition", allHeaderFields: allHeaderFields), + let filenameContentDisposition = self.filenameFromContentDisposition(disposition) { + fileName = filenameContentDisposition + item = self.utilityFileSystem.createServerUrl(serverUrl: self.utilityFileSystem.directoryUserData, fileName: fileName) + _ = self.utilityFileSystem.moveFile(atPath: fileNameLocalPath, toPath: item) + } - if let headers { + /* + if let allHeaderFields { if let disposition = headers["Content-Disposition"] as? String, let filenameContentDisposition = self.filenameFromContentDisposition(disposition) { fileName = filenameContentDisposition @@ -242,6 +255,7 @@ class NCViewerRichDocument: UIViewController, WKNavigationDelegate, WKScriptMess _ = self.utilityFileSystem.moveFile(atPath: fileNameLocalPath, toPath: item) } } + */ if type == "print" { let pic = UIPrintInteractionController.shared From 94638b6e4a3ac91c41a58a41ea185d1dc047d7ca Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Fri, 5 Jun 2026 09:13:09 +0200 Subject: [PATCH 35/67] hidden-fix (#4131) * error fix Signed-off-by: Marino Faggiana * fix Signed-off-by: Marino Faggiana --------- Signed-off-by: Marino Faggiana --- Share/NCShareExtension+Files.swift | 17 ++++++++++++++++- iOSClient/Networking/NCNetworking+WebDAV.swift | 6 +----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Share/NCShareExtension+Files.swift b/Share/NCShareExtension+Files.swift index 35716d7812..2d49ffcbc6 100644 --- a/Share/NCShareExtension+Files.swift +++ b/Share/NCShareExtension+Files.swift @@ -12,7 +12,22 @@ extension NCShareExtension { func reloadData() async { let session = NCShareExtensionData.shared.getSession() let layoutForView = NCManageDatabase.shared.getLayoutForView(account: session.account, key: keyLayout, serverUrl: serverUrl) - let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileName != %@ AND directory == true", session.account, serverUrl, NextcloudKit.shared.nkCommonInstance.rootFileName) + let showHiddenFiles = NCPreferences().getShowHiddenFiles(account: session.account) + let predicate = showHiddenFiles + ? NSPredicate( + format: "account == %@ AND serverUrl == %@ AND fileName != %@ AND directory == true", + session.account, + serverUrl, + NextcloudKit.shared.nkCommonInstance.rootFileName + ) + : NSPredicate( + format: "account == %@ AND serverUrl == %@ AND fileName != %@ AND directory == true AND NOT fileName BEGINSWITH[c] %@", + session.account, + serverUrl, + NextcloudKit.shared.nkCommonInstance.rootFileName, + "." + ) + let metadatas = await NCManageDatabase.shared.getMetadatasAsync(predicate: predicate, withLayout: layoutForView, withAccount: session.account) diff --git a/iOSClient/Networking/NCNetworking+WebDAV.swift b/iOSClient/Networking/NCNetworking+WebDAV.swift index a495bb4f13..9671a57355 100644 --- a/iOSClient/Networking/NCNetworking+WebDAV.swift +++ b/iOSClient/Networking/NCNetworking+WebDAV.swift @@ -44,9 +44,7 @@ extension NCNetworking { account: String, taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }, completion: @escaping (_ account: String, _ metadata: tableMetadata?, _ file: NKFile?, _ error: NKError) -> Void) { - let showHiddenFiles = NCPreferences().getShowHiddenFiles(account: account) - - NextcloudKit.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: showHiddenFiles, account: account) { task in + NextcloudKit.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", account: account) { task in Task { let identifier = await NCNetworking.shared.networkingTasks.createIdentifier(account: account, path: serverUrlFileName, @@ -69,10 +67,8 @@ extension NCNetworking { func readFileAsync(serverUrlFileName: String, account: String, taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }) async -> (account: String, metadata: tableMetadata?, error: NKError) { - let showHiddenFiles = NCPreferences().getShowHiddenFiles(account: account) let results = await NextcloudKit.shared.readFileOrFolderAsync(serverUrlFileName: serverUrlFileName, depth: "0", - showHiddenFiles: showHiddenFiles, account: account) { task in Task { let identifier = await NCNetworking.shared.networkingTasks.createIdentifier(account: account, From 08d79a56df4ec186ca6db9b6b529d3b9817196ef Mon Sep 17 00:00:00 2001 From: "Bernd.Rederlechner@t-systems.com" Date: Wed, 31 Jan 2024 10:02:05 +0100 Subject: [PATCH 36/67] Add custom build for debugging merge --- .github/workflows/nmc-custom-client.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/nmc-custom-client.yml diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml new file mode 100644 index 0000000000..71ce2a4f46 --- /dev/null +++ b/.github/workflows/nmc-custom-client.yml @@ -0,0 +1,37 @@ +### +# SPDX-License-Identifier: AGPL-3.0 +# +# Author: Bernd rederlechner +# +# Builds a stable release package based on a release assembly +# customisation-- +# +# As soon as a package is deployed to production, the tag and the branch +# MUST STAY FOR 2 years and not deleted. +# +# Release packages, tags and customisation branches not delivered to production should +# be deleted asap a newer release is available. +# + +name: MCLOUD custom client merge + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Custom build from base branch + options: + - master + - stable-4.9.7 + # - v3.0.8 + default: master + +jobs: + assemble-custom: + uses: nextmcloud/.github/.github/workflows/nmc-custom-client.yml@master + with: + trunk: 'master' + stable: ${{ inputs.branch }} + result: ${{ format('customisation-{0}-{1}', github.actor, inputs.branch) }} + secrets: inherit \ No newline at end of file From 60f94f0fba34e3c05315855066be16928ef869b3 Mon Sep 17 00:00:00 2001 From: "Bernd.Rederlechner@t-systems.com" Date: Mon, 12 Feb 2024 16:37:32 +0100 Subject: [PATCH 37/67] Add script for automatic backport PR creation --- .github/workflows/nmc-custom-stables.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/nmc-custom-stables.yml diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml new file mode 100644 index 0000000000..8062414c0f --- /dev/null +++ b/.github/workflows/nmc-custom-stables.yml @@ -0,0 +1,36 @@ +### +# SPDX-License-Identifier: AGPL-3.0 +# +# Author: Bernd rederlechner +# +# Builds a stable release package based on a release assembly +# customisation-- +# +# As soon as a package is deployed to production, the tag and the branch +# MUST STAY FOR 2 years and not deleted. +# +# Release packages, tags and customisation branches not delivered to production should +# be deleted asap a newer release is available. +# + +name: MCLOUD create stable backports + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Custom build from base branch + options: + - stable-4.9.7 + - 4.9.6 + - 4.9.5 + default: stable-4.9.7 + +jobs: + backport-custom: + uses: nextmcloud/.github/.github/workflows/nmc-custom-stables.yml@master + with: + trunk: 'master' + stable: ${{ inputs.branch }} + secrets: inherit \ No newline at end of file From 4cb4f9c7cb66c7daccda4972c67a54d3e4940051 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:09:32 +0530 Subject: [PATCH 38/67] Update script for adding new stable branch --- .github/workflows/nmc-custom-stables.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 8062414c0f..9058d719ed 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,10 +22,11 @@ on: type: choice description: Custom build from base branch options: + - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-4.9.7 + default: stable-5.2.1 jobs: backport-custom: @@ -33,4 +34,4 @@ jobs: with: trunk: 'master' stable: ${{ inputs.branch }} - secrets: inherit \ No newline at end of file + secrets: inherit From bd1129222adabe741ed38c7bddc89f375c46302b Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 15 Apr 2024 18:28:46 +0530 Subject: [PATCH 39/67] Update stable branch 5.2.7 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 9058d719ed..c1b444820d 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,11 +22,12 @@ on: type: choice description: Custom build from base branch options: + - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.2.1 + default: stable-5.2.7 jobs: backport-custom: From 2c0d8d132ce0a2fb2e5f41f7aac19febeb31fb8c Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 22 May 2024 12:27:39 +0530 Subject: [PATCH 40/67] Update new version 5.2.7 --- .github/workflows/nmc-custom-client.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 71ce2a4f46..bffac0f70b 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -24,6 +24,8 @@ on: options: - master - stable-4.9.7 + - stable-5.2.1 + - stable-5.2.7 # - v3.0.8 default: master @@ -34,4 +36,4 @@ jobs: trunk: 'master' stable: ${{ inputs.branch }} result: ${{ format('customisation-{0}-{1}', github.actor, inputs.branch) }} - secrets: inherit \ No newline at end of file + secrets: inherit From b69cede210f1cb3c49dff34458f3ac080fe1b107 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:58:51 +0530 Subject: [PATCH 41/67] Update nmc-custom-client.yml --- .github/workflows/nmc-custom-client.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index bffac0f70b..42f6190758 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -26,6 +26,7 @@ on: - stable-4.9.7 - stable-5.2.1 - stable-5.2.7 + - stable-5.5.0 # - v3.0.8 default: master From d9bf2d6388c75127de31e28fb19c9dcf9b906339 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:07:07 +0530 Subject: [PATCH 42/67] Update nmc-custom-stables.yml Added new stable 5.5.4 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index c1b444820d..aa1b6ca733 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,12 +22,13 @@ on: type: choice description: Custom build from base branch options: + - stable-5.5.4 - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.2.7 + default: stable-5.5.4 jobs: backport-custom: From 59f53cf25557573793478a6446663e1b77c20db3 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:41:09 +0530 Subject: [PATCH 43/67] Update nmc-custom-stables.yml for NC stable 5.5.5 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index aa1b6ca733..a9c6fa2b9d 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,13 +22,14 @@ on: type: choice description: Custom build from base branch options: + - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.5.4 + default: stable-5.5.5 jobs: backport-custom: From ffff0465f8aa259475ba665d4650273d03f76c03 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:42:57 +0530 Subject: [PATCH 44/67] Update nmc-custom-client.yml for NC Stable 5.5.5 --- .github/workflows/nmc-custom-client.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 42f6190758..1c140fefec 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -27,6 +27,7 @@ on: - stable-5.2.1 - stable-5.2.7 - stable-5.5.0 + - stable-5.5.5 # - v3.0.8 default: master From 12c22b8b55535a8bbde30d79a61c69484b2f078e Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 18 Nov 2024 14:57:36 +0530 Subject: [PATCH 45/67] Update nmc-custom-stables.yml for stable-6.1.3 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index a9c6fa2b9d..58cb823f28 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.1.3 - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 @@ -29,7 +30,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.5.5 + default: stable-6.1.3 jobs: backport-custom: From b3503310ad4560398988defb7189ba1be07b81d2 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 31 Mar 2025 14:56:50 +0530 Subject: [PATCH 46/67] Update nmc-custom-stables.yml Update nmc-custom-stables.yml for NC stable-6.2.7 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 58cb823f28..6494e6bb04 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 - stable-5.5.4 @@ -30,7 +31,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.1.3 + default: stable-6.2.7 jobs: backport-custom: From 043610cad2c6ee6c074194d95d48104a8675d8f5 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 31 Mar 2025 14:59:30 +0530 Subject: [PATCH 47/67] Update nmc-custom-client.yml Update nmc-custom-client.yml for NC Stable 6.2.7 --- .github/workflows/nmc-custom-client.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 1c140fefec..d7f0c57da2 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -28,6 +28,8 @@ on: - stable-5.2.7 - stable-5.5.0 - stable-5.5.5 + - stable-6.1.3 + - stable-6.2.7 # - v3.0.8 default: master From 45c88888ed644a746d31e0461c0f3be1898b1f32 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Wed, 16 Apr 2025 17:45:12 +0530 Subject: [PATCH 48/67] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 6494e6bb04..5ddb738302 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.6.0 - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 @@ -31,7 +32,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.2.7 + default: stable-6.6.0 jobs: backport-custom: From c744318a542822f62c022a2a54e234c92b6ee49c Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 13:56:34 +0530 Subject: [PATCH 49/67] Update nmc-custom-stables.yml for NC Stable 6.5.0 --- .github/workflows/nmc-custom-stables.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 5ddb738302..d418101a89 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,7 +22,7 @@ on: type: choice description: Custom build from base branch options: - - stable-6.6.0 + - stable-6.5.0 - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 @@ -32,7 +32,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.6.0 + default: stable-6.5.0 jobs: backport-custom: From 8bbd1187fbb5596fc5e726a72351b10d2fe3a0a4 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 15:23:20 +0530 Subject: [PATCH 50/67] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index d418101a89..ac0f14243f 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.6.0 - stable-6.5.0 - stable-6.2.7 - stable-6.1.3 @@ -32,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.5.0 + default: stable-6.6.0 jobs: backport-custom: From 8df59d58bce97c8148e4345b2d9acf21ce0c89a1 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 51/67] NMC 2161 - Menu option images and color theming changes --- .../File Provider Extension UI.xcscheme | 1 - .../WidgetDashboardIntentHandler.xcscheme | 1 - .../NCSelectableNavigationView.swift | 104 ++++++ iOSClient/Menu/AppDelegate+Menu.swift | 319 ++++++++++++++++++ 4 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 iOSClient/Main/Collection Common/NCSelectableNavigationView.swift create mode 100644 iOSClient/Menu/AppDelegate+Menu.swift diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 1427acf032..49c9d063cb 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 7b72936fb9..58dc296fe0 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift new file mode 100644 index 0000000000..6f337e7f5a --- /dev/null +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -0,0 +1,104 @@ +// +// NCSelectableNavigationView.swift +// Nextcloud +// +// Created by Henrik Storch on 27.01.22. +// Copyright © 2022 Henrik Storch. All rights reserved. +// +// Author Marino Faggiana +// Author Henrik Storch +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +import NextcloudKit +import Realm +import UIKit + +extension RealmSwiftObject { + var primaryKeyValue: String? { + guard let primaryKeyName = self.objectSchema.primaryKeyProperty?.name else { return nil } + return value(forKey: primaryKeyName) as? String + } +} + +public protocol NCSelectableViewTabBar { + var tabBarController: UITabBarController? { get } + var hostingController: UIViewController? { get } +} + +protocol NCSelectableNavigationView: AnyObject { + var viewController: UIViewController { get } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } + var selectIndexPaths: [IndexPath] { get set } + var titleCurrentFolder: String { get } + var navigationItem: UINavigationItem { get } + var navigationController: UINavigationController? { get } + var layoutKey: String { get } + var serverUrl: String { get } + var tabBarSelect: NCSelectableViewTabBar? { get set } + + func reloadDataSource(withQueryDB: Bool) + func setNavigationLeftItems() + func setNavigationRightItems(enableMenu: Bool) + func createMenuActions() -> [NCMenuAction] + + func toggleSelect(isOn: Bool?) + func onListSelected() + func onGridSelected() +} + +extension NCSelectableNavigationView { + func setNavigationLeftItems() {} + + func saveLayout(_ layoutForView: NCDBLayoutForView) { + NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView) + NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource) + setNavigationRightItems(enableMenu: false) + } + + /// If explicit `isOn` is not set, it will invert `isEditMode` + func toggleSelect(isOn: Bool? = nil) { + DispatchQueue.main.async { + self.isEditMode = isOn ?? !self.isEditMode + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() + self.setNavigationLeftItems() + self.setNavigationRightItems(enableMenu: true) + self.collectionView.reloadData() + } + } + + func collectionViewSelectAll() { + selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) + collectionView.reloadData() + setNavigationRightItems(enableMenu: false) + } + + func tapNotification() { + if let viewController = UIStoryboard(name: "NCNotification", bundle: nil).instantiateInitialViewController() as? NCNotification { + navigationController?.pushViewController(viewController, animated: true) + } + } +} + +extension NCSelectableNavigationView where Self: UIViewController { + var viewController: UIViewController { + self + } +} diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift new file mode 100644 index 0000000000..7041b8eaa9 --- /dev/null +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -0,0 +1,319 @@ +// +// AppDelegate+Menu.swift +// Nextcloud +// +// Created by Philippe Weidmann on 24.01.20. +// Copyright © 2020 Philippe Weidmann. All rights reserved. +// Copyright © 2020 Marino Faggiana All rights reserved. +// +// Author Philippe Weidmann +// Author Marino Faggiana +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +import UIKit +import FloatingPanel +import NextcloudKit + +extension AppDelegate { + func toggleMenu(controller: NCMainTabBarController, sender: Any?) { + var actions: [NCMenuAction] = [] + let session = NCSession.shared.getSession(controller: controller) + let utilityFileSystem = NCUtilityFileSystem() + let serverUrl = controller.currentServerUrl() + let isDirectoryE2EE = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, account: session.account) + let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) + let utility = NCUtility() + let capabilities = NKCapabilities.shared.getCapabilitiesBlocking(for: session.account) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_upload_photos_videos_", comment: ""), + icon: utility.loadImage(named: "photo", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in + if hasPermission {NCPhotosPickerViewController(controller: controller, maxSelectedAssets: 0, singleSelectedMode: false) + } + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_upload_file_", comment: ""), + icon: utility.loadImage(named: "doc", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) + } + ) + ) + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "text" }), + !isDirectoryE2EE { + actions.append( + NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), + icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + Task { + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + creator.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + NCCreateDocument().createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "text", creatorId: creator.identifier, templateId: "document", account: session.account) + } +// let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! +// guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { +// return +// } +// navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorText +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.editorText +// viewController.serverUrl = appDelegate.activeServerUrl +// viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") +// appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil) +// } + }) + ) + } + + actions.append( + NCMenuAction( + title: NSLocalizedString("_scans_document_", comment: ""), + icon: utility.loadImage(named: "doc.text.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCDocumentCamera.shared.openScannerDocument(viewController: controller) + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_voice_memo_", comment: ""), + icon: utility.loadImage(named: "mic", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in + if hasPermission { + if let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController { + viewController.controller = controller + viewController.modalTransitionStyle = .crossDissolve + viewController.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext + controller.present(viewController, animated: true, completion: nil) + } + } + } + } + ) + ) + + if NCKeychain().isEndToEndEnabled(account: session.account) { + actions.append(.seperator(order: 0, sender: sender)) + } + + let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") + let imageCreateFolder = isDirectoryE2EE ? NCImageCache.shared.getFolderEncrypted(account: session.account) : NCImageCache.shared.getFolder(account: session.account) + actions.append( + NCMenuAction(title: titleCreateFolder, + icon: imageCreateFolder, + sender: sender, + action: { _ in + let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, sceneIdentifier: controller.sceneIdentifier) + controller.present(alertController, animated: true, completion: nil) + } + ) + ) + + // Folder encrypted + if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { + // Folder encrypted (ONLY ROOT) +// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: appDelegate.account) && (NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) == appDelegate.activeServerUrl) { + actions.append( + NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), + icon: NCImageCache.shared.getFolderEncrypted(account: session.account), + sender: sender, + action: { _ in + let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) + controller.present(alertController, animated: true, completion: nil) + }) + ) + } + + if NCKeychain().isEndToEndEnabled(account: session.account) { + actions.append(.seperator(order: 0, sender: sender)) + } + + if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { + actions.append( + NCMenuAction( + title: NSLocalizedString("_add_folder_info_", comment: ""), + icon: NCUtility().loadImage(named: "list.dash.header.rectangle", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + let richWorkspaceCommon = NCRichWorkspaceCommon() + if let viewController = controller.currentViewController() { + if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", + session.account, + serverUrl, + NCGlobal.shared.fileNameRichWorkspace.lowercased())) == nil { + richWorkspaceCommon.createViewerNextcloudText(serverUrl: serverUrl, viewController: viewController, session: session) + } else { + richWorkspaceCommon.openViewerNextcloudText(serverUrl: serverUrl, viewController: viewController, session: session) + } + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_docx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_document_", comment: ""), + icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.documentIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_xlsx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), + icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_pptx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_presentation_", comment: ""), + icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if capabilities.richDocumentsEnabled { + if NextcloudKit.shared.isNetworkReachable() && !isDirectoryE2EE { + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_document_", comment: ""), + icon: utility.loadImage(named: "doc.richtext", colors: [NCBrandColor.shared.documentIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), + icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_presentation_", comment: ""), + icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + } + + controller.presentMenu(with: actions, controller: controller, sender: sender) + } +} From 50e92ba0004a93f4deb67475cf4d4da4f8ca2c51 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 52/67] NMC 2161 - Menu option images and color theming and other changes --- Nextcloud.xcodeproj/project.pbxproj | 10 +- .../File Provider Extension UI.xcscheme | 1 + .../WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 127 ++++++++++++++---- 4 files changed, 112 insertions(+), 27 deletions(-) diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index a3788d3efc..6d00267c44 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -85,6 +85,10 @@ AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */; }; AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; }; CB3666201AF7550816B5CD6A /* NCContextMenuComment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8932E90EC4278026D86CCCC9 /* NCContextMenuComment.swift */; }; + AFCE353927E5DE0500FEA6C2 /* NCShare+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */; }; + B52FAED52DA8F616001AB1BD /* NCSelectableNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */; }; + C04E2F232A17BB4D001BAD85 /* FilesIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04E2F222A17BB4D001BAD85 /* FilesIntegrationTests.swift */; }; + D575039F27146F93008DC9DC /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; }; D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; }; F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */; }; F31165022F9674A1009A1E37 /* AppIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = F31165012F9674A1009A1E37 /* AppIcon.icon */; }; @@ -1268,8 +1272,8 @@ AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+Extension.swift"; sourceTree = ""; }; AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareCells.swift; sourceTree = ""; }; AFCE353827E5DE0400FEA6C2 /* Shareable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shareable.swift; sourceTree = ""; }; - B4C7A5B36D1ED178FB6B76CB /* NCContextMenuPlayerTracks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCContextMenuPlayerTracks.swift; sourceTree = ""; }; - BB7697C94BA14450A0867940 /* NCContextMenuProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCContextMenuProfile.swift; sourceTree = ""; }; + AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCShare+Helper.swift"; sourceTree = ""; }; + B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSelectableNavigationView.swift; sourceTree = ""; }; C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = ""; }; @@ -2556,6 +2560,7 @@ F7603298252F0E550015A421 /* Collection Common */ = { isa = PBXGroup; children = ( + B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */, F75FE06B2BB01D0D00A0EFEF /* Cell */, F70D7C3525FFBF81002B9E34 /* NCCollectionViewCommon.swift */, F76995F32F9A4AC000291FA7 /* NCCollectionViewCommon+UIEditMenuInteractionDelegate.swift */, @@ -4866,6 +4871,7 @@ F7FFFCA22FB300600015441E /* NCAssistantSharedTextStore.swift in Sources */, F3DDFE0F2F15453900A784C8 /* NCAssistantChat.swift in Sources */, F7D68FCC28CB9051009139F3 /* NCManageDatabase+DashboardWidget.swift in Sources */, + B52FAED52DA8F616001AB1BD /* NCSelectableNavigationView.swift in Sources */, F76882292C0DD1E7001CF441 /* NCManageE2EEModel.swift in Sources */, F7CCAB512ECF316700F8E68B /* NCCollectionViewCommon+SyncMetadata.swift in Sources */, AA8E041D2D300FDE00E7E89C /* NCShareNetworkingDelegate.swift in Sources */, diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 49c9d063cb..1427acf032 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 58dc296fe0..7b72936fb9 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index 7041b8eaa9..a06680d3e9 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -41,7 +41,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_upload_photos_videos_", comment: ""), - icon: utility.loadImage(named: "photo", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in @@ -55,7 +55,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_upload_file_", comment: ""), - icon: utility.loadImage(named: "doc", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) @@ -68,7 +68,7 @@ extension AppDelegate { !isDirectoryE2EE { actions.append( NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), - icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in Task { @@ -86,9 +86,9 @@ extension AppDelegate { // viewController.editorId = NCGlobal.shared.editorText // viewController.creatorId = directEditingCreator.identifier // viewController.typeTemplate = NCGlobal.shared.editorText -// viewController.serverUrl = appDelegate.activeServerUrl +// viewController.serverUrl = serverUrl // viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") -// appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil) +// controller.present(navigationController, animated: true, completion: nil) // } }) ) @@ -97,7 +97,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_scans_document_", comment: ""), - icon: utility.loadImage(named: "doc.text.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), + icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCDocumentCamera.shared.openScannerDocument(viewController: controller) @@ -108,7 +108,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_voice_memo_", comment: ""), - icon: utility.loadImage(named: "mic", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in @@ -130,7 +130,7 @@ extension AppDelegate { } let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") - let imageCreateFolder = isDirectoryE2EE ? NCImageCache.shared.getFolderEncrypted(account: session.account) : NCImageCache.shared.getFolder(account: session.account) + let imageCreateFolder = isDirectoryE2EE ? UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50) : UIImage(named: "addFolder")! actions.append( NCMenuAction(title: titleCreateFolder, icon: imageCreateFolder, @@ -145,10 +145,10 @@ extension AppDelegate { // Folder encrypted if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { // Folder encrypted (ONLY ROOT) -// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: appDelegate.account) && (NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) == appDelegate.activeServerUrl) { +// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { actions.append( NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), - icon: NCImageCache.shared.getFolderEncrypted(account: session.account), + icon: UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) @@ -165,7 +165,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_add_folder_info_", comment: ""), - icon: NCUtility().loadImage(named: "list.dash.header.rectangle", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in let richWorkspaceCommon = NCRichWorkspaceCommon() @@ -190,17 +190,30 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_document_", comment: ""), - icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.documentIconColor]), + icon: UIImage(named: "create_file_document")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + // if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + // viewController.editorId = NCGlobal.shared.editorOnlyoffice + // viewController.creatorId = directEditingCreator.identifier + // viewController.typeTemplate = NCGlobal.shared.templateDocument + // viewController.serverUrl = serverUrl + // viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") + // + // controller.present(navigationController, animated: true, completion: nil) + // } } } ) @@ -213,10 +226,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + icon: UIImage(named: "create_file_xls")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) @@ -224,6 +241,15 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorOnlyoffice +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -236,10 +262,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + icon: UIImage(named: "create_file_ppt")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) @@ -247,6 +277,15 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorOnlyoffice +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.templatePresentation +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -258,10 +297,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_document_", comment: ""), - icon: utility.loadImage(named: "doc.richtext", colors: [NCBrandColor.shared.documentIconColor]), + icon: UIImage(named: "create_file_document")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) @@ -269,6 +312,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templateDocument +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -277,10 +328,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + icon: UIImage(named: "create_file_xls")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) @@ -288,6 +343,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -296,10 +359,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + icon: UIImage(named: "create_file_ppt")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) @@ -307,6 +374,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templatePresentation +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -314,6 +389,8 @@ extension AppDelegate { } } - controller.presentMenu(with: actions, controller: controller, sender: sender) +// controller.presentMenu(with: actions, controller: controller, sender: sender) + AnalyticsHelper.shared.trackEvent(eventName: .EVENT__ACTION_BUTTON) + controller.presentMenu(with: actions) } } From 6d04afceaa81c6f38de3a4ad00c9eb9fc729e7e8 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 53/67] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 22 +- iOSClient/Menu/AppDelegate+Menu.swift | 262 ++++++------------ 2 files changed, 94 insertions(+), 190 deletions(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 6f337e7f5a..94715d4e44 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,20 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } - var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } - var selectOcId: [String] { get set } - var selectIndexPaths: [IndexPath] { get set } + var fileSelect: [String] { get set } var titleCurrentFolder: String { get } var navigationItem: UINavigationItem { get } var navigationController: UINavigationController? { get } var layoutKey: String { get } var serverUrl: String { get } - var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] @@ -76,8 +73,7 @@ extension NCSelectableNavigationView { func toggleSelect(isOn: Bool? = nil) { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode - self.selectOcId.removeAll() - self.selectIndexPaths.removeAll() + self.fileSelect.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -85,7 +81,8 @@ extension NCSelectableNavigationView { } func collectionViewSelectAll() { - selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) + + fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } @@ -95,6 +92,15 @@ extension NCSelectableNavigationView { navigationController?.pushViewController(viewController, animated: true) } } + + func tapTransfer() { + if let navController = UIStoryboard(name: "NCTransfers", bundle: nil).instantiateInitialViewController() as? UINavigationController, + let viewController = navController.topViewController as? NCTransfers { + viewController.modalPresentationStyle = .pageSheet +// self.present(navigationController, animated: true, completion: nil) + navigationController?.present(navController, animated: true, completion: nil) + } + } } extension NCSelectableNavigationView where Self: UIViewController { diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index a06680d3e9..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -28,22 +28,18 @@ import FloatingPanel import NextcloudKit extension AppDelegate { - func toggleMenu(controller: NCMainTabBarController, sender: Any?) { + func toggleMenu(controller: NCMainTabBarController) { var actions: [NCMenuAction] = [] let session = NCSession.shared.getSession(controller: controller) - let utilityFileSystem = NCUtilityFileSystem() + let directEditingCreators = NCManageDatabase.shared.getDirectEditingCreators(account: session.account) let serverUrl = controller.currentServerUrl() let isDirectoryE2EE = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, account: session.account) let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) let utility = NCUtility() - let capabilities = NKCapabilities.shared.getCapabilitiesBlocking(for: session.account) actions.append( NCMenuAction( - title: NSLocalizedString("_upload_photos_videos_", comment: ""), - icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_upload_photos_videos_", comment: ""), icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in if hasPermission {NCPhotosPickerViewController(controller: controller, maxSelectedAssets: 0, singleSelectedMode: false) } @@ -54,52 +50,35 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_upload_file_", comment: ""), - icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_upload_file_", comment: ""), icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) } ) ) - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "text" }), - !isDirectoryE2EE { + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorText}) && !isDirectoryE2EE { actions.append( - NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), - icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in - Task { - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + creator.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - - NCCreateDocument().createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "text", creatorId: creator.identifier, templateId: "document", account: session.account) - } -// let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! -// guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { -// return -// } -// navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorText -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.editorText -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") -// controller.present(navigationController, animated: true, completion: nil) -// } + NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorText + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.editorText + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") + controller.present(navigationController, animated: true, completion: nil) + } }) ) } actions.append( NCMenuAction( - title: NSLocalizedString("_scans_document_", comment: ""), - icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_scans_document_", comment: ""), icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCDocumentCamera.shared.openScannerDocument(viewController: controller) } ) @@ -107,10 +86,7 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_voice_memo_", comment: ""), - icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_create_voice_memo_", comment: ""), icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in if hasPermission { if let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController { @@ -126,30 +102,25 @@ extension AppDelegate { ) if NCKeychain().isEndToEndEnabled(account: session.account) { - actions.append(.seperator(order: 0, sender: sender)) + actions.append(.seperator(order: 0)) } let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") let imageCreateFolder = isDirectoryE2EE ? UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50) : UIImage(named: "addFolder")! actions.append( NCMenuAction(title: titleCreateFolder, - icon: imageCreateFolder, - sender: sender, - action: { _ in + icon: imageCreateFolder, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, sceneIdentifier: controller.sceneIdentifier) controller.present(alertController, animated: true, completion: nil) } ) ) - // Folder encrypted - if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { // Folder encrypted (ONLY ROOT) -// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { + if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { actions.append( NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), icon: UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) controller.present(alertController, animated: true, completion: nil) @@ -158,16 +129,13 @@ extension AppDelegate { } if NCKeychain().isEndToEndEnabled(account: session.account) { - actions.append(.seperator(order: 0, sender: sender)) + actions.append(.seperator(order: 0)) } - if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { + if NCCapabilities.shared.getCapabilities(account: session.account).capabilityServerVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { actions.append( NCMenuAction( - title: NSLocalizedString("_add_folder_info_", comment: ""), - icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_add_folder_info_", comment: ""), icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in let richWorkspaceCommon = NCRichWorkspaceCommon() if let viewController = controller.currentViewController() { if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", @@ -184,142 +152,95 @@ extension AppDelegate { ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_docx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeDocx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeDocx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_document_", comment: ""), - icon: UIImage(named: "create_file_document")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_document_", comment: ""), icon: UIImage(named: "create_file_document")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) - // if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { - // viewController.editorId = NCGlobal.shared.editorOnlyoffice - // viewController.creatorId = directEditingCreator.identifier - // viewController.typeTemplate = NCGlobal.shared.templateDocument - // viewController.serverUrl = serverUrl - // viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") - // - // controller.present(navigationController, animated: true, completion: nil) - // } + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templateDocument + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") + + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_xlsx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeXlsx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeXlsx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: UIImage(named: "create_file_xls")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: UIImage(named: "create_file_xls")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorOnlyoffice -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_pptx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficePptx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficePptx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: UIImage(named: "create_file_ppt")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: UIImage(named: "create_file_ppt")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templatePresentation + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorOnlyoffice -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.templatePresentation -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if capabilities.richDocumentsEnabled { + if NCCapabilities.shared.getCapabilities(account: session.account).capabilityRichDocumentsEnabled { if NextcloudKit.shared.isNetworkReachable() && !isDirectoryE2EE { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_document_", comment: ""), - icon: UIImage(named: "create_file_document")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_document_", comment: ""), icon: UIImage(named: "create_file_document")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templateDocument + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templateDocument -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -327,30 +248,19 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: UIImage(named: "create_file_xls")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: UIImage(named: "create_file_xls")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -358,30 +268,19 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: UIImage(named: "create_file_ppt")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: UIImage(named: "create_file_ppt")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templatePresentation + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templatePresentation -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -389,7 +288,6 @@ extension AppDelegate { } } -// controller.presentMenu(with: actions, controller: controller, sender: sender) AnalyticsHelper.shared.trackEvent(eventName: .EVENT__ACTION_BUTTON) controller.presentMenu(with: actions) } From 855fc9a3ef1a6e380c21bde25168fa3395f036b2 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 13:56:34 +0530 Subject: [PATCH 54/67] Update nmc-custom-stables.yml for NC Stable 6.5.0 --- .github/workflows/nmc-custom-stables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index ac0f14243f..2ec6976ef2 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -33,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.6.0 + default: stable-6.5.0 jobs: backport-custom: From 94e15eeefdbab1eff684f5cf1eba1f410eb3be14 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 15:23:20 +0530 Subject: [PATCH 55/67] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 2ec6976ef2..ac0f14243f 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -33,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.5.0 + default: stable-6.6.0 jobs: backport-custom: From a807f10c7fe142688ae3ef7c2542127b6ff2a847 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 56/67] NMC 2161 - Menu option images and color theming changes --- .../xcschemes/File Provider Extension UI.xcscheme | 1 - .../xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 - .../Main/Collection Common/NCSelectableNavigationView.swift | 5 +++++ iOSClient/Menu/AppDelegate+Menu.swift | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 1427acf032..49c9d063cb 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 7b72936fb9..58dc296fe0 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 94715d4e44..04b08c5606 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -44,6 +44,8 @@ protocol NCSelectableNavigationView: AnyObject { var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } + var appDelegate: AppDelegate { get } + var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } var navigationItem: UINavigationItem { get } var navigationController: UINavigationController? { get } @@ -51,6 +53,9 @@ protocol NCSelectableNavigationView: AnyObject { var serverUrl: String { get } // func reloadDataSource(withQueryDB: Bool) + var tabBarSelect: NCSelectableViewTabBar? { get set } + + func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index c2f3307daf..f228bdd55a 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,6 +170,7 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) + } } ) From 471e28519230a1852517489545f3fe30aa8b0e49 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 57/67] NMC 2161 - Menu option images and color theming and other changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 + .../xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 49c9d063cb..1427acf032 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 58dc296fe0..7b72936fb9 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index f228bdd55a..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,7 +170,6 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) - } } ) From 2f46f3a24b9d69b174033394f7979043d7d48923 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 58/67] NMC 2161 - Menu option changes --- .../Main/Collection Common/NCSelectableNavigationView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 04b08c5606..2e07da992e 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -55,7 +55,7 @@ protocol NCSelectableNavigationView: AnyObject { // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] From 9d4167325f64ad964188ebd2201663828791a202 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Tue, 16 Dec 2025 14:59:08 +0530 Subject: [PATCH 59/67] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 2e07da992e..17dbb04c03 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,10 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } +// var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } +// var selectIndexPaths: [IndexPath] { get set } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -51,10 +58,13 @@ protocol NCSelectableNavigationView: AnyObject { var navigationController: UINavigationController? { get } var layoutKey: String { get } var serverUrl: String { get } +// var tabBarSelect: NCSelectableViewTabBar? { get set } +// var dataSource: NCCollectionViewDataSource { get set } // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } + func reloadDataSource(withQueryDB: Bool) // func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) @@ -79,6 +89,9 @@ extension NCSelectableNavigationView { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() +// self.selectIndexPaths.removeAll() + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -88,6 +101,8 @@ extension NCSelectableNavigationView { func collectionViewSelectAll() { fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) +// fileSelect = NCCollectionViewDataSource().getMetadataSourceForAllSections().compactMap({ $0.primaryKeyValue }) +// selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } From 65831ce2176be977f7b4ed1435f141a31d90b265 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:09:32 +0530 Subject: [PATCH 60/67] Update script for adding new stable branch --- .github/workflows/nmc-custom-stables.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index ac0f14243f..176c03eb96 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -29,10 +29,6 @@ on: - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 - - stable-5.2.1 - - stable-4.9.7 - - 4.9.6 - - 4.9.5 default: stable-6.6.0 jobs: From 62467c85ba5bf4441577ccdd385193560c42eee6 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 61/67] NMC 2161 - Menu option images and color theming changes --- .../xcschemes/File Provider Extension UI.xcscheme | 1 - .../xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 - .../Collection Common/NCSelectableNavigationView.swift | 9 --------- 3 files changed, 11 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 1427acf032..49c9d063cb 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 7b72936fb9..58dc296fe0 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 17dbb04c03..9581332e68 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -46,11 +46,6 @@ protocol NCSelectableNavigationView: AnyObject { var isEditMode: Bool { get set } var fileSelect: [String] { get set } // var selectIndexPaths: [IndexPath] { get set } - var appDelegate: AppDelegate { get } - var selectableDataSource: [RealmSwiftObject] { get } - var collectionView: UICollectionView! { get set } - var isEditMode: Bool { get set } - var selectOcId: [String] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -90,8 +85,6 @@ extension NCSelectableNavigationView { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() // self.selectIndexPaths.removeAll() - self.selectOcId.removeAll() - self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -101,8 +94,6 @@ extension NCSelectableNavigationView { func collectionViewSelectAll() { fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) -// fileSelect = NCCollectionViewDataSource().getMetadataSourceForAllSections().compactMap({ $0.primaryKeyValue }) -// selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } From 3bb4e116bbdabe393331a9c4f89e6e1246f521c6 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 62/67] NMC 2161 - Menu option images and color theming and other changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 + .../xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 + 2 files changed, 2 insertions(+) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 49c9d063cb..1427acf032 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 58dc296fe0..7b72936fb9 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> From e4798c15998888573f34b3cf696c7fd6ba7df934 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 63/67] NMC 2161 - Menu option changes --- .../Main/Collection Common/NCSelectableNavigationView.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 9581332e68..a7e5405e7b 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,7 +40,6 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } -// var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } @@ -84,7 +83,6 @@ extension NCSelectableNavigationView { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() -// self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() From 26fdabae7485e497f48b7905bbfd0c021e3eaa43 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 64/67] NMC 2161 - Menu option images and color theming changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 - .../xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 - .../Main/Collection Common/NCSelectableNavigationView.swift | 2 -- iOSClient/Menu/AppDelegate+Menu.swift | 1 + 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 1427acf032..49c9d063cb 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 7b72936fb9..58dc296fe0 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index a7e5405e7b..befcfa43a7 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -44,7 +44,6 @@ protocol NCSelectableNavigationView: AnyObject { var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } -// var selectIndexPaths: [IndexPath] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -59,7 +58,6 @@ protocol NCSelectableNavigationView: AnyObject { var tabBarSelect: NCSelectableViewTabBar? { get set } func reloadDataSource(withQueryDB: Bool) -// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index c2f3307daf..f228bdd55a 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,6 +170,7 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) + } } ) From cb22d223ef55950d99df231d6d7a6033fa7f3571 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 65/67] NMC 2161 - Menu option images and color theming and other changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 + .../xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 49c9d063cb..1427acf032 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 58dc296fe0..7b72936fb9 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index f228bdd55a..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,7 +170,6 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) - } } ) From 295a66fe2487aff2fe9a248933ababf5715260a8 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 66/67] NMC 2161 - Menu option changes --- .../Main/Collection Common/NCSelectableNavigationView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index befcfa43a7..5a11221cf8 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -57,7 +57,7 @@ protocol NCSelectableNavigationView: AnyObject { // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] From f6d91a70978e6db9a488ff6d3e19ca039e3a7b6f Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Tue, 16 Dec 2025 14:59:08 +0530 Subject: [PATCH 67/67] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 5a11221cf8..17dbb04c03 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,10 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } +// var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } +// var selectIndexPaths: [IndexPath] { get set } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -57,6 +64,7 @@ protocol NCSelectableNavigationView: AnyObject { // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } + func reloadDataSource(withQueryDB: Bool) // func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) @@ -81,6 +89,9 @@ extension NCSelectableNavigationView { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() +// self.selectIndexPaths.removeAll() + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -90,6 +101,8 @@ extension NCSelectableNavigationView { func collectionViewSelectAll() { fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) +// fileSelect = NCCollectionViewDataSource().getMetadataSourceForAllSections().compactMap({ $0.primaryKeyValue }) +// selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) }