From 7cb2a759491cae1d9f8d2043396d955df5f998d0 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 26 Mar 2024 14:00:15 -0500 Subject: [PATCH] fixes in the enum change for tilelet Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift | 12 ++++++------ MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift index 7cc9747e..62fac7e9 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift @@ -17,9 +17,9 @@ open class TileletModel: MoleculeModelProtocol { public static var identifier: String = "tilelet" public var id: String = UUID().uuidString public var backgroundColor: Color? - public var color: TileContainer.BackgroundColor - public var padding: TileContainer.Padding - public var aspectRatio: TileContainer.AspectRatio + public var color: Tilelet.BackgroundColor + public var padding: Tilelet.Padding + public var aspectRatio: Tilelet.AspectRatio public var badge: Tilelet.BadgeModel? public var title: LabelModel? public var subTitle: LabelModel? @@ -51,9 +51,9 @@ open class TileletModel: MoleculeModelProtocol { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString self.backgroundColor = try container.decodeIfPresent(Color.self, forKey: .backgroundColor) - self.color = try container.decodeIfPresent(TileContainer.BackgroundColor.self, forKey: .color) ?? TileContainer.BackgroundColor.black - self.padding = try container.decodeIfPresent(TileContainer.Padding.self, forKey: .padding) ?? TileContainer.Padding.padding4X - self.aspectRatio = try container.decodeIfPresent(TileContainer.AspectRatio.self, forKey: .aspectRatio) ?? TileContainer.AspectRatio.none + self.color = try container.decodeIfPresent(Tilelet.BackgroundColor.self, forKey: .color) ?? Tilelet.BackgroundColor.black + self.padding = try container.decodeIfPresent(Tilelet.Padding.self, forKey: .padding) ?? Tilelet.Padding.small + self.aspectRatio = try container.decodeIfPresent(Tilelet.AspectRatio.self, forKey: .aspectRatio) ?? Tilelet.AspectRatio.none self.badge = try container.decodeIfPresent(Tilelet.BadgeModel.self, forKey: .badge) self.title = try container.decodeIfPresent(LabelModel.self, forKey: .title) self.subTitle = try container.decodeIfPresent(LabelModel.self, forKey: .subTitle) diff --git a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift index fa55423f..9e524462 100644 --- a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift +++ b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift @@ -25,7 +25,8 @@ extension VDS.Tabs.Overflow: Codable {} extension VDS.Tabs.Size: Codable {} extension VDS.TextLink.Size: Codable {} extension VDS.TextLinkCaret.IconPosition: Codable {} -extension VDS.TileContainer.AspectRatio: Codable {} +extension VDS.TileContainerBase.AspectRatio: Codable {} +extension VDS.Tilelet.Padding: Codable {} extension VDS.TitleLockup.TextAlignment: Codable {} extension VDS.Tooltip.FillColor: Codable {} extension VDS.Tooltip.Size: Codable {} @@ -61,7 +62,7 @@ extension DecodableDefault { public typealias Surface = Wrapper } -extension VDS.TileContainer.BackgroundColor: Codable { +extension VDS.TileContainerBase.BackgroundColor: Codable { public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self {