Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: External links #1236

Closed
wants to merge 31 commits into from
Closed

feat: External links #1236

wants to merge 31 commits into from

Conversation

adrien-coye
Copy link
Contributor

@adrien-coye adrien-coye commented Jul 26, 2024

Abstract

Feature PR of the external links

Tasks so far:

  • Network calls
  • In memory realm for each share link
  • Listing files of a public share
  • Actions on file
  • Thumbnails
  • Propagate context to preview controller and subsequent FileListViewController
  • Actions
  • Download file from Public Share to available drive.
  • New deeplinks
  • Add to my drive
  • Download All

To do in sister PRs

  • Locked Folder UI
  • Open logged out
  • Multi selection

@adrien-coye adrien-coye changed the title WIP endpoints feat: External links Jul 26, 2024
@@ -103,6 +103,18 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
}
application.registerForRemoteNotifications()

// swiftlint:disable force_try
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO remove


accessBlocked = try container.decode(Bool.self, forKey: .accessBlocked)
} catch {
// TODO: remove
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Remove

Copy link
Contributor Author

@adrien-coye adrien-coye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some notes for me to review and for future reviewer.

driveFileManager: DriveFileManager,
apiFetcher: PublicShareApiFetcher
) {
// TODO: Present on top of existing views
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Navigation


// TODO: i18n
let configuration = Configuration(selectAllSupported: false,
rootTitle: "public share",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: i18n

return
}

// Only show loading indicator if we have nothing in cache
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess I can remove this one

@@ -26,6 +26,21 @@ import InfomaniakLogin
import RealmSwift
import SwiftRegex

// TODO: Move to core
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: move to core, useful when dealing with many DBs

@@ -28,7 +28,7 @@ public enum RealmSchemaVersion {
static let upload: UInt64 = 21

/// Current version of the Drive Realm
static let drive: UInt64 = 11
static let drive: UInt64 = 12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to bump for automatic migration / new entity fields

@@ -134,6 +134,14 @@ public final class DriveInfosManager: DriveInfosManagerQueryable {
drive.sharedWithMe = sharedWithMe
}

// TODO: Add a flag that this drive can be cleaned
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Cleaning strategy for public share's Drive

@@ -182,6 +182,19 @@ public enum ConvertedType: String, CaseIterable {
public static let ignoreThumbnailTypes = downloadableTypes
}

/// Minimal data needed to query a PublicShare
public struct PublicShareProxy {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe group all "proxy" types ?


public func getMetadata(driveId: Int, shareLinkUid: String) async throws -> PublicShareMetadata {
let shareLinkInfoUrl = Endpoint.shareLinkInfo(driveId: driveId, shareLinkUid: shareLinkUid).url
// TODO: Use authenticated token if availlable
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Make sure to send token to enable backend to redirect if needed.

Copy link

@adrien-coye
Copy link
Contributor Author

adrien-coye commented Sep 27, 2024

Superseded by #1304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant