Skip to content

Commit

Permalink
Merge pull request #1749 from anyproto/ios-3085-add-support-for-new-f…
Browse files Browse the repository at this point in the history
…ilter-protocol

iOS-3085 Move from .and operator in filters (simple version)
  • Loading branch information
joe-pusya authored Aug 26, 2024
2 parents d4d7684 + f5bb28e commit faad96f
Show file tree
Hide file tree
Showing 12 changed files with 540 additions and 53 deletions.
24 changes: 24 additions & 0 deletions Anytype/Generated/Error+Localization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4918,6 +4918,30 @@ extension Anytype_Rpc.Object.ListExport.Response.Error: LocalizedError {
}
}

extension Anytype_Rpc.Object.ListModifyDetailValues.Response.Error: LocalizedError {
public var errorDescription: String? {
let localizeError = localizeError()
if localizeError.isNotEmpty {
return localizeError
}
return "Error: \(description_p) (\(code))"
}

private func localizeError() -> String {
switch code {
case .null:
return ""
case .unknownError:
return ""
case .badInput:
return String(localized: "Object.ListModifyDetailValues.badInput", defaultValue: "", table: "LocalizableError")
.checkValue(key: "Object.ListModifyDetailValues.badInput")
case .UNRECOGNIZED:
return ""
}
}
}

extension Anytype_Rpc.Object.ListSetDetails.Response.Error: LocalizedError {
public var errorDescription: String? {
let localizeError = localizeError()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ final class MiddlewareEventConverter {
.notificationSend,
.notificationUpdate,
.payloadBroadcast,
.importFinish,
.spaceSyncStatusUpdate, // Implemented in `SyncStatusStorage`
.p2PStatusUpdate, // Implemented in `P2PStatusStorage`
.membershipUpdate: // Implemented in `MembershipStatusStorage`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extension SyncStatusInfo {
error.localizedDescription
case .offline:
Loc.noConnection
case .UNRECOGNIZED:
case .UNRECOGNIZED, .networkNeedsUpdate:
Loc.connecting
}
}
Expand All @@ -64,7 +64,7 @@ extension SyncStatusInfo {
error.localizedDescription
case .offline:
Loc.noConnection
case .UNRECOGNIZED:
case .UNRECOGNIZED, .networkNeedsUpdate:
Loc.connecting
}
}
Expand Down Expand Up @@ -105,7 +105,7 @@ extension SyncStatusInfo: NetworkIconProvider {
.animation(start: .Light.green, end: .Light.green.opacity(0.5))
case .error:
.static(.Light.red)
case .offline, .UNRECOGNIZED:
case .offline, .UNRECOGNIZED, .networkNeedsUpdate:
.static(.Shape.secondary)
}
}
Expand All @@ -122,7 +122,7 @@ extension SyncStatusInfo: NetworkIconProvider {
icon:ImageAsset.SyncStatus.syncAnytypenetworkError,
color: .System.red
)
case .offline, .UNRECOGNIZED:
case .offline, .UNRECOGNIZED, .networkNeedsUpdate:
NetworkIconData(
icon: ImageAsset.SyncStatus.syncOffline,
color: .Button.active
Expand All @@ -142,7 +142,7 @@ extension SyncStatusInfo: NetworkIconProvider {
icon: ImageAsset.SyncStatus.syncSelfhost,
color: .System.red
)
case .offline, .UNRECOGNIZED:
case .offline, .UNRECOGNIZED, .networkNeedsUpdate:
NetworkIconData(
icon: ImageAsset.SyncStatus.syncSelfhost,
color: .Button.active
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct SyncStatusData {
)
case .synced:
return .image(makeIcon(color: .System.green))
case .offline, .UNRECOGNIZED:
case .offline, .UNRECOGNIZED, .networkNeedsUpdate:
return .image(makeIcon(color: .Button.active))
}
}
Expand Down
2 changes: 1 addition & 1 deletion Libraryfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MIDDLE_VERSION=v0.35.4
MIDDLE_VERSION=v0.36.0-rc2
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,11 @@ extension Anytype_Rpc.Object.ListExport.Response.Error: ResponseError {
public var isNull: Bool { code == .null && description_p.isEmpty }
}

extension Anytype_Rpc.Object.ListModifyDetailValues.Response: ResultWithError {}
extension Anytype_Rpc.Object.ListModifyDetailValues.Response.Error: ResponseError {
public var isNull: Bool { code == .null && description_p.isEmpty }
}

extension Anytype_Rpc.Object.ListSetDetails.Response: ResultWithError {}
extension Anytype_Rpc.Object.ListSetDetails.Response.Error: ResponseError {
public var isNull: Bool { code == .null && description_p.isEmpty }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,16 @@ public struct ClientCommands {
}
}

public static func objectListModifyDetailValues(
_ request: Anytype_Rpc.Object.ListModifyDetailValues.Request = .init()
) -> Invocation<Anytype_Rpc.Object.ListModifyDetailValues.Request, Anytype_Rpc.Object.ListModifyDetailValues.Response> {
return Invocation(messageName: "ObjectListModifyDetailValues", request: request) { request in
let requestData = try request.serializedData()
let responseData = Lib.ServiceObjectListModifyDetailValues(requestData) ?? Data()
return try Anytype_Rpc.Object.ListModifyDetailValues.Response(serializedData: responseData)
}
}

public static func objectApplyTemplate(
_ request: Anytype_Rpc.Object.ApplyTemplate.Request = .init()
) -> Invocation<Anytype_Rpc.Object.ApplyTemplate.Request, Anytype_Rpc.Object.ApplyTemplate.Response> {
Expand Down
Loading

0 comments on commit faad96f

Please sign in to comment.