Merge branch 'bugfix/vds-titlelockup-update' into 'develop'

updated logic for change in VDS TitleLockup/Tilelet

### Summary
VDS titlelockup model changed which needed to be reflected in the conversion

### JIRA Ticket
(ticket URL here or remove the section)

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

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/973
This commit is contained in:
Pfeil, Scott Robert 2023-06-29 20:38:55 +00:00
commit 198a45c1c4

View File

@ -65,9 +65,9 @@ open class TileletModel: MoleculeModelProtocol {
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)
let style: Tilelet.TitleModel.TextStyle? = title.fontStyle?.vdsSubsetStyle()
if let style {
return .init(text: title.text, textAttributes: attrs, textStyle: style)
let style: TextStyle? = title.fontStyle?.vdsTextStyle()
if let style, let standardStyle = Tilelet.TitleModel.StandardStyle(rawValue: style.toStandardStyle().rawValue) {
return .init(text: title.text, textAttributes: attrs, standardStyle: standardStyle)
} else {
return .init(text: title.text, textAttributes: attrs)
}
@ -75,11 +75,12 @@ open class TileletModel: MoleculeModelProtocol {
public func subTitleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.SubTitleModel? {
guard let subTitle else { return nil }
let style: Tilelet.SubTitleModel.TextStyle? = subTitle.fontStyle?.vdsSubsetStyle()
if let style {
return .init(text: subTitle.text, textStyle: style)
let attrs = subTitle.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData)
let style: TextStyle? = subTitle.fontStyle?.vdsTextStyle()
if let style, let standardStyle = Tilelet.SubTitleModel.StandardStyle(rawValue: style.toStandardStyle().rawValue) {
return .init(text: subTitle.text, textAttributes: attrs, standardStyle: standardStyle)
} else {
return .init(text: subTitle.text)
return .init(text: subTitle.text, textAttributes: attrs)
}
}