Merge branch 'bugfix/featured_products_defects' into 'develop'

Bugfix/featured products defects

### Summary
Fix for bold when the font isn't supported, and for bg image forcing full image size.

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1191
This commit is contained in:
Bruce, Matt R 2024-09-19 18:41:29 +00:00
commit 806ac9821a
2 changed files with 11 additions and 4 deletions

View File

@ -94,29 +94,34 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, 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<Tilelet.Padding, Tilelet>, 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? {

View File

@ -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]?) {