Merge branch 'develop' into 'release/10_8_0'

updated logic for change in VDS TitleLockup/Tilelet

### Summary
merge develop

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>
Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/976
This commit is contained in:
Pfeil, Scott Robert 2023-06-30 18:01:46 +00:00
commit b49c03fa7f
4 changed files with 13 additions and 24 deletions

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)
}
}

View File

@ -12,7 +12,6 @@ import MVMCore
/// A simple container view that shows and hides a notification.
public class NotificationContainerView: UIView {
public var currentModel: NotificationModel?
public var currentNotificationView: UIView?
lazy private var height = heightAnchor.constraint(equalToConstant: 0)
@ -82,17 +81,7 @@ extension NotificationContainerView: NotificationTransitionDelegateProtocol {
@MainActor
public func update(with model: NotificationModel, delegateObject: MVMCoreUIDelegateObject?) {
guard let currentModel = currentModel,
currentModel.type == model.type else { return }
guard let molecule = currentNotificationView as? MoleculeViewProtocol,
currentModel.molecule.moleculeName == model.molecule.moleculeName else {
// Log that we couldn't update.
if let errorObject = MVMCoreErrorObject(title: nil, message: nil, messageToLog: nil, code: ErrorCode.parsingJSON.rawValue, domain: ErrorDomainNative, location: "TopNotification update \(String(describing: model.type))") {
MVMCoreUILoggingHandler.addError(toLog: errorObject)
}
return
}
guard let molecule = currentNotificationView as? MoleculeViewProtocol else { return }
// Update molecule
molecule.reset()
molecule.set(with: model.molecule, delegateObject, nil)

View File

@ -563,8 +563,9 @@ extension NotificationOperation {
!isCancelled else { return }
self.log(message: "Operation Updated")
updateStopTimer()
Task { @MainActor in
transitionDelegate.update(with: notificationModel, delegateObject: delegateObject)
Task {
await transitionDelegate.update(with: notificationModel, delegateObject: delegateObject)
NotificationHandler.shared()?.onNotificationUpdated.send((notification, notificationModel))
}
}

View File

@ -18,9 +18,7 @@ import MVMCore
loadHandler = MVMCoreLoadHandler()
cache = MVMCoreCache()
session = MVMCoreUISession()
Task { @MainActor in
self.sessionHandler = MVMCoreSessionTimeHandler()
}
sessionHandler = MVMCoreSessionTimeHandler()
actionHandler = MVMCoreUIActionHandler()
viewControllerMapping = MVMCoreUIViewControllerMappingObject()
loggingDelegate = MVMCoreUILoggingHandler()