Merge branch 'bugfix/tilecontainer-refactor' into 'develop'

fixes for VDS TileContainer update

### Summary
TileContainer/Tilelet for VDS still hasn't been fully VDS Tested, however the automatic fill is in fact a part of the requirement. This was resolved as well as the height/width issue.

This change in Atomic is to default to leading for Tilelet so it won't automatically be pinned to all edges. These components shouldn't be pinned to the trailing/right or bottom if they are to be resized by ratio or having width/height values.

Also by default, the Tilelet's aspectRatio should be set to .none

### JIRA
https://onejira.verizon.com/browse/VZWYZDG-2117

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1141
This commit is contained in:
Pfeil, Scott Robert 2024-07-03 14:44:37 +00:00
commit fdab57200d
4 changed files with 4 additions and 9 deletions

View File

@ -135,8 +135,6 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{
}
extension TileContainer: MVMCoreUIViewConstrainingProtocol {
public func horizontalAlignment() -> UIStackView.Alignment { .leading }
public func isClippable() -> Bool {
return false
}

View File

@ -67,7 +67,7 @@ open class TileContainerBaseModel<PaddingType: DefaultValuing & Codable, TileCon
public var showDropShadow: Bool = false
public var padding = PaddingType.defaultValue
public var color: TileContainerType.BackgroundColor = .black
public var aspectRatio: TileContainerType.AspectRatio = .ratio1x1
public var aspectRatio: TileContainerType.AspectRatio = .none
public var backgroundEffect: TileContainerType.BackgroundEffect = .none
public var surface: Surface { inverted ? .dark : .light }
@ -98,7 +98,7 @@ open class TileContainerBaseModel<PaddingType: DefaultValuing & Codable, TileCon
showDropShadow = try container.decodeIfPresent(Bool.self, forKey: .showDropShadow) ?? false
padding = try container.decodeIfPresent(PaddingType.self, forKey: .padding) ?? PaddingType.defaultValue
color = try container.decodeIfPresent(TileContainerType.BackgroundColor.self, forKey: .color) ?? .black
aspectRatio = try container.decodeIfPresent(TileContainerType.AspectRatio.self, forKey: .aspectRatio) ?? .ratio1x1
aspectRatio = try container.decodeIfPresent(TileContainerType.AspectRatio.self, forKey: .aspectRatio) ?? .none
backgroundEffect = try container.decodeIfPresent(TileContainerType.BackgroundEffect.self, forKey: .backgroundEffect) ?? .none
}

View File

@ -136,10 +136,6 @@ open class Tilelet: VDS.Tilelet, VDSMoleculeViewProtocol{
}
extension Tilelet: MVMCoreUIViewConstrainingProtocol {
// Investigate later.
//public func horizontalAlignment() -> UIStackView.Alignment { .leading }
public func isClippable() -> Bool {
return false
}

View File

@ -45,6 +45,7 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, Molec
case textWidth
case textPercentage
}
required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
@ -86,7 +87,7 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, Molec
} else {
subTitleColor = .primary
}
try super.init(from: decoder)
}