From 4241dd78cd82173977c6113a7ebedad050b2e072 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 09:30:13 +0100 Subject: [PATCH 01/22] chore: Upgrade tuist + Explicitly declare dependencies Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 4 +- .mise.toml | 2 +- Project.swift | 60 +++++++++++++------ Tuist/Package.swift | 18 ++++-- .../ExtensionTarget.swift | 6 +- kDriveCore/VideoPlayer/VideoPlayer.swift | 1 - 6 files changed, 65 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 830e5f2dc..5976cb1a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,6 @@ jobs: touch $ENV_PATH echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH - name: Build - run: tuist install && tuist build --generate kDrive + run: tuist install && tuist generate && tuist build --clean kDrive - name: Test - run: tuist test kDrive --test-targets kDriveTests/DriveApiTests + run: tuist test kDrive-Workspace --test-targets kDriveTests/DriveApiTests diff --git a/.mise.toml b/.mise.toml index 1b1ca60cd..670fa8f30 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] -tuist = '4.12.1' +tuist = '4.41.0' periphery = '2.21.1' swiftformat = '0.54.5' swiftlint = '0.57.0' diff --git a/Project.swift b/Project.swift index 5036116a1..6eb3937b7 100644 --- a/Project.swift +++ b/Project.swift @@ -48,13 +48,17 @@ let project = Project(name: "kDrive", .target(name: "kDriveCore"), .target(name: "kDriveShareExtension"), .target(name: "kDriveActionExtension"), - .external(name: "FloatingPanel"), - .external(name: "Lottie"), + .external(name: "CocoaLumberjackSwift"), + .external(name: "CocoaLumberjack"), .external(name: "DropDown"), + .external(name: "FloatingPanel"), + .external(name: "Highlightr"), .external(name: "HorizonCalendar"), .external(name: "Kvitto"), - .external(name: "Highlightr"), + .external(name: "Lottie"), .external(name: "MarkdownKit"), + .external(name: "RealmSwift"), + .external(name: "Realm"), .sdk(name: "StoreKit", type: .framework, status: .required) ], settings: .settings(base: Constants.baseSettings), @@ -76,7 +80,16 @@ let project = Project(name: "kDrive", "kDriveTests/**/*.json" ], dependencies: [ - .target(name: "kDrive") + .target(name: "kDrive"), + .target(name: "kDriveCore"), + .external(name: "Alamofire"), + .external(name: "InfomaniakCoreCommonUI"), + .external(name: "InfomaniakCoreUIKit"), + .external(name: "InfomaniakCore"), + .external(name: "InfomaniakDI"), + .external(name: "InfomaniakLogin"), + .external(name: "RealmSwift"), + .external(name: "Realm") ], settings: .settings(base: Constants.testSettings)), .target(name: "kDriveAPITests", @@ -90,7 +103,13 @@ let project = Project(name: "kDrive", "kDriveTestShared/**" ], dependencies: [ - .target(name: "kDrive") + .target(name: "kDrive"), + .target(name: "kDriveCore"), + .external(name: "InfomaniakCore"), + .external(name: "InfomaniakDI"), + .external(name: "InfomaniakLogin"), + .external(name: "RealmSwift"), + .external(name: "Realm") ], settings: .settings(base: Constants.testSettings)), .target(name: "kDriveUITests", @@ -133,24 +152,25 @@ let project = Project(name: "kDrive", .external(name: "Alamofire"), .external(name: "Algorithms"), .external(name: "Atlantis"), - .external(name: "MQTTNIO"), - .external(name: "InfomaniakCore"), - .external(name: "InfomaniakCoreDB"), + .external(name: "CocoaLumberjackSwift"), + .external(name: "CocoaLumberjack"), + .external(name: "DifferenceKit"), + .external(name: "InfomaniakConcurrency"), .external(name: "InfomaniakCoreCommonUI"), + .external(name: "InfomaniakCoreDB"), .external(name: "InfomaniakCoreSwiftUI"), .external(name: "InfomaniakCoreUIKit"), - .external(name: "InfomaniakLogin"), + .external(name: "InfomaniakCore"), .external(name: "InfomaniakDI"), - .external(name: "InfomaniakConcurrency"), - .external(name: "RealmSwift"), + .external(name: "InfomaniakLogin"), .external(name: "Kingfisher"), - .external(name: "DifferenceKit"), - .external(name: "CocoaLumberjackSwift"), + .external(name: "LocalizeKit"), .external(name: "MaterialOutlinedTextField"), - .external(name: "SwiftRegex"), + .external(name: "MQTTNIO"), + .external(name: "RealmSwift"), .external(name: "Sentry-Dynamic"), - .external(name: "VersionChecker"), - .external(name: "LocalizeKit") + .external(name: "SwiftRegex"), + .external(name: "VersionChecker") ]), .target(name: "kDriveFileProvider", destinations: Constants.destinations, @@ -170,7 +190,13 @@ let project = Project(name: "kDrive", headers: .headers(project: "kDriveFileProvider/**"), entitlements: "kDriveFileProvider/FileProvider.entitlements", dependencies: [ - .target(name: "kDriveCore") + .target(name: "kDriveCore"), + .external(name: "CocoaLumberjackSwift"), + .external(name: "CocoaLumberjack"), + .external(name: "InfomaniakCore"), + .external(name: "InfomaniakDI"), + .external(name: "InfomaniakLogin"), + .external(name: "RealmSwift") ], settings: .settings( base: Constants.fileProviderSettings, diff --git a/Tuist/Package.swift b/Tuist/Package.swift index be1b55181..9c98e60d0 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -1,5 +1,5 @@ -// swift-tools-version: 5.9 -import PackageDescription +// swift-tools-version: 5.10 +@preconcurrency import PackageDescription #if TUIST import ProjectDescription @@ -7,8 +7,18 @@ import ProjectDescriptionHelpers let packageSettings = PackageSettings( productTypes: [ - "RealmSwift": .staticLibrary, - "Realm": .staticLibrary + "Alamofire": .framework, + "Atlantis": .staticFramework, + "CocoaLumberjackSwift": .framework, + "CocoaLumberjack": .framework, + "InfomaniakDI": .framework, + "InfomaniakLogin": .framework, + "InfomaniakCore": .framework, + "InfomaniakCoreCommonUI": .framework, + "InfomaniakCoreUIKit": .framework, + "Kingfisher": .framework, + "RealmSwift": .framework, + "Realm": .framework ] ) diff --git a/Tuist/ProjectDescriptionHelpers/ExtensionTarget.swift b/Tuist/ProjectDescriptionHelpers/ExtensionTarget.swift index 29445bbf3..20c693a22 100644 --- a/Tuist/ProjectDescriptionHelpers/ExtensionTarget.swift +++ b/Tuist/ProjectDescriptionHelpers/ExtensionTarget.swift @@ -109,7 +109,11 @@ public extension Target { .external(name: "FloatingPanel"), .external(name: "Lottie"), .external(name: "DropDown"), - .external(name: "HorizonCalendar") + .external(name: "HorizonCalendar"), + .external(name: "Realm"), + .external(name: "RealmSwift"), + .external(name: "CocoaLumberjack"), + .external(name: "CocoaLumberjackSwift") ], settings: settings) } diff --git a/kDriveCore/VideoPlayer/VideoPlayer.swift b/kDriveCore/VideoPlayer/VideoPlayer.swift index 215f6beaa..fffd882b0 100644 --- a/kDriveCore/VideoPlayer/VideoPlayer.swift +++ b/kDriveCore/VideoPlayer/VideoPlayer.swift @@ -18,7 +18,6 @@ import AVKit import Combine -import FloatingPanel import InfomaniakCore import InfomaniakDI import kDriveResources From 9b80a95253ffa77722ffa5556c1d35b4153d09ed Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 10:35:34 +0100 Subject: [PATCH 02/22] fix: Remove target grouping Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 4 ++-- Project.swift | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5976cb1a0..40cb1ad42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,5 +31,5 @@ jobs: echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH - name: Build run: tuist install && tuist generate && tuist build --clean kDrive - - name: Test - run: tuist test kDrive-Workspace --test-targets kDriveTests/DriveApiTests + - name: Test API + run: tuist test kDriveAPITests --test-targets kDriveAPITests diff --git a/Project.swift b/Project.swift index 6eb3937b7..7ac81dae1 100644 --- a/Project.swift +++ b/Project.swift @@ -21,7 +21,11 @@ import ProjectDescription import ProjectDescriptionHelpers let project = Project(name: "kDrive", - packages: [], + options: .options( + automaticSchemesOptions: .enabled( + targetSchemesGrouping: .notGrouped + ) + ), targets: [ .target(name: "kDrive", destinations: Constants.destinations, From 59c0bda68e56d2e1ab73b2f7e6c5b7612d011e1b Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 10:56:32 +0100 Subject: [PATCH 03/22] test: Shared Env Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 2 +- .gitignore | 1 + .../Env.sample.swift | 0 kDriveTests/Env.sample.swift | 40 ------------------- 4 files changed, 2 insertions(+), 41 deletions(-) rename {kDriveAPITests => kDriveTestShared}/Env.sample.swift (100%) delete mode 100644 kDriveTests/Env.sample.swift diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40cb1ad42..b001741f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v2 - name: Create test env env: - ENV_PATH: "kDriveTests/Env.swift" + ENV_PATH: "kDriveTestShared/Env.swift" ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} USER_ID: ${{ secrets.USER_ID }} INVITE_USER_ID: ${{ secrets.INVITE_USER_ID }} diff --git a/.gitignore b/.gitignore index 7fd4b0278..ca6d36877 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,4 @@ release/ kDriveTests/Env.swift kDriveAPITests/Env.swift kDriveUITests/Env.swift +kDriveTestShared/Env.swift diff --git a/kDriveAPITests/Env.sample.swift b/kDriveTestShared/Env.sample.swift similarity index 100% rename from kDriveAPITests/Env.sample.swift rename to kDriveTestShared/Env.sample.swift diff --git a/kDriveTests/Env.sample.swift b/kDriveTests/Env.sample.swift deleted file mode 100644 index 33ce6855b..000000000 --- a/kDriveTests/Env.sample.swift +++ /dev/null @@ -1,40 +0,0 @@ -/* - Infomaniak kDrive - iOS App - Copyright (C) 2021 Infomaniak Network SA - - 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 . - */ - -// Use this template to create your `Env` file. You will need to remove "_Sample" from the name. -enum Env_Sample { - // Set your token here - static let token = "" - - // Drive de test dev infomaniak - static let driveId = 140_946 - - // Set your user ID here - static let userId = 0 - - // Set the user ID to invite - static let inviteUserId = 0 - - // Set the email to invite - static let inviteMail = "email@example.com" - - // Set the team to invite - static let inviteTeam = 0 - - static let commonDocumentsId = 3 -} From f63deeaf64b6b83e73746e988e7b317c1d24212a Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 11:25:13 +0100 Subject: [PATCH 04/22] fix: Lottie needs to be dynamic Signed-off-by: Philippe Weidmann --- Tuist/Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 9c98e60d0..b01b5762b 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -17,6 +17,7 @@ let packageSettings = PackageSettings( "InfomaniakCoreCommonUI": .framework, "InfomaniakCoreUIKit": .framework, "Kingfisher": .framework, + "Lottie": .framework, "RealmSwift": .framework, "Realm": .framework ] From 26f39da58253576cde087c341e1ecd1241d1982c Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 11:48:04 +0100 Subject: [PATCH 05/22] test: Remove old test + Stop testing DriveFileManager Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 2 +- kDriveAPITests/kDriveCore/DriveApiTests.swift | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b001741f0..ee76e1954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,4 +32,4 @@ jobs: - name: Build run: tuist install && tuist generate && tuist build --clean kDrive - name: Test API - run: tuist test kDriveAPITests --test-targets kDriveAPITests + run: tuist test kDriveAPITests --test-targets kDriveAPITests/DriveApiTests diff --git a/kDriveAPITests/kDriveCore/DriveApiTests.swift b/kDriveAPITests/kDriveCore/DriveApiTests.swift index 35299af7a..5d4a5745d 100644 --- a/kDriveAPITests/kDriveCore/DriveApiTests.swift +++ b/kDriveAPITests/kDriveCore/DriveApiTests.swift @@ -640,21 +640,6 @@ final class DriveApiTests: XCTestCase { // MARK: Miscellaneous - func testSearchFiles() async throws { - let (testDirectory, file) = try await initOfficeFile(testName: "Search files") - let files = try await currentApiFetcher.searchFiles( - drive: proxyDrive, - query: "officeFile", - fileExtensions: [], - categories: [], - belongToAllCategories: true, - sortType: .newer - ).validApiResponse.data - let fileFound = files.contains { $0.id == file.id } - XCTAssertTrue(fileFound, "File created should be in response") - tearDownTest(directory: testDirectory) - } - func testUndoAction() async throws { let (testDirectory, file) = try await initOfficeFile(testName: "Undo action") let directory = try await createTestDirectory(name: "test", parentDirectory: testDirectory) From 55b068550ec9e0403fa5c860bb8144ed32ee731c Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 12:37:13 +0100 Subject: [PATCH 06/22] test: Update some old tests Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 4 +++- kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift | 2 +- kDriveTests/kDriveCore/Drive/ITDrive.swift | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee76e1954..70957ff41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,5 +31,7 @@ jobs: echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH - name: Build run: tuist install && tuist generate && tuist build --clean kDrive + - name: Test Local + run: tuist generate && tuist test kDriveTests - name: Test API - run: tuist test kDriveAPITests --test-targets kDriveAPITests/DriveApiTests + run: tuist generate && tuist test kDriveAPITests --test-targets kDriveAPITests/DriveApiTests diff --git a/kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift b/kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift index deec6a26f..8651e8c54 100644 --- a/kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift +++ b/kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift @@ -90,7 +90,7 @@ final class UTSceneRestorationMetadata: XCTestCase { XCTAssertEqual(metadata["filesIds"] as? [Int], [1337]) XCTAssertEqual(metadata["currentIndex"] as? Int, Int(0)) XCTAssertEqual(metadata["normalFolderHierarchy"] as? Bool, true) - XCTAssertEqual(metadata["presentationOrigin"] as? PresentationOrigin, .activities) + XCTAssertEqual(metadata["presentationOrigin"] as? String, PresentationOrigin.activities.rawValue) } @MainActor func testFileDetailViewController() { diff --git a/kDriveTests/kDriveCore/Drive/ITDrive.swift b/kDriveTests/kDriveCore/Drive/ITDrive.swift index 373d73d55..fc6bd4335 100644 --- a/kDriveTests/kDriveCore/Drive/ITDrive.swift +++ b/kDriveTests/kDriveCore/Drive/ITDrive.swift @@ -40,6 +40,7 @@ final class ITDrive: XCTestCase { } let decoder = JSONDecoder() + decoder.keyDecodingStrategy = .convertFromSnakeCase // WHEN do { @@ -62,6 +63,7 @@ final class ITDrive: XCTestCase { } let decoder = JSONDecoder() + decoder.keyDecodingStrategy = .convertFromSnakeCase // WHEN do { From 0c501c6265edb6e57305d46ef6211e9a7727f4a3 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 15:47:02 +0100 Subject: [PATCH 07/22] chore: Bump core Signed-off-by: Philippe Weidmann --- Tuist/Package.resolved | 15 ++++++++------- Tuist/Package.swift | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Tuist/Package.resolved b/Tuist/Package.resolved index 4496ba87e..2c8c25f39 100644 --- a/Tuist/Package.resolved +++ b/Tuist/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "978577225a5036d45e6d0b6efa3114b62d416e56115615c78b83bb375e8534df", "pins" : [ { "identity" : "alamofire", @@ -86,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-core", "state" : { - "revision" : "c3a442b5bd2fb67680aa252638773c4d7d1551ad", - "version" : "14.0.0" + "revision" : "f9664e0b91a79d86373cafa87f89e0a45deb3128", + "version" : "15.0.0" } }, { @@ -95,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-core-ui", "state" : { - "revision" : "fc37b5e6e96e38f232f62bd03d322ea6951c1c0f", - "version" : "17.0.0" + "revision" : "3c36b8c376dd8779b47a5b03acfbe71ed270282a", + "version" : "18.0.0" } }, { @@ -122,8 +123,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-version-checker", "state" : { - "revision" : "4f7303c66e8bfd6a0ca7fb21fd35838b58c72219", - "version" : "9.0.0" + "revision" : "050e58bf34ad61db90c2426f8d8fd6a4b49fabf0", + "version" : "10.0.0" } }, { @@ -370,5 +371,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Tuist/Package.swift b/Tuist/Package.swift index b01b5762b..59e84501a 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -30,12 +30,12 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-algorithms", .upToNextMajor(from: "1.2.0")), .package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.2.2")), - .package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "14.0.0")), - .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "17.0.0")), + .package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "15.0.0")), + .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "18.0.0")), .package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "7.2.0")), .package(url: "https://github.com/Infomaniak/ios-dependency-injection", .upToNextMajor(from: "2.0.3")), .package(url: "https://github.com/Infomaniak/swift-concurrency", .upToNextMajor(from: "1.0.0")), - .package(url: "https://github.com/Infomaniak/ios-version-checker", .upToNextMajor(from: "9.0.0")), + .package(url: "https://github.com/Infomaniak/ios-version-checker", .upToNextMajor(from: "10.0.0")), .package(url: "https://github.com/Infomaniak/LocalizeKit", .upToNextMajor(from: "1.0.2")), .package(url: "https://github.com/realm/realm-swift", .upToNextMajor(from: "10.52.0")), .package(url: "https://github.com/SCENEE/FloatingPanel", .upToNextMajor(from: "2.0.0")), From b6008f0e89eb5159f46ebf5ad45166e13df1746d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Fri, 7 Feb 2025 10:06:54 +0100 Subject: [PATCH 08/22] feat(MyKSuiteBridgeViewController): Modern sheet presentation --- kDrive/AppRouter.swift | 22 ++- ...yKSuiteFloatingPanelBridgeController.swift | 141 +----------------- 2 files changed, 25 insertions(+), 138 deletions(-) diff --git a/kDrive/AppRouter.swift b/kDrive/AppRouter.swift index 3b3d3d8ff..7779bef25 100644 --- a/kDrive/AppRouter.swift +++ b/kDrive/AppRouter.swift @@ -525,11 +525,25 @@ public struct AppRouter: AppNavigable { return } - rootViewController.dismiss(animated: true) { - let floatingPanelViewController = MyKSuiteBridgeViewController - .instantiateInFloatingPanel(rootViewController: rootViewController) - rootViewController.present(floatingPanelViewController, animated: true) + let viewControllerToPresent = MyKSuiteBridgeViewController() + if let sheet = viewControllerToPresent.sheetPresentationController { + if #available(iOS 16.0, *) { + sheet.detents = [ + .custom { _ in + return 560 + } + ] + } else { + sheet.detents = [.large()] + sheet.largestUndimmedDetentIdentifier = .large + } + + sheet.prefersScrollingExpandsWhenScrolledToEdge = false + sheet.prefersEdgeAttachedInCompactHeight = true + sheet.widthFollowsPreferredContentSizeWhenEdgeAttached = true + sheet.prefersGrabberVisible = true } + rootViewController.present(viewControllerToPresent, animated: true) } public func askForReview() async { diff --git a/kDrive/UI/Controller/SwiftUIBridge/MyKSuiteFloatingPanelBridgeController.swift b/kDrive/UI/Controller/SwiftUIBridge/MyKSuiteFloatingPanelBridgeController.swift index 270ccdc55..db15fa7b3 100644 --- a/kDrive/UI/Controller/SwiftUIBridge/MyKSuiteFloatingPanelBridgeController.swift +++ b/kDrive/UI/Controller/SwiftUIBridge/MyKSuiteFloatingPanelBridgeController.swift @@ -23,151 +23,24 @@ import MyKSuite import SwiftUI import UIKit -final class MyKSuiteFloatingPanelBridgeController: FloatingPanelController { - init() { - super.init(delegate: nil) - let appearance = SurfaceAppearance() - appearance.cornerRadius = UIConstants.FloatingPanel.cornerRadius - appearance.backgroundColor = KDriveResourcesAsset.backgroundCardViewColor.color - surfaceView.appearance = appearance - surfaceView.grabberHandlePadding = 16 - surfaceView.grabberHandleSize = CGSize(width: 45, height: 5) - surfaceView.grabberHandle.barColor = KDriveResourcesAsset.iconColor.color.withAlphaComponent(0.4) - surfaceView.contentPadding = UIEdgeInsets(top: 24, left: 0, bottom: 0, right: 0) - backdropView.dismissalTapGestureRecognizer.isEnabled = true - layout = MyKSuiteFloatingPanelBridgeLayout() - } - - @available(*, unavailable) - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} - -final class MyKSuiteFloatingPanelBridgeLayout: FloatingPanelLayout { - var position: FloatingPanelPosition = .bottom - var initialState: FloatingPanelState = .tip - var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] - private var backdropAlpha: CGFloat - - init( - initialState: FloatingPanelState = .full, - hideTip: Bool = false, - safeAreaInset: CGFloat = 0, - backdropAlpha: CGFloat = 0 - ) { - self.initialState = initialState - self.backdropAlpha = backdropAlpha - let extendedAnchor = FloatingPanelLayoutAnchor( - absoluteInset: 620.0 + safeAreaInset, - edge: .bottom, - referenceGuide: .superview - ) - anchors = [ - .full: extendedAnchor, - .half: extendedAnchor, - .tip: FloatingPanelLayoutAnchor(absoluteInset: 86.0 + safeAreaInset, edge: .bottom, referenceGuide: .superview) - ] - } - - func backdropAlpha(for state: FloatingPanelState) -> CGFloat { - return backdropAlpha - } -} - -struct RedView: View { - var body: some View { - Color.red - .edgesIgnoringSafeArea(.all) - } -} - final class MyKSuiteBridgeViewController: UIViewController { - let scrollView = UIScrollView() - let swiftUIView = MyKSuiteView(configuration: .kDrive) // RedView() - lazy var hostingController = UIHostingController(rootView: ScrollView(){ swiftUIView }) + let swiftUIView = MyKSuiteView(configuration: .kDrive) + lazy var hostingController = UIHostingController(rootView: ScrollView { swiftUIView }) override func viewDidLoad() { super.viewDidLoad() - view.addSubview(scrollView) - - NSLayoutConstraint.activate([ - scrollView.topAnchor.constraint(equalTo: view.topAnchor), - scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor), - scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor), - scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor) - ]) - addChild(hostingController) - scrollView.addSubview(hostingController.view) - hostingController.view.backgroundColor = .green + view.addSubview(hostingController.view) hostingController.view.translatesAutoresizingMaskIntoConstraints = false -// NSLayoutConstraint.activate([ -// hostingController.view.topAnchor.constraint(equalTo: view.topAnchor), -// hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), -// hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), -// hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor) -// ]) - NSLayoutConstraint.activate([ - hostingController.view.topAnchor.constraint(equalTo: scrollView.topAnchor), - hostingController.view.leadingAnchor.constraint( - equalTo: scrollView.leadingAnchor, - constant: UIConstants.Padding.standard - ), - hostingController.view.trailingAnchor.constraint( - equalTo: scrollView.trailingAnchor, - constant: -UIConstants.Padding.standard - ), - hostingController.view.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor), - hostingController.view.widthAnchor.constraint( - equalTo: view.widthAnchor, - constant: -(2 * UIConstants.Padding.standard) - ) + hostingController.view.topAnchor.constraint(equalTo: view.topAnchor), + hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), + hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), + hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor) ]) -// scrollView.contentSize = CGSize(width: scrollView.bounds.width, height: 600) -// view.frame = CGRect(x: 0, y: 0, width: 800, height: 600) - hostingController.didMove(toParent: self) } - - public static func instantiateInFloatingPanel(rootViewController: UIViewController) -> UIViewController { - let upsaleViewController = MyKSuiteBridgeViewController() - upsaleViewController.view.backgroundColor = .red - return MyKSuiteUpsaleFloatingPanelController(upsaleViewController: upsaleViewController) - } -} - -// ___ - -final class MyKSuiteUpsaleFloatingPanelController: AdaptiveDriveFloatingPanelController { - private let upsaleViewController: MyKSuiteBridgeViewController - - init(upsaleViewController: MyKSuiteBridgeViewController) { - self.upsaleViewController = upsaleViewController - - super.init() - - set(contentViewController: upsaleViewController) - trackAndObserve(scrollView: upsaleViewController.scrollView) - - guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { - return - } - guard let window = windowScene.windows.first(where: { $0.isKeyWindow }) else { - return - } - updateLayout(size: window.bounds.size) - - print("• SIZE\(window.bounds.size)") - - upsaleViewController.view.setNeedsLayout() - upsaleViewController.scrollView.setNeedsLayout() - -// surfaceView.grabberHandle.isHidden = true -// surfaceView.backgroundColor = KDriveResourcesAsset.backgroundCardViewColor.color - } } From 5362879488b72719570f658349f04af500f0004a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Fri, 7 Feb 2025 10:27:25 +0100 Subject: [PATCH 09/22] feat(presentUpSaleSheet): Animate a dismiss before presenting --- kDrive/AppRouter.swift | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/kDrive/AppRouter.swift b/kDrive/AppRouter.swift index 7779bef25..4c09fc996 100644 --- a/kDrive/AppRouter.swift +++ b/kDrive/AppRouter.swift @@ -525,25 +525,27 @@ public struct AppRouter: AppNavigable { return } - let viewControllerToPresent = MyKSuiteBridgeViewController() - if let sheet = viewControllerToPresent.sheetPresentationController { - if #available(iOS 16.0, *) { - sheet.detents = [ - .custom { _ in - return 560 - } - ] - } else { - sheet.detents = [.large()] - sheet.largestUndimmedDetentIdentifier = .large - } + rootViewController.dismiss(animated: true) { + let viewControllerToPresent = MyKSuiteBridgeViewController() + if let sheet = viewControllerToPresent.sheetPresentationController { + if #available(iOS 16.0, *) { + sheet.detents = [ + .custom { _ in + return 560 + } + ] + } else { + sheet.detents = [.large()] + sheet.largestUndimmedDetentIdentifier = .large + } - sheet.prefersScrollingExpandsWhenScrolledToEdge = false - sheet.prefersEdgeAttachedInCompactHeight = true - sheet.widthFollowsPreferredContentSizeWhenEdgeAttached = true - sheet.prefersGrabberVisible = true + sheet.prefersScrollingExpandsWhenScrolledToEdge = false + sheet.prefersEdgeAttachedInCompactHeight = true + sheet.widthFollowsPreferredContentSizeWhenEdgeAttached = true + sheet.prefersGrabberVisible = true + } + rootViewController.present(viewControllerToPresent, animated: true) } - rootViewController.present(viewControllerToPresent, animated: true) } public func askForReview() async { From 261b83e40db983536e06efa7ed5ce42458a32dbd Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 09:30:13 +0100 Subject: [PATCH 10/22] chore: Upgrade tuist + Explicitly declare dependencies Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 4 +- .mise.toml | 2 +- Project.swift | 56 ++++++++++++++----- Tuist/Package.swift | 18 ++++-- .../ExtensionTarget.swift | 6 +- kDriveCore/VideoPlayer/VideoPlayer.swift | 1 - 6 files changed, 62 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 830e5f2dc..5976cb1a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,6 @@ jobs: touch $ENV_PATH echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH - name: Build - run: tuist install && tuist build --generate kDrive + run: tuist install && tuist generate && tuist build --clean kDrive - name: Test - run: tuist test kDrive --test-targets kDriveTests/DriveApiTests + run: tuist test kDrive-Workspace --test-targets kDriveTests/DriveApiTests diff --git a/.mise.toml b/.mise.toml index 1b1ca60cd..670fa8f30 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] -tuist = '4.12.1' +tuist = '4.41.0' periphery = '2.21.1' swiftformat = '0.54.5' swiftlint = '0.57.0' diff --git a/Project.swift b/Project.swift index b4b6771bb..ed9eceb9a 100644 --- a/Project.swift +++ b/Project.swift @@ -48,13 +48,17 @@ let project = Project(name: "kDrive", .target(name: "kDriveCore"), .target(name: "kDriveShareExtension"), .target(name: "kDriveActionExtension"), - .external(name: "FloatingPanel"), - .external(name: "Lottie"), + .external(name: "CocoaLumberjackSwift"), + .external(name: "CocoaLumberjack"), .external(name: "DropDown"), + .external(name: "FloatingPanel"), + .external(name: "Highlightr"), .external(name: "HorizonCalendar"), .external(name: "Kvitto"), - .external(name: "Highlightr"), + .external(name: "Lottie"), .external(name: "MarkdownKit"), + .external(name: "RealmSwift"), + .external(name: "Realm"), .sdk(name: "StoreKit", type: .framework, status: .required) ], settings: .settings(base: Constants.baseSettings), @@ -76,7 +80,16 @@ let project = Project(name: "kDrive", "kDriveTests/**/*.json" ], dependencies: [ - .target(name: "kDrive") + .target(name: "kDrive"), + .target(name: "kDriveCore"), + .external(name: "Alamofire"), + .external(name: "InfomaniakCoreCommonUI"), + .external(name: "InfomaniakCoreUIKit"), + .external(name: "InfomaniakCore"), + .external(name: "InfomaniakDI"), + .external(name: "InfomaniakLogin"), + .external(name: "RealmSwift"), + .external(name: "Realm") ], settings: .settings(base: Constants.testSettings)), .target(name: "kDriveAPITests", @@ -90,7 +103,13 @@ let project = Project(name: "kDrive", "kDriveTestShared/**" ], dependencies: [ - .target(name: "kDrive") + .target(name: "kDrive"), + .target(name: "kDriveCore"), + .external(name: "InfomaniakCore"), + .external(name: "InfomaniakDI"), + .external(name: "InfomaniakLogin"), + .external(name: "RealmSwift"), + .external(name: "Realm") ], settings: .settings(base: Constants.testSettings)), .target(name: "kDriveUITests", @@ -133,21 +152,22 @@ let project = Project(name: "kDrive", .external(name: "Alamofire"), .external(name: "Algorithms"), .external(name: "Atlantis"), - .external(name: "MQTTNIO"), - .external(name: "InfomaniakCore"), - .external(name: "InfomaniakCoreDB"), + .external(name: "CocoaLumberjackSwift"), + .external(name: "CocoaLumberjack"), + .external(name: "DifferenceKit"), + .external(name: "InfomaniakConcurrency"), .external(name: "InfomaniakCoreCommonUI"), + .external(name: "InfomaniakCoreDB"), .external(name: "InfomaniakCoreSwiftUI"), .external(name: "InfomaniakCoreUIKit"), - .external(name: "InfomaniakLogin"), + .external(name: "InfomaniakCore"), .external(name: "InfomaniakDI"), - .external(name: "InfomaniakConcurrency"), - .external(name: "RealmSwift"), + .external(name: "InfomaniakLogin"), .external(name: "Kingfisher"), - .external(name: "DifferenceKit"), - .external(name: "CocoaLumberjackSwift"), + .external(name: "LocalizeKit"), .external(name: "MaterialOutlinedTextField"), - .external(name: "SwiftRegex"), + .external(name: "MQTTNIO"), + .external(name: "RealmSwift"), .external(name: "Sentry-Dynamic"), .external(name: "VersionChecker"), .external(name: "LocalizeKit"), @@ -171,7 +191,13 @@ let project = Project(name: "kDrive", headers: .headers(project: "kDriveFileProvider/**"), entitlements: "kDriveFileProvider/FileProvider.entitlements", dependencies: [ - .target(name: "kDriveCore") + .target(name: "kDriveCore"), + .external(name: "CocoaLumberjackSwift"), + .external(name: "CocoaLumberjack"), + .external(name: "InfomaniakCore"), + .external(name: "InfomaniakDI"), + .external(name: "InfomaniakLogin"), + .external(name: "RealmSwift") ], settings: .settings( base: Constants.fileProviderSettings, diff --git a/Tuist/Package.swift b/Tuist/Package.swift index e0fcea07d..368db1952 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -1,5 +1,5 @@ -// swift-tools-version: 5.9 -import PackageDescription +// swift-tools-version: 5.10 +@preconcurrency import PackageDescription #if TUIST import ProjectDescription @@ -7,10 +7,18 @@ import ProjectDescriptionHelpers let packageSettings = PackageSettings( productTypes: [ - "RealmSwift": .staticLibrary, - "Realm": .staticLibrary, - "MyKSuite": .framework, + "Alamofire": .framework, + "Atlantis": .staticFramework, + "CocoaLumberjackSwift": .framework, + "CocoaLumberjack": .framework, "InfomaniakDI": .framework, + "InfomaniakLogin": .framework, + "InfomaniakCore": .framework, + "InfomaniakCoreCommonUI": .framework, + "InfomaniakCoreUIKit": .framework, + "Kingfisher": .framework, + "RealmSwift": .framework, + "Realm": .framework ] ) diff --git a/Tuist/ProjectDescriptionHelpers/ExtensionTarget.swift b/Tuist/ProjectDescriptionHelpers/ExtensionTarget.swift index 29445bbf3..20c693a22 100644 --- a/Tuist/ProjectDescriptionHelpers/ExtensionTarget.swift +++ b/Tuist/ProjectDescriptionHelpers/ExtensionTarget.swift @@ -109,7 +109,11 @@ public extension Target { .external(name: "FloatingPanel"), .external(name: "Lottie"), .external(name: "DropDown"), - .external(name: "HorizonCalendar") + .external(name: "HorizonCalendar"), + .external(name: "Realm"), + .external(name: "RealmSwift"), + .external(name: "CocoaLumberjack"), + .external(name: "CocoaLumberjackSwift") ], settings: settings) } diff --git a/kDriveCore/VideoPlayer/VideoPlayer.swift b/kDriveCore/VideoPlayer/VideoPlayer.swift index 215f6beaa..fffd882b0 100644 --- a/kDriveCore/VideoPlayer/VideoPlayer.swift +++ b/kDriveCore/VideoPlayer/VideoPlayer.swift @@ -18,7 +18,6 @@ import AVKit import Combine -import FloatingPanel import InfomaniakCore import InfomaniakDI import kDriveResources From 09159f28cdbcf633419670822303768e8b77fdcc Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 10:35:34 +0100 Subject: [PATCH 11/22] fix: Remove target grouping Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 4 ++-- Project.swift | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5976cb1a0..40cb1ad42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,5 +31,5 @@ jobs: echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH - name: Build run: tuist install && tuist generate && tuist build --clean kDrive - - name: Test - run: tuist test kDrive-Workspace --test-targets kDriveTests/DriveApiTests + - name: Test API + run: tuist test kDriveAPITests --test-targets kDriveAPITests diff --git a/Project.swift b/Project.swift index ed9eceb9a..4f8eacb1e 100644 --- a/Project.swift +++ b/Project.swift @@ -21,7 +21,11 @@ import ProjectDescription import ProjectDescriptionHelpers let project = Project(name: "kDrive", - packages: [], + options: .options( + automaticSchemesOptions: .enabled( + targetSchemesGrouping: .notGrouped + ) + ), targets: [ .target(name: "kDrive", destinations: Constants.destinations, From e08582c7944335b6c59f8f703f642f6776dd338b Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 10:56:32 +0100 Subject: [PATCH 12/22] test: Shared Env Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 2 +- .gitignore | 1 + .../Env.sample.swift | 0 kDriveTests/Env.sample.swift | 40 ------------------- 4 files changed, 2 insertions(+), 41 deletions(-) rename {kDriveAPITests => kDriveTestShared}/Env.sample.swift (100%) delete mode 100644 kDriveTests/Env.sample.swift diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40cb1ad42..b001741f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v2 - name: Create test env env: - ENV_PATH: "kDriveTests/Env.swift" + ENV_PATH: "kDriveTestShared/Env.swift" ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} USER_ID: ${{ secrets.USER_ID }} INVITE_USER_ID: ${{ secrets.INVITE_USER_ID }} diff --git a/.gitignore b/.gitignore index 7fd4b0278..ca6d36877 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,4 @@ release/ kDriveTests/Env.swift kDriveAPITests/Env.swift kDriveUITests/Env.swift +kDriveTestShared/Env.swift diff --git a/kDriveAPITests/Env.sample.swift b/kDriveTestShared/Env.sample.swift similarity index 100% rename from kDriveAPITests/Env.sample.swift rename to kDriveTestShared/Env.sample.swift diff --git a/kDriveTests/Env.sample.swift b/kDriveTests/Env.sample.swift deleted file mode 100644 index 33ce6855b..000000000 --- a/kDriveTests/Env.sample.swift +++ /dev/null @@ -1,40 +0,0 @@ -/* - Infomaniak kDrive - iOS App - Copyright (C) 2021 Infomaniak Network SA - - 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 . - */ - -// Use this template to create your `Env` file. You will need to remove "_Sample" from the name. -enum Env_Sample { - // Set your token here - static let token = "" - - // Drive de test dev infomaniak - static let driveId = 140_946 - - // Set your user ID here - static let userId = 0 - - // Set the user ID to invite - static let inviteUserId = 0 - - // Set the email to invite - static let inviteMail = "email@example.com" - - // Set the team to invite - static let inviteTeam = 0 - - static let commonDocumentsId = 3 -} From 71d403b4d8f625d64b2012465b291d0d1b11d59a Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 11:25:13 +0100 Subject: [PATCH 13/22] fix: Lottie needs to be dynamic Signed-off-by: Philippe Weidmann --- Tuist/Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 368db1952..290e5bed2 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -17,6 +17,7 @@ let packageSettings = PackageSettings( "InfomaniakCoreCommonUI": .framework, "InfomaniakCoreUIKit": .framework, "Kingfisher": .framework, + "Lottie": .framework, "RealmSwift": .framework, "Realm": .framework ] From b5e177ce5db560e93ee6492c32d2b400e67a9869 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 11:48:04 +0100 Subject: [PATCH 14/22] test: Remove old test + Stop testing DriveFileManager Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 2 +- kDriveAPITests/kDriveCore/DriveApiTests.swift | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b001741f0..ee76e1954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,4 +32,4 @@ jobs: - name: Build run: tuist install && tuist generate && tuist build --clean kDrive - name: Test API - run: tuist test kDriveAPITests --test-targets kDriveAPITests + run: tuist test kDriveAPITests --test-targets kDriveAPITests/DriveApiTests diff --git a/kDriveAPITests/kDriveCore/DriveApiTests.swift b/kDriveAPITests/kDriveCore/DriveApiTests.swift index 35299af7a..5d4a5745d 100644 --- a/kDriveAPITests/kDriveCore/DriveApiTests.swift +++ b/kDriveAPITests/kDriveCore/DriveApiTests.swift @@ -640,21 +640,6 @@ final class DriveApiTests: XCTestCase { // MARK: Miscellaneous - func testSearchFiles() async throws { - let (testDirectory, file) = try await initOfficeFile(testName: "Search files") - let files = try await currentApiFetcher.searchFiles( - drive: proxyDrive, - query: "officeFile", - fileExtensions: [], - categories: [], - belongToAllCategories: true, - sortType: .newer - ).validApiResponse.data - let fileFound = files.contains { $0.id == file.id } - XCTAssertTrue(fileFound, "File created should be in response") - tearDownTest(directory: testDirectory) - } - func testUndoAction() async throws { let (testDirectory, file) = try await initOfficeFile(testName: "Undo action") let directory = try await createTestDirectory(name: "test", parentDirectory: testDirectory) From 4072f0ef302e69fd6c8bcdcfb7982d4ba5189cd3 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 12:37:13 +0100 Subject: [PATCH 15/22] test: Update some old tests Signed-off-by: Philippe Weidmann --- .github/workflows/ci.yml | 4 +++- kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift | 2 +- kDriveTests/kDriveCore/Drive/ITDrive.swift | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee76e1954..70957ff41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,5 +31,7 @@ jobs: echo -e "enum Env {\n static let token = \"$ACCESS_TOKEN\"\n\n static let driveId = 420132\n\n static let userId = $USER_ID\n\n static let inviteUserId = $INVITE_USER_ID\n\n static let inviteMail = \"$INVITE_EMAIL\"\n\n static let inviteTeam = 0\n\n static let commonDocumentsId = 3\n}" > $ENV_PATH - name: Build run: tuist install && tuist generate && tuist build --clean kDrive + - name: Test Local + run: tuist generate && tuist test kDriveTests - name: Test API - run: tuist test kDriveAPITests --test-targets kDriveAPITests/DriveApiTests + run: tuist generate && tuist test kDriveAPITests --test-targets kDriveAPITests/DriveApiTests diff --git a/kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift b/kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift index deec6a26f..8651e8c54 100644 --- a/kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift +++ b/kDriveTests/StateRestoration/UTSceneRestorationMetadata.swift @@ -90,7 +90,7 @@ final class UTSceneRestorationMetadata: XCTestCase { XCTAssertEqual(metadata["filesIds"] as? [Int], [1337]) XCTAssertEqual(metadata["currentIndex"] as? Int, Int(0)) XCTAssertEqual(metadata["normalFolderHierarchy"] as? Bool, true) - XCTAssertEqual(metadata["presentationOrigin"] as? PresentationOrigin, .activities) + XCTAssertEqual(metadata["presentationOrigin"] as? String, PresentationOrigin.activities.rawValue) } @MainActor func testFileDetailViewController() { diff --git a/kDriveTests/kDriveCore/Drive/ITDrive.swift b/kDriveTests/kDriveCore/Drive/ITDrive.swift index 373d73d55..fc6bd4335 100644 --- a/kDriveTests/kDriveCore/Drive/ITDrive.swift +++ b/kDriveTests/kDriveCore/Drive/ITDrive.swift @@ -40,6 +40,7 @@ final class ITDrive: XCTestCase { } let decoder = JSONDecoder() + decoder.keyDecodingStrategy = .convertFromSnakeCase // WHEN do { @@ -62,6 +63,7 @@ final class ITDrive: XCTestCase { } let decoder = JSONDecoder() + decoder.keyDecodingStrategy = .convertFromSnakeCase // WHEN do { From c9cb451b3cd82802687bf0169fc574a318c003a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Fri, 7 Feb 2025 14:19:46 +0100 Subject: [PATCH 16/22] feat(ios-features): Added necessary libraries as a Framework --- Tuist/Package.resolved | 13 +++++++------ Tuist/Package.swift | 5 ++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Tuist/Package.resolved b/Tuist/Package.resolved index 7a4fae20b..e3895b2af 100644 --- a/Tuist/Package.resolved +++ b/Tuist/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "2e661e8c8c3a4c4af33d3e5a69c81ce37669665e4b98e10943641241208799be", "pins" : [ { "identity" : "alamofire", @@ -114,7 +115,7 @@ "location" : "https://github.com/Infomaniak/ios-features", "state" : { "branch" : "myksuite", - "revision" : "c678214ed6331594df744ebb191b0789ddff694a" + "revision" : "51815cc2838ded5e797b6593153afb6d43a0ab11" } }, { @@ -239,8 +240,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/getsentry/sentry-cocoa", "state" : { - "revision" : "f45e9c62d7a4d9258ac3cf35a3acf9dbab4481d1", - "version" : "8.43.0" + "revision" : "0c34e4da899a1dd9183db04082d1ceb6e9c2b301", + "version" : "8.44.0" } }, { @@ -320,8 +321,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "bbd5e63cf949b7db0c9edaf7a21e141c52afe214", - "version" : "1.23.0" + "revision" : "3c394067c08d1225ba8442e9cffb520ded417b64", + "version" : "1.23.1" } }, { @@ -379,5 +380,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 290e5bed2..4b64e088d 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -19,7 +19,10 @@ let packageSettings = PackageSettings( "Kingfisher": .framework, "Lottie": .framework, "RealmSwift": .framework, - "Realm": .framework + "Realm": .framework, + "MyKSuite": .framework, + "InfomaniakCoreSwiftUI": .framework, + "DesignSystem": .framework ] ) From 951b6ae59614269621ecd0ef529997eb9e1a73fc Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 7 Feb 2025 15:47:02 +0100 Subject: [PATCH 17/22] chore: Bump core Signed-off-by: Philippe Weidmann --- Tuist/Package.resolved | 14 +++++++------- Tuist/Package.swift | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tuist/Package.resolved b/Tuist/Package.resolved index e3895b2af..9338fa707 100644 --- a/Tuist/Package.resolved +++ b/Tuist/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "2e661e8c8c3a4c4af33d3e5a69c81ce37669665e4b98e10943641241208799be", + "originHash" : "978577225a5036d45e6d0b6efa3114b62d416e56115615c78b83bb375e8534df", "pins" : [ { "identity" : "alamofire", @@ -87,8 +87,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-core", "state" : { - "revision" : "c3a442b5bd2fb67680aa252638773c4d7d1551ad", - "version" : "14.0.0" + "revision" : "f9664e0b91a79d86373cafa87f89e0a45deb3128", + "version" : "15.0.0" } }, { @@ -96,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-core-ui", "state" : { - "revision" : "9301c5758508f8a65acc1eb83d0c3168d98991e5", - "version" : "17.2.0" + "revision" : "3c36b8c376dd8779b47a5b03acfbe71ed270282a", + "version" : "18.0.0" } }, { @@ -132,8 +132,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-version-checker", "state" : { - "revision" : "4f7303c66e8bfd6a0ca7fb21fd35838b58c72219", - "version" : "9.0.0" + "revision" : "050e58bf34ad61db90c2426f8d8fd6a4b49fabf0", + "version" : "10.0.0" } }, { diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 4b64e088d..3fadc2181 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -33,13 +33,13 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-algorithms", .upToNextMajor(from: "1.2.0")), .package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.2.2")), - .package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "14.0.0")), - .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "17.0.0")), + .package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "15.0.0")), + .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "18.0.0")), .package(url: "https://github.com/Infomaniak/ios-features", branch: "myksuite"), .package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "7.2.0")), .package(url: "https://github.com/Infomaniak/ios-dependency-injection", .upToNextMajor(from: "2.0.3")), .package(url: "https://github.com/Infomaniak/swift-concurrency", .upToNextMajor(from: "1.0.0")), - .package(url: "https://github.com/Infomaniak/ios-version-checker", .upToNextMajor(from: "9.0.0")), + .package(url: "https://github.com/Infomaniak/ios-version-checker", .upToNextMajor(from: "10.0.0")), .package(url: "https://github.com/Infomaniak/LocalizeKit", .upToNextMajor(from: "1.0.2")), .package(url: "https://github.com/realm/realm-swift", .upToNextMajor(from: "10.52.0")), .package(url: "https://github.com/SCENEE/FloatingPanel", .upToNextMajor(from: "2.0.0")), From a9d01c0e88c69c2f7abdf6b424e079ddbaaedb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Mon, 10 Feb 2025 13:55:15 +0100 Subject: [PATCH 18/22] chore: Update to latest version os i18n --- kDrive/Resources/de.lproj/Localizable.strings | 44 ++++++++++++++- kDrive/Resources/en.lproj/Localizable.strings | 44 ++++++++++++++- kDrive/Resources/es.lproj/Localizable.strings | 53 ++++++++++++++++++- kDrive/Resources/fr.lproj/Localizable.strings | 48 +++++++++++++++-- kDrive/Resources/it.lproj/Localizable.strings | 44 ++++++++++++++- 5 files changed, 226 insertions(+), 7 deletions(-) diff --git a/kDrive/Resources/de.lproj/Localizable.strings b/kDrive/Resources/de.lproj/Localizable.strings index bc92b5a46..0da4ce415 100644 --- a/kDrive/Resources/de.lproj/Localizable.strings +++ b/kDrive/Resources/de.lproj/Localizable.strings @@ -4,7 +4,7 @@ * Locale: de, German * Tagged: ios * Exported by: Adrien Coye - * Exported at: Mon, 28 Oct 2024 09:46:15 +0100 + * Exported at: Mon, 10 Feb 2025 13:54:47 +0100 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -478,6 +478,9 @@ /* loco:6049df4d5c2c3a04bc39796c */ "buttonUpdate" = "Aktualisieren"; +/* loco:67a9efa524991c1b1e0ae0d2 */ +"buttonUpgrade" = "Upgrade"; + /* loco:6049df4d5c2c3a04bc39796d */ "buttonUpgradeOffer" = "Mein Angebot erweitern"; @@ -769,6 +772,9 @@ /* loco:6049df4d5c2c3a04bc397999 */ "errorDuplicate" = "Fehler beim Duplizieren"; +/* loco:6708ec44807fa34749094072 */ +"errorExternalImportInProgress" = "Der Ordner kann nicht bearbeitet werden, da ein externer Import im Gange ist"; + /* loco:605cacde72147f269369e484 */ "errorFileAlreadyExists" = "Datei oder Ordner existiert bereits"; @@ -814,6 +820,9 @@ /* loco:6049df4d5c2c3a04bc3979a1 */ "errorPreviewTrash" = "Die Vorschau auf eine Datei im Papierkorb ist nicht verfügbar"; +/* loco:6708e538df700f157c09c833 */ +"errorQuotaExceeded" = "Unzureichender Platz auf Ihrem kDrive"; + /* loco:6049df4d5c2c3a04bc3979a2 */ "errorRename" = "Fehler beim Umbenennen"; @@ -1573,6 +1582,12 @@ /* loco:63846ac1f8786f515b61f752 */ "photoLibraryAccessLimitedTitle" = "Eingeschränkter oder verweigerter Zugang"; +/* loco:6765711b1f6cfc8c5408ee33 */ +"photoSyncSuspended" = "Verbinden Sie sich mit einem Wi-Fi-Netzwerk oder erlauben Sie die mobile Datennutzung"; + +/* loco:67657012f62b39abc50deb62 */ +"photoSyncSuspendedTitle" = "Fotosicherung ausgesetzt"; + /* loco:627cf782146a6d748e5e7262 */ "photosHeaderDateFormat" = "MMMM yyyy"; @@ -1699,6 +1714,9 @@ /* loco:6049df4d5c2c3a04bc397a39 */ "settingsOnlyWifiSyncTitle" = "Übertragung nur im WLAN"; +/* loco:67a9f25b711672a919072474 */ +"settingsSectionGeneral" = "Allgemein"; + /* loco:6049df4d5c2c3a04bc397a3a */ "settingsTitle" = "Einstellungen"; @@ -1996,6 +2014,12 @@ /* loco:6049df4d5c2c3a04bc397a65 */ "syncConfigureTitle" = "Speichern Sie Ihre Erinnerungen an einem sicheren Ort"; +/* loco:66f50ff53251a55b2f0f1532 */ +"syncOnlyWifiDescription" = "Offline-Dateien werden nur mit Wi-Fi synchronisiert"; + +/* loco:66f50e357d4c318d780a5bd2 */ +"syncOnlyWifiTitle" = "Nur mit Wi-Fi"; + /* loco:6049df4d5c2c3a04bc397a66 */ "syncSettingsButtonActiveSync" = "Automatische Sicherung aktivieren"; @@ -2056,6 +2080,18 @@ /* loco:6049df4d5c2c3a04bc397a75 */ "syncSettingsTitle" = "Sicherung der Fotos"; +/* loco:66f51084cb6715272c0b5762 */ +"syncWifiAndMobileDataDescription" = "Für die mobile Datennutzung können Gebühren anfallen"; + +/* loco:66f50ef81220705fc30d60a2 */ +"syncWifiAndMobileDataTitle" = "Mit Wi-Fi und mobilen Daten"; + +/* loco:66f51f3fa1ad831cda076d52 */ +"syncWifiPicturesTitle" = "Fotos und Videos synchronisieren"; + +/* loco:66f5115224f82ae9020b3162 */ +"syncWifiSettingsTitle" = "Offline-Dateien synchronisieren"; + /* loco:614c87dd3af1ff4501490ec5 */ "tempDirectory" = "Temporäre Dateien"; @@ -2086,6 +2122,9 @@ /* loco:6049df4d5c2c3a04bc397a78 */ "trashActionRestoreFileOriginalPlace" = "Am ursprünglichen Ort wiederherstellen"; +/* loco:67a9ef7e628ce12f3209f422 */ +"trashAutoClearDescription" = "Der Papierkorb wird alle 30 Tage automatisch gereinigt."; + /* loco:6049df4d5c2c3a04bc397a7b */ "trashNoFile" = "Keine Datei gelöscht"; @@ -2194,6 +2233,9 @@ /* loco:6049df4d5c2c3a04bc397a8c */ "uploadNetworkErrorWifiRequired" = "Warten auf WLAN"; +/* loco:66fbba74682fe9a0990df012 */ +"uploadOverDataRestrictedError" = "Warten auf Wi-Fi"; + /* loco:60928fcf72952001716b86d2 */ "uploadPausedDescription" = "Einige Uploads sind in kDrive noch im Gange. Öffnen Sie die App und lassen Sie das Gerät verbunden, um den Upload zu beschleunigen."; diff --git a/kDrive/Resources/en.lproj/Localizable.strings b/kDrive/Resources/en.lproj/Localizable.strings index da436ea1e..34fc17d44 100644 --- a/kDrive/Resources/en.lproj/Localizable.strings +++ b/kDrive/Resources/en.lproj/Localizable.strings @@ -4,7 +4,7 @@ * Locale: en, English * Tagged: ios * Exported by: Adrien Coye - * Exported at: Mon, 28 Oct 2024 09:46:15 +0100 + * Exported at: Mon, 10 Feb 2025 13:54:47 +0100 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -478,6 +478,9 @@ /* loco:6049df4d5c2c3a04bc39796c */ "buttonUpdate" = "Update"; +/* loco:67a9efa524991c1b1e0ae0d2 */ +"buttonUpgrade" = "Upgrade"; + /* loco:6049df4d5c2c3a04bc39796d */ "buttonUpgradeOffer" = "Upgrade my plan"; @@ -769,6 +772,9 @@ /* loco:6049df4d5c2c3a04bc397999 */ "errorDuplicate" = "Duplication error"; +/* loco:6708ec44807fa34749094072 */ +"errorExternalImportInProgress" = "Cannot perform action on the folder because an external import is in progress"; + /* loco:605cacde72147f269369e484 */ "errorFileAlreadyExists" = "File or folder already exists"; @@ -814,6 +820,9 @@ /* loco:6049df4d5c2c3a04bc3979a1 */ "errorPreviewTrash" = "Previewing a file in the trash is not possible"; +/* loco:6708e538df700f157c09c833 */ +"errorQuotaExceeded" = "Not enough space on your kDrive"; + /* loco:6049df4d5c2c3a04bc3979a2 */ "errorRename" = "Rename error"; @@ -1573,6 +1582,12 @@ /* loco:63846ac1f8786f515b61f752 */ "photoLibraryAccessLimitedTitle" = "Restricted or denied access"; +/* loco:6765711b1f6cfc8c5408ee33 */ +"photoSyncSuspended" = "Connect to a Wi-Fi network or allow mobile data usage"; + +/* loco:67657012f62b39abc50deb62 */ +"photoSyncSuspendedTitle" = "Photo backup suspended"; + /* loco:627cf782146a6d748e5e7262 */ "photosHeaderDateFormat" = "MMMM yyyy"; @@ -1699,6 +1714,9 @@ /* loco:6049df4d5c2c3a04bc397a39 */ "settingsOnlyWifiSyncTitle" = "WiFi-only transfer"; +/* loco:67a9f25b711672a919072474 */ +"settingsSectionGeneral" = "General"; + /* loco:6049df4d5c2c3a04bc397a3a */ "settingsTitle" = "Settings"; @@ -1996,6 +2014,12 @@ /* loco:6049df4d5c2c3a04bc397a65 */ "syncConfigureTitle" = "Save your memories in a safe place"; +/* loco:66f50ff53251a55b2f0f1532 */ +"syncOnlyWifiDescription" = "Offline files will be only synchronized with Wi-Fi"; + +/* loco:66f50e357d4c318d780a5bd2 */ +"syncOnlyWifiTitle" = "With Wi-Fi only"; + /* loco:6049df4d5c2c3a04bc397a66 */ "syncSettingsButtonActiveSync" = "Enable automatic backup"; @@ -2056,6 +2080,18 @@ /* loco:6049df4d5c2c3a04bc397a75 */ "syncSettingsTitle" = "Photo backup"; +/* loco:66f51084cb6715272c0b5762 */ +"syncWifiAndMobileDataDescription" = "Mobile data usage charges may apply"; + +/* loco:66f50ef81220705fc30d60a2 */ +"syncWifiAndMobileDataTitle" = "With Wi-Fi and mobile data"; + +/* loco:66f51f3fa1ad831cda076d52 */ +"syncWifiPicturesTitle" = "Synchronize photos and videos"; + +/* loco:66f5115224f82ae9020b3162 */ +"syncWifiSettingsTitle" = "Synchronize offline files"; + /* loco:614c87dd3af1ff4501490ec5 */ "tempDirectory" = "Temporary files"; @@ -2086,6 +2122,9 @@ /* loco:6049df4d5c2c3a04bc397a78 */ "trashActionRestoreFileOriginalPlace" = "Recover to the original location"; +/* loco:67a9ef7e628ce12f3209f422 */ +"trashAutoClearDescription" = "Trash is cleaned automatically every 30 days."; + /* loco:6049df4d5c2c3a04bc397a7b */ "trashNoFile" = "No deleted files"; @@ -2194,6 +2233,9 @@ /* loco:6049df4d5c2c3a04bc397a8c */ "uploadNetworkErrorWifiRequired" = "Waiting for WiFi network"; +/* loco:66fbba74682fe9a0990df012 */ +"uploadOverDataRestrictedError" = "Waiting for Wi-Fi"; + /* loco:60928fcf72952001716b86d2 */ "uploadPausedDescription" = "Some uploads are still in progress in kDrive. Open the app and keep the device connected to speed up the upload."; diff --git a/kDrive/Resources/es.lproj/Localizable.strings b/kDrive/Resources/es.lproj/Localizable.strings index 800986ddb..fdc328619 100644 --- a/kDrive/Resources/es.lproj/Localizable.strings +++ b/kDrive/Resources/es.lproj/Localizable.strings @@ -4,7 +4,7 @@ * Locale: es, Spanish * Tagged: ios * Exported by: Adrien Coye - * Exported at: Mon, 28 Oct 2024 09:46:15 +0100 + * Exported at: Mon, 10 Feb 2025 13:54:47 +0100 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -478,6 +478,9 @@ /* loco:6049df4d5c2c3a04bc39796c */ "buttonUpdate" = "Actualizar"; +/* loco:67a9efa524991c1b1e0ae0d2 */ +"buttonUpgrade" = "Actualizar"; + /* loco:6049df4d5c2c3a04bc39796d */ "buttonUpgradeOffer" = "Mejorar mi oferta"; @@ -712,6 +715,15 @@ /* loco:6049df4d5c2c3a04bc397992 */ "dropBoxTitle" = "Buzón de depósito"; +/* loco:6708c590f8f4d36ec100ef42 */ +"dropboxPublicShareOutdatedDescription" = "El enlace se ha desactivado o ha caducado.\nPara subir tus archivos, envía un mensaje al usuario que compartió el dropbox contigo para que pueda reactivarlo."; + +/* loco:6708c5155b4785a798019472 */ +"dropboxPublicShareOutdatedTitle" = "Este dropbox ya no está disponible"; + +/* loco:6707c8d16e460cb6a304b692 */ +"dropboxPublicShareTitleUploadButton" = "%@ te invita a importar tus archivos a su kDrive"; + /* loco:618b870b92fff1241d67e713 */ "dropboxSharedLinkDescription" = "No puedes crear un enlace de uso compartido para un buzón de depósito."; @@ -760,6 +772,9 @@ /* loco:6049df4d5c2c3a04bc397999 */ "errorDuplicate" = "Error al duplicar"; +/* loco:6708ec44807fa34749094072 */ +"errorExternalImportInProgress" = "No se puede realizar ninguna acción en la carpeta porque hay una importación externa en curso"; + /* loco:605cacde72147f269369e484 */ "errorFileAlreadyExists" = "Archivo o carpeta ya existente"; @@ -805,6 +820,9 @@ /* loco:6049df4d5c2c3a04bc3979a1 */ "errorPreviewTrash" = "La vista previa de un archivo en la papelera no está disponible"; +/* loco:6708e538df700f157c09c833 */ +"errorQuotaExceeded" = "Espacio insuficiente en tu kDrive"; + /* loco:6049df4d5c2c3a04bc3979a2 */ "errorRename" = "Error al cambiar el nombre"; @@ -1564,6 +1582,12 @@ /* loco:63846ac1f8786f515b61f752 */ "photoLibraryAccessLimitedTitle" = "Acceso restringido o denegado"; +/* loco:6765711b1f6cfc8c5408ee33 */ +"photoSyncSuspended" = "Conectarse a una red Wi-Fi o permitir el uso de datos móviles"; + +/* loco:67657012f62b39abc50deb62 */ +"photoSyncSuspendedTitle" = "Suspendida la copia de seguridad de fotos"; + /* loco:627cf782146a6d748e5e7262 */ "photosHeaderDateFormat" = "MMMM yyyy"; @@ -1690,6 +1714,9 @@ /* loco:6049df4d5c2c3a04bc397a39 */ "settingsOnlyWifiSyncTitle" = "Transferencia sólo con WiFi"; +/* loco:67a9f25b711672a919072474 */ +"settingsSectionGeneral" = "General"; + /* loco:6049df4d5c2c3a04bc397a3a */ "settingsTitle" = "Parámetros"; @@ -1987,6 +2014,12 @@ /* loco:6049df4d5c2c3a04bc397a65 */ "syncConfigureTitle" = "Haz copia de seguridad de tus recuerdos en un lugar seguro"; +/* loco:66f50ff53251a55b2f0f1532 */ +"syncOnlyWifiDescription" = "Los archivos sin conexión sólo se sincronizarán con Wi-Fi"; + +/* loco:66f50e357d4c318d780a5bd2 */ +"syncOnlyWifiTitle" = "Sólo con Wi-Fi"; + /* loco:6049df4d5c2c3a04bc397a66 */ "syncSettingsButtonActiveSync" = "Activar la copia de seguridad automática"; @@ -2047,6 +2080,18 @@ /* loco:6049df4d5c2c3a04bc397a75 */ "syncSettingsTitle" = "Copia de seguridad de las fotos"; +/* loco:66f51084cb6715272c0b5762 */ +"syncWifiAndMobileDataDescription" = "Pueden aplicarse tarifas por uso de datos móviles"; + +/* loco:66f50ef81220705fc30d60a2 */ +"syncWifiAndMobileDataTitle" = "Con Wi-Fi y datos móviles"; + +/* loco:66f51f3fa1ad831cda076d52 */ +"syncWifiPicturesTitle" = "Sincronizar fotos y vídeos"; + +/* loco:66f5115224f82ae9020b3162 */ +"syncWifiSettingsTitle" = "Sincronizar archivos sin conexión"; + /* loco:614c87dd3af1ff4501490ec5 */ "tempDirectory" = "Archivos temporales"; @@ -2077,6 +2122,9 @@ /* loco:6049df4d5c2c3a04bc397a78 */ "trashActionRestoreFileOriginalPlace" = "Restaurar en el emplazamiento original"; +/* loco:67a9ef7e628ce12f3209f422 */ +"trashAutoClearDescription" = "La basura se limpia automáticamente cada 30 días."; + /* loco:6049df4d5c2c3a04bc397a7b */ "trashNoFile" = "No se ha eliminado ningún archivo"; @@ -2185,6 +2233,9 @@ /* loco:6049df4d5c2c3a04bc397a8c */ "uploadNetworkErrorWifiRequired" = "A la espera de red WiFi"; +/* loco:66fbba74682fe9a0990df012 */ +"uploadOverDataRestrictedError" = "A la espera de Wi-Fi"; + /* loco:60928fcf72952001716b86d2 */ "uploadPausedDescription" = "Algunas subidas siguen en curso en kDrive. Abre la aplicación y mantén el dispositivo conectado para acelerar la carga."; diff --git a/kDrive/Resources/fr.lproj/Localizable.strings b/kDrive/Resources/fr.lproj/Localizable.strings index f8259d3f4..93fbbf628 100644 --- a/kDrive/Resources/fr.lproj/Localizable.strings +++ b/kDrive/Resources/fr.lproj/Localizable.strings @@ -4,7 +4,7 @@ * Locale: fr, French * Tagged: ios * Exported by: Adrien Coye - * Exported at: Mon, 28 Oct 2024 09:46:15 +0100 + * Exported at: Mon, 10 Feb 2025 13:54:47 +0100 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -478,6 +478,9 @@ /* loco:6049df4d5c2c3a04bc39796c */ "buttonUpdate" = "Mettre à jour"; +/* loco:67a9efa524991c1b1e0ae0d2 */ +"buttonUpgrade" = "Mettre à niveau"; + /* loco:6049df4d5c2c3a04bc39796d */ "buttonUpgradeOffer" = "Mettre à niveau mon offre"; @@ -755,7 +758,7 @@ "errorDelete" = "Erreur lors de la suppression"; /* loco:60a693f631a0a90e163445f2 */ -"errorDeviceStorage" = "Stockage insuffisant de l’appareil"; +"errorDeviceStorage" = "Stockage insuffisant"; /* loco:6099440fdb741c2c6d66d332 */ "errorDisconnected" = "Une erreur s’est produite. Veuillez vous reconnecter pour continuer."; @@ -769,6 +772,9 @@ /* loco:6049df4d5c2c3a04bc397999 */ "errorDuplicate" = "Erreur lors de la duplication"; +/* loco:6708ec44807fa34749094072 */ +"errorExternalImportInProgress" = "Impossible d’effectuer l’action sur le dossier, une importation externe est en cours"; + /* loco:605cacde72147f269369e484 */ "errorFileAlreadyExists" = "Le fichier ou le dossier existe déjà"; @@ -814,6 +820,9 @@ /* loco:6049df4d5c2c3a04bc3979a1 */ "errorPreviewTrash" = "L’aperçu d’un fichier dans la corbeille n’est pas disponible"; +/* loco:6708e538df700f157c09c833 */ +"errorQuotaExceeded" = "Espace insuffisant sur votre kDrive"; + /* loco:6049df4d5c2c3a04bc3979a2 */ "errorRename" = "Erreur lors du renommage"; @@ -1487,7 +1496,7 @@ "notificationFileUpload" = "Importation des fichiers"; /* loco:604b9caa43ed563ca07293f2 */ -"notificationGeneralChannelName" = "Notification générales"; +"notificationGeneralChannelName" = "Notifications générales"; /* loco:6049df4d5c2c3a04bc397a13 */ "notificationReceiveNotifications" = "Recevoir des notifications"; @@ -1573,6 +1582,12 @@ /* loco:63846ac1f8786f515b61f752 */ "photoLibraryAccessLimitedTitle" = "Accès limité ou refusé"; +/* loco:6765711b1f6cfc8c5408ee33 */ +"photoSyncSuspended" = "Se connecter à un réseau Wi-Fi ou autoriser l’utilisation de données mobiles"; + +/* loco:67657012f62b39abc50deb62 */ +"photoSyncSuspendedTitle" = "Sauvegarde des photos suspendue"; + /* loco:627cf782146a6d748e5e7262 */ "photosHeaderDateFormat" = "MMMM yyyy"; @@ -1699,6 +1714,9 @@ /* loco:6049df4d5c2c3a04bc397a39 */ "settingsOnlyWifiSyncTitle" = "Transfert uniquement en Wi-Fi"; +/* loco:67a9f25b711672a919072474 */ +"settingsSectionGeneral" = "Général"; + /* loco:6049df4d5c2c3a04bc397a3a */ "settingsTitle" = "Paramètres"; @@ -1996,6 +2014,12 @@ /* loco:6049df4d5c2c3a04bc397a65 */ "syncConfigureTitle" = "Sauvegardez vos souvenirs en lieu sûr"; +/* loco:66f50ff53251a55b2f0f1532 */ +"syncOnlyWifiDescription" = "Les fichiers hors ligne ne seront synchronisés qu’avec le Wi-Fi"; + +/* loco:66f50e357d4c318d780a5bd2 */ +"syncOnlyWifiTitle" = "Avec Wi-Fi uniquement"; + /* loco:6049df4d5c2c3a04bc397a66 */ "syncSettingsButtonActiveSync" = "Activer la sauvegarde automatique"; @@ -2056,6 +2080,18 @@ /* loco:6049df4d5c2c3a04bc397a75 */ "syncSettingsTitle" = "Sauvegarde des photos"; +/* loco:66f51084cb6715272c0b5762 */ +"syncWifiAndMobileDataDescription" = "Des frais d’utilisation de données mobiles peuvent s’appliquer"; + +/* loco:66f50ef81220705fc30d60a2 */ +"syncWifiAndMobileDataTitle" = "Avec Wi-Fi et données mobiles"; + +/* loco:66f51f3fa1ad831cda076d52 */ +"syncWifiPicturesTitle" = "Synchroniser les photos et les vidéos"; + +/* loco:66f5115224f82ae9020b3162 */ +"syncWifiSettingsTitle" = "Synchroniser des fichiers hors ligne"; + /* loco:614c87dd3af1ff4501490ec5 */ "tempDirectory" = "Fichiers temporaires"; @@ -2086,6 +2122,9 @@ /* loco:6049df4d5c2c3a04bc397a78 */ "trashActionRestoreFileOriginalPlace" = "Restaurer à l’emplacement d’origine"; +/* loco:67a9ef7e628ce12f3209f422 */ +"trashAutoClearDescription" = "La corbeille est nettoyée automatiquement tous les 30 jours."; + /* loco:6049df4d5c2c3a04bc397a7b */ "trashNoFile" = "Aucun fichier supprimé"; @@ -2194,6 +2233,9 @@ /* loco:6049df4d5c2c3a04bc397a8c */ "uploadNetworkErrorWifiRequired" = "En attente de réseau Wi-Fi"; +/* loco:66fbba74682fe9a0990df012 */ +"uploadOverDataRestrictedError" = "En attente de Wi-Fi"; + /* loco:60928fcf72952001716b86d2 */ "uploadPausedDescription" = "Des importations sont toujours en cours dans kDrive. Ouvrez l’app et gardez l’appareil branché pour accélérer l’upload."; diff --git a/kDrive/Resources/it.lproj/Localizable.strings b/kDrive/Resources/it.lproj/Localizable.strings index 77321d1b3..c79fd2e4b 100644 --- a/kDrive/Resources/it.lproj/Localizable.strings +++ b/kDrive/Resources/it.lproj/Localizable.strings @@ -4,7 +4,7 @@ * Locale: it, Italian * Tagged: ios * Exported by: Adrien Coye - * Exported at: Mon, 28 Oct 2024 09:46:15 +0100 + * Exported at: Mon, 10 Feb 2025 13:54:47 +0100 */ /* loco:610a8791fa12ab20713c09e4 */ @@ -478,6 +478,9 @@ /* loco:6049df4d5c2c3a04bc39796c */ "buttonUpdate" = "Aggiorna"; +/* loco:67a9efa524991c1b1e0ae0d2 */ +"buttonUpgrade" = "Aggiornamento"; + /* loco:6049df4d5c2c3a04bc39796d */ "buttonUpgradeOffer" = "Fai evolvere la tua offerta"; @@ -769,6 +772,9 @@ /* loco:6049df4d5c2c3a04bc397999 */ "errorDuplicate" = "Errore durante la duplicazione"; +/* loco:6708ec44807fa34749094072 */ +"errorExternalImportInProgress" = "Non è possibile eseguire un’azione sulla cartella perché è in corso un’importazione esterna"; + /* loco:605cacde72147f269369e484 */ "errorFileAlreadyExists" = "Il file o la cartella esiste già"; @@ -814,6 +820,9 @@ /* loco:6049df4d5c2c3a04bc3979a1 */ "errorPreviewTrash" = "L’anteprima di un file spostato nel cestino non è disponibile"; +/* loco:6708e538df700f157c09c833 */ +"errorQuotaExceeded" = "Spazio insufficiente sul kDrive"; + /* loco:6049df4d5c2c3a04bc3979a2 */ "errorRename" = "Errore durante la rinomina"; @@ -1573,6 +1582,12 @@ /* loco:63846ac1f8786f515b61f752 */ "photoLibraryAccessLimitedTitle" = "Accesso limitato o negato"; +/* loco:6765711b1f6cfc8c5408ee33 */ +"photoSyncSuspended" = "Collegarsi a una rete Wi-Fi o consentire l’utilizzo di dati mobili"; + +/* loco:67657012f62b39abc50deb62 */ +"photoSyncSuspendedTitle" = "Backup delle foto sospeso"; + /* loco:627cf782146a6d748e5e7262 */ "photosHeaderDateFormat" = "MMMM yyyy"; @@ -1699,6 +1714,9 @@ /* loco:6049df4d5c2c3a04bc397a39 */ "settingsOnlyWifiSyncTitle" = "Trasferimento solo tramite Wi-Fi"; +/* loco:67a9f25b711672a919072474 */ +"settingsSectionGeneral" = "Generale"; + /* loco:6049df4d5c2c3a04bc397a3a */ "settingsTitle" = "Impostazioni"; @@ -1996,6 +2014,12 @@ /* loco:6049df4d5c2c3a04bc397a65 */ "syncConfigureTitle" = "Salva i tuoi ricordi in un luogo sicuro"; +/* loco:66f50ff53251a55b2f0f1532 */ +"syncOnlyWifiDescription" = "I file offline saranno sincronizzati solo con il Wi-Fi"; + +/* loco:66f50e357d4c318d780a5bd2 */ +"syncOnlyWifiTitle" = "Solo con Wi-Fi"; + /* loco:6049df4d5c2c3a04bc397a66 */ "syncSettingsButtonActiveSync" = "Attiva il backup automatico"; @@ -2056,6 +2080,18 @@ /* loco:6049df4d5c2c3a04bc397a75 */ "syncSettingsTitle" = "Backup foto"; +/* loco:66f51084cb6715272c0b5762 */ +"syncWifiAndMobileDataDescription" = "Potrebbero essere applicate tariffe per l’utilizzo dei dati mobili"; + +/* loco:66f50ef81220705fc30d60a2 */ +"syncWifiAndMobileDataTitle" = "Con Wi-Fi e dati mobili"; + +/* loco:66f51f3fa1ad831cda076d52 */ +"syncWifiPicturesTitle" = "Sincronizza foto e video"; + +/* loco:66f5115224f82ae9020b3162 */ +"syncWifiSettingsTitle" = "Sincronizza i file offline"; + /* loco:614c87dd3af1ff4501490ec5 */ "tempDirectory" = "File temporanei"; @@ -2086,6 +2122,9 @@ /* loco:6049df4d5c2c3a04bc397a78 */ "trashActionRestoreFileOriginalPlace" = "Ripristina nell’ubicazione di origine"; +/* loco:67a9ef7e628ce12f3209f422 */ +"trashAutoClearDescription" = "La pulizia dei rifiuti avviene automaticamente ogni 30 giorni."; + /* loco:6049df4d5c2c3a04bc397a7b */ "trashNoFile" = "Nessun file eliminato"; @@ -2194,6 +2233,9 @@ /* loco:6049df4d5c2c3a04bc397a8c */ "uploadNetworkErrorWifiRequired" = "In attesa di connessione alla rete Wi-Fi"; +/* loco:66fbba74682fe9a0990df012 */ +"uploadOverDataRestrictedError" = "In attesa del Wi-Fi"; + /* loco:60928fcf72952001716b86d2 */ "uploadPausedDescription" = "Alcuni caricamenti sono ancora in corso in kDrive. Aprite l’app e mantenete il dispositivo connesso per accelerare il caricamento."; From 3516e1d8b7a661934af40045a487cbcbadb2b5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Mon, 10 Feb 2025 15:05:28 +0100 Subject: [PATCH 19/22] feat(Drive+Quota): If Quota is not present we do not enforce limitations app side --- kDriveCore/Data/Models/Drive/Drive+Quota.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kDriveCore/Data/Models/Drive/Drive+Quota.swift b/kDriveCore/Data/Models/Drive/Drive+Quota.swift index 5b5d72040..7c1b3e45f 100644 --- a/kDriveCore/Data/Models/Drive/Drive+Quota.swift +++ b/kDriveCore/Data/Models/Drive/Drive+Quota.swift @@ -47,12 +47,12 @@ public final class DriveQuota: EmbeddedObject, Codable { extension Drive { var dropboxQuotaExceeded: Bool { - guard let quota, let dropbox = quota.dropbox else { return true } + guard let quota, let dropbox = quota.dropbox else { return false } return dropbox.current ?? 0 >= dropbox.max } var sharedLinkQuotaExceeded: Bool { - guard let quota, let sharedLink = quota.sharedLink else { return true } + guard let quota, let sharedLink = quota.sharedLink else { return false } return sharedLink.current ?? 0 >= sharedLink.max } } From fcbb278c2b033eee820fc34bf2bdde57121d588a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Tue, 11 Feb 2025 09:54:25 +0100 Subject: [PATCH 20/22] feat(Drive): Method isFreePack return true when pack is myKSuite --- kDriveCore/Data/Models/Drive/Drive.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kDriveCore/Data/Models/Drive/Drive.swift b/kDriveCore/Data/Models/Drive/Drive.swift index 9a60185d1..2b0957e3d 100644 --- a/kDriveCore/Data/Models/Drive/Drive.swift +++ b/kDriveCore/Data/Models/Drive/Drive.swift @@ -143,7 +143,7 @@ public final class Drive: Object, Codable { } public var isFreePack: Bool { - return pack.drivePackId == .free + return pack.drivePackId == .free || pack.drivePackId == .myKSuite } public var isInTechnicalMaintenance: Bool { From 07d2154de6c4b0b203671cab13aff5cb81e8765a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Tue, 11 Feb 2025 10:57:53 +0100 Subject: [PATCH 21/22] feat(LocalizedFilenameFormatter): Use drive.isFreePack for correctness --- kDriveCore/Utils/LocalizedFilenameFormatter.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kDriveCore/Utils/LocalizedFilenameFormatter.swift b/kDriveCore/Utils/LocalizedFilenameFormatter.swift index 21f334eb9..879f88fc8 100644 --- a/kDriveCore/Utils/LocalizedFilenameFormatter.swift +++ b/kDriveCore/Utils/LocalizedFilenameFormatter.swift @@ -21,8 +21,9 @@ import kDriveResources public extension File { func formattedLocalizedName(drive: Drive? = nil) -> String { + let isFreePack = drive?.isFreePack ?? false let packId = drive?.pack.drivePackId - let isIndividualDrive = packId == .solo || packId == .free + let isIndividualDrive = packId == .solo || isFreePack return Self.LocalizedFilenameFormatter(isIndividualDrive: isIndividualDrive).format(self) } From 535ea708862115657ffaf85b739bea9260fbc474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Tue, 11 Feb 2025 15:12:49 +0100 Subject: [PATCH 22/22] feat(ios-features): Bump to 1.0.0 --- Tuist/Package.resolved | 6 +++--- Tuist/Package.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tuist/Package.resolved b/Tuist/Package.resolved index 705b7161c..6e562a5d8 100644 --- a/Tuist/Package.resolved +++ b/Tuist/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "35fb6043ee8b281dc1633d5d9ceddcb14555d433a9ee84c0a4e2de98bc9e4303", + "originHash" : "d4f3471d7ff6c49ac804120f960a88f11829606e5f87b0550b8cce9fff3cfcfc", "pins" : [ { "identity" : "alamofire", @@ -114,8 +114,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Infomaniak/ios-features", "state" : { - "branch" : "myksuite", - "revision" : "a9f91c552190320155b07e4ff6f33a45e61102b4" + "revision" : "1fbc76605a0bf96a781e4a56c1d3ead4c2974b4b", + "version" : "1.0.0" } }, { diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 3fadc2181..b21b334ca 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -35,7 +35,7 @@ let package = Package( .package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.2.2")), .package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "15.0.0")), .package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "18.0.0")), - .package(url: "https://github.com/Infomaniak/ios-features", branch: "myksuite"), + .package(url: "https://github.com/Infomaniak/ios-features", .upToNextMajor(from: "1.0.0")), .package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "7.2.0")), .package(url: "https://github.com/Infomaniak/ios-dependency-injection", .upToNextMajor(from: "2.0.3")), .package(url: "https://github.com/Infomaniak/swift-concurrency", .upToNextMajor(from: "1.0.0")),