Skip to content

Commit

Permalink
feat: MyKSuite UI (#1409)
Browse files Browse the repository at this point in the history
* feat: Present a sample SwiftUI View

* feat: Force ios-core-ui to mykSuite branch

* feat: Tuist project setup with external feature module

* chore: Bump coreUI

* feat(MyKSuiteFloatingPanelBridgeController): Display SwiftUI code in container view

* feat(MyKSuiteFloatingPanelBridgeController): Adjusted margins

* feat(MyKSuiteFloatingPanelBridgeController): New kDrive dedicated assets

* feat(Drive): Quota is now non nullable as discussed with backend

* feat: Bump UI with latest API

* feat(AppRouter): New explicit method presentUpSaleSheet

* chore(MyKSuiteFloatingPanelBridgeController): Clean code

* fix(AppRouter): Animate presentUpSaleSheet method

* fix(AppRouter): Animate MyKSuiteFloatingPanelBridgeController prensentation

* chore: Switched to ios-features

* fix(MCKRouter): Updated test mock

* fix(ios-features): Allow the project to build again with the new linked library

* chore(AppRouter): Removed iOS 15 conditional code

* chore(MyKSuiteFloatingPanelBridgeController): Removed iOS 15 conditional code

* fix(Package.swift): Added InfomaniakDI as a Framework to guarantee only one exists at any point

* feat: Trying to bridge a SwUI view in a scrollview in a presented sheet

* feat(MyKSuiteBridgeViewController): Modern sheet presentation

* feat(presentUpSaleSheet): Animate a dismiss before presenting

* chore: Upgrade tuist + Explicitly declare dependencies

Signed-off-by: Philippe Weidmann <[email protected]>

* fix: Remove target grouping

Signed-off-by: Philippe Weidmann <[email protected]>

* test: Shared Env

Signed-off-by: Philippe Weidmann <[email protected]>

* fix: Lottie needs to be dynamic

Signed-off-by: Philippe Weidmann <[email protected]>

* test: Remove old test + Stop testing DriveFileManager

Signed-off-by: Philippe Weidmann <[email protected]>

* test: Update some old tests

Signed-off-by: Philippe Weidmann <[email protected]>

* feat(ios-features): Added necessary libraries as a Framework

* chore: Bump core

Signed-off-by: Philippe Weidmann <[email protected]>

* feat(ios-features): Bump to 1.0.0

* chore: Tuist update

* feat: MykSuite chip (#1421)

* feat(FolderTypeTableViewCell): MykSuite chip

* feat(NewFolderTypeTableViewController): Present upsale sheet when needed

* feat(NewFolderTypeTableViewController): Explicit present call

* refactor(FolderTypeTableViewCell): Remove comment

* feat(ShareAndRightsViewController): Present upsale on myKSuite

* feat(ShareLinkTableViewCell): Display MykSuiteChip

* refactor(FolderTypeTableViewCell): Renamed to chipContainerView

* feat(FilesHeaderView): Display the trash header view that matches the design

* feat(FilesHeaderView): Show trash header view only when needed

* feat: Clear color for chip container view

* chore(FileListViewController): Force display chip for now

* feat(MyKSuiteChip): Proper chip design with correct background color

* fix(FilesHeaderView): Correct margin for chip view

* fix(FolderTypeTableViewCell): Correct chip constraint

* chore(FileListViewController): Better temporary display logic

* feat(FilesHeaderView): Present upsale sheet on tap

* feat(ShareLinkTableViewCell): Handle extra actions for mykSuite

* feat(MyKSuiteBridgeViewController): Modern sheet presentation

* feat(presentUpSaleSheet): Animate a dismiss before presenting

* chore: Upgrade tuist + Explicitly declare dependencies

Signed-off-by: Philippe Weidmann <[email protected]>

* fix: Remove target grouping

Signed-off-by: Philippe Weidmann <[email protected]>

* test: Shared Env

Signed-off-by: Philippe Weidmann <[email protected]>

* fix: Lottie needs to be dynamic

Signed-off-by: Philippe Weidmann <[email protected]>

* test: Remove old test + Stop testing DriveFileManager

Signed-off-by: Philippe Weidmann <[email protected]>

* test: Update some old tests

Signed-off-by: Philippe Weidmann <[email protected]>

* feat(ios-features): Added necessary libraries as a Framework

* chore: Bump core

Signed-off-by: Philippe Weidmann <[email protected]>

* feat(FolderTypeTableViewCell): Changed space between title and subtitle to 8pt

* feat(FilesHeaderView): Bump margin between title and subtitle to 8pt

* feat(myKSuitePlus.logo): Dark mode

* chore: Upgrade tuist + Explicitly declare dependencies

Signed-off-by: Philippe Weidmann <[email protected]>

* fix: Remove target grouping

Signed-off-by: Philippe Weidmann <[email protected]>

* test: Update some old tests

Signed-off-by: Philippe Weidmann <[email protected]>

* feat(ios-features): Added necessary libraries as a Framework

* feat(myKSuitePlus.logo): Dark mode background color

* feat(greyBackgroundChipColor): Changed darkmode background color

* feat(Drive+Quota): If Quota is not present we do not enforce limitations app side

* feat(Drive): Method isFreePack return true when pack is myKSuite

* feat(LocalizedFilenameFormatter): Use drive.isFreePack for correctness

* chore: Update to latest version os i18n

* feat(FileListViewController): Correct check for trash folder

* feat(FilesHeaderView): Translations for mykSuite trash header view

* refactor: PR self feedback

* refactor: Chore typo

* feat(ShareAndRightsViewController): Removed force display chip

* feat(ShareLinkTableViewCell): Removed force display chip

* feat(NewFolderTypeTableViewController): Enable pack check

* chore: Clean dead comment

* feat(FileListViewController): Enable actual mykSuite logic check

* fix: Make the branch build great again

* refactor(ShareLinkTableViewCell): Make sure the cell loads great

* chore: Update project post rebase to work on ios-features 1.0.0

* chore: Project setup

* chore: Remove trash asset and substitute it for delete

* feat(FilesHeaderView): Using TextStyle with IKLabel

* chore: Remove duplicated color

* feat(FilesHeaderView): Using existing color

* feat(FloatingPanelActionCollectionViewCell): Chip capability (#1429)

* feat(FloatingPanelActionCollectionViewCell): Chip capability

* feat: Enable chip for convertToDropbox action

* feat: Rework existing limitations (#1428)

* feat(MenuViewController): Hide upgrade cell that shows up on top of menu

* feat(ShareLinkSettingsViewController): Present upsale sheet instead of store

* feat(FileActionsFloatingPanelViewController): Present upsale sheet instead of store

* feat(HomeViewController): Present upsale sheet instead of store

* feat(NewFolderTypeTableViewController): Present upsale sheet instead of store

* feat(FileActionsHelper): Present upsale sheet instead of store

---------

Signed-off-by: Philippe Weidmann <[email protected]>
Co-authored-by: Philippe Weidmann <[email protected]>

* feat: Dropbox quota (#1432)

* feat(NewFolderTypeTableViewController): Dropbox quota

* fix: Create dropbox navigation fix

* feat(FileActionsFloatingPanelViewController): Quota implementation

* chore(router): Removed .askToUpSaleIfQuotaReached method

* feat: Public share quota, advanced settings chip (#1430)

* feat(ShareLinkSettingTableViewCell): Chip displayed in advanced screen

* feat(ShareLinkSettingsViewController): Switch to new modal screen

* feat(ShareAndRightsViewController): Add quota check and present modal if required

* feat(ShareAndRightsViewController): Check shareLinkQuota before performing actions

* feat: Share cell state advanced logic quota

* feat(MykSuiteRestrictions): Factorized code

* feat(ShareAndRightsViewController): Use guard

* feat(MykSuiteRestrictions): More factorized code

* feat(ShareLinkSettingTableViewCell): Set button insets to zero

* feat: MykSuite dashboard (#1419)

* chore: Switch to dashboard branch

* feat: New account cell in parameters to display MyKSuiteStore view

* feat(MyKSuiteStore): Add type to DI

* feat(MyKSuiteDashboardViewBridgeController): Reworked presentation

* feat(AccountManager): Refresh myKSuiteStore on login

* feat(ParameterTableViewController): Grouped cell UI update

* chore: Removed iOS 15 conditional code

* feat(): Modern sheet presentation for MyKSuiteBridgeViewController

* feat(presentUpSaleSheet): Animate a dismiss before presenting

* feat(ios-features): Added necessary libraries as a Framework

* chore(MyKSuiteDashboardViewBridgeController): Bumped to lattest ios-features API

* feat(ParameterTableViewController): Some i18n

* chore: PR Feedback

* chore: Remove conditional ios version dependent code

* feat(ParameterTableViewController): Dynamic sections if mykSuite enabled

* fix(ParameterTableViewCell): Proper prepare for reuse implementation

* feat(ParameterTableViewController): Inter18n general section

* fix: New ios-features build

* chore: Bump core-ui

* feat(AsyncImageView): A sample swUI view to display account image still requires fine tuning

* feat(AccountManager): Call to updateMyKSuite is no longer breaking authentification if broken

* fix(ParameterTableViewController): Correct rounded corner on cell

* feat(ParameterTableViewCell): Cell has support for other fonts and can display the current mykSuite account

* chore: Bump to ios-features 1.0.2

* chore: Branding my kSuite plus with a plus logo not a plus plus

* feat(ParameterTableViewController): Custom design table view section

* chore: Remove force display of myksuite

* feat(AsyncImageView): Loading view with default color

* feat: Check for mykSuite availlable for a user

* chore: Bump ios-features

* refactor(ParameterTableViewController): Better async loading

* fix(ParameterTableViewController): Section title is now correct without a mykSuite

* chore: Sonar

* refactor(ParameterTableViewController): Use a font with correct color directly

* refactor(MyKSuiteDashboardViewBridgeController): Simplify constructor

* feat(AccountManager): Update mykSuite on updateUser

* refactor(ParameterTableViewController): Remove extraneous lazy DI for direct resolution call

* refactor(MenuViewController): Remove extraneous import

* refactor(MyKSuiteFloatingPanelBridgeController): Instantiate pattern

---------

Signed-off-by: Philippe Weidmann <[email protected]>
Co-authored-by: Philippe Weidmann <[email protected]>
  • Loading branch information
adrien-coye and PhilippeWeidmann authored Feb 14, 2025
1 parent 9344a92 commit c6de7b9
Show file tree
Hide file tree
Showing 48 changed files with 1,092 additions and 148 deletions.
1 change: 1 addition & 0 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ let project = Project(name: "kDrive",
.external(name: "MarkdownKit"),
.external(name: "RealmSwift"),
.external(name: "Realm"),
.external(name: "MyKSuite"),
.sdk(name: "StoreKit", type: .framework, status: .required)
],
settings: .settings(base: Constants.baseSettings),
Expand Down
31 changes: 20 additions & 11 deletions Tuist/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "978577225a5036d45e6d0b6efa3114b62d416e56115615c78b83bb375e8534df",
"originHash" : "8861f96269cb0948c6a4f36939cb053cc533985c8abc8a6cd517110b6da6bc0f",
"pins" : [
{
"identity" : "alamofire",
Expand Down Expand Up @@ -96,8 +96,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-core-ui",
"state" : {
"revision" : "3c36b8c376dd8779b47a5b03acfbe71ed270282a",
"version" : "18.0.0"
"revision" : "4d988c5e91d27db9ea3905242cb6c3a44df472d0",
"version" : "18.1.0"
}
},
{
Expand All @@ -109,6 +109,15 @@
"version" : "2.0.3"
}
},
{
"identity" : "ios-features",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-features",
"state" : {
"revision" : "c1b1a15d0fd6bf4622dc6f0d675e795b60c952f1",
"version" : "1.0.3"
}
},
{
"identity" : "ios-login",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -231,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"
}
},
{
Expand All @@ -258,8 +267,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-algorithms",
"state" : {
"revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42",
"version" : "1.2.0"
"revision" : "87e50f483c54e6efd60e885f7f5aa946cee68023",
"version" : "1.2.1"
}
},
{
Expand Down Expand Up @@ -303,17 +312,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "dff45738d84a53dbc8ee899c306b3a7227f54f89",
"version" : "2.80.0"
"revision" : "c51907a839e63ebf0ba2076bba73dd96436bd1b9",
"version" : "2.81.0"
}
},
{
"identity" : "swift-nio-transport-services",
"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"
}
},
{
Expand Down
8 changes: 6 additions & 2 deletions Tuist/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ let packageSettings = PackageSettings(
"Kingfisher": .framework,
"Lottie": .framework,
"RealmSwift": .framework,
"Realm": .framework
"Realm": .framework,
"MyKSuite": .framework,
"InfomaniakCoreSwiftUI": .framework,
"DesignSystem": .framework
]
)

Expand All @@ -31,7 +34,8 @@ let package = Package(
.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: "15.0.0")),
.package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "18.0.0")),
.package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "18.1.0")),
.package(url: "https://github.com/Infomaniak/ios-features", .upToNextMajor(from: "1.0.3")),
.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")),
Expand Down
32 changes: 32 additions & 0 deletions kDrive/AppRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import InfomaniakDI
import InfomaniakLogin
import kDriveCore
import kDriveResources
import MyKSuite
import SafariServices
import SwiftUI
import UIKit
import VersionChecker

Expand Down Expand Up @@ -144,6 +146,7 @@ public struct AppRouter: AppNavigable {
restoreMainUIStackIfPossible(driveFileManager: driveFileManager, restoration: restoration)

showLaunchFloatingPanel()

Task {
await askForReview()
await askUserToRemovePicturesIfNecessary()
Expand Down Expand Up @@ -510,6 +513,35 @@ public struct AppRouter: AppNavigable {
}
}

@MainActor public func presentUpSaleSheet() {
guard let window,
let rootViewController = window.rootViewController else {
return
}

rootViewController.dismiss(animated: true) {
let viewControllerToPresent = MyKSuiteBridgeViewController.instantiate()
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 {
guard let presentingViewController = await window?.rootViewController,
!Bundle.main.isRunningInTestFlight else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"colors": [
"colors" : [
{
"color": {
"color-space": "srgb",
"components": {
"alpha": "1.000",
"blue": "0x2E",
"green": "0x47",
"red": "0xFB"
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x2E",
"green" : "0x47",
"red" : "0xFB"
}
},
"idiom": "universal"
"idiom" : "universal"
}
],
"info": {
"author": "xcode",
"version": 1
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF1",
"green" : "0xF1",
"red" : "0xF1"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x1A",
"green" : "0x1A",
"red" : "0x1A"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x72",
"green" : "0x67",
"red" : "0x55"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x33",
"green" : "0x33",
"red" : "0x33"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "drive.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "folder.arrow.up.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "myKSuitePlus.logo.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Logo kSuite.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit c6de7b9

Please sign in to comment.