From 47e63e0c8b4a8e4e980b6cd3d9db06bad5f98924 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 19 Sep 2024 14:35:33 -0400 Subject: [PATCH] Digital ACT191 defect FeaturedProducts - Fix for bold when the font isn't supported, and for bg image forcing full image size. --- MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift | 13 +++++++++---- .../Molecules/OtherContainers/BGImageMolecule.swift | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift index e53066d0..f7b69c47 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift @@ -94,29 +94,34 @@ open class TileletModel: TileContainerBaseModel, Molec public func eyebrowModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.EyebrowModel? { guard let eyebrow else { return nil } let attrs = eyebrow.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) + var isBold: Bool = true do { if let style = eyebrow.fontStyle { + isBold = style.isBold() return .init(text: eyebrow.text, textColor: eyebrowColor, - textAttributes: attrs, isBold: style.isBold(), + textAttributes: attrs, + isBold: isBold, standardStyle: try style.vdsSubsetStyle()) } } catch MVMCoreError.errorObject(let object) { MVMCoreLoggingHandler.shared()?.addError(toLog: object) } catch { } - return .init(text: eyebrow.text, textColor: eyebrowColor, textAttributes: attrs) + return .init(text: eyebrow.text, textColor: eyebrowColor, textAttributes: attrs, isBold: isBold) } public func titleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.TitleModel? { guard let title else { return nil } let attrs = title.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) - + var isBold: Bool = true do { if let style = title.fontStyle { + isBold = style.isBold() return .init(text: title.text, textColor: titleColor, textAttributes: attrs, + isBold: isBold, standardStyle: try style.vdsSubsetStyle()) } @@ -124,7 +129,7 @@ open class TileletModel: TileContainerBaseModel, Molec MVMCoreLoggingHandler.shared()?.addError(toLog: object) } catch { } - return .init(text: title.text, textColor: titleColor, textAttributes: attrs) + return .init(text: title.text, textColor: titleColor, textAttributes: attrs, isBold: isBold) } public func subTitleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.SubTitleModel? { diff --git a/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMolecule.swift b/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMolecule.swift index 4aa811a1..485a82da 100644 --- a/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMolecule.swift +++ b/MVMCoreUI/Atomic/Molecules/OtherContainers/BGImageMolecule.swift @@ -16,6 +16,8 @@ open class BGImageMolecule: MoleculeContainer { super.setupView() insertSubview(image, at: 0) NSLayoutConstraint.constraintPinSubview(toSuperview: image) + image.setContentCompressionResistancePriority(.defaultLow, for: .vertical) + image.imageView.setContentCompressionResistancePriority(.defaultLow, for: .vertical) } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {