Merge remote-tracking branch 'origin/develop' into feature/ONEAPP-7249

This commit is contained in:
Hedden, Kyle Matthew 2024-05-21 20:04:10 -04:00
commit fbb582d2b7
5 changed files with 18 additions and 48 deletions

View File

@ -565,7 +565,6 @@
D2ED27EE254B0CE700A1C293 /* ActionAlertModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2ED27E9254B0CE600A1C293 /* ActionAlertModel.swift */; };
D2ED27EF254B0CE700A1C293 /* AlertModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2ED27EA254B0CE700A1C293 /* AlertModel.swift */; };
D2ED27FC254B0E0300A1C293 /* AlertObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2ED27F3254B0E0200A1C293 /* AlertObject.swift */; };
D2FA83D22513EA6900564112 /* NotificationXButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2FA83D12513EA6900564112 /* NotificationXButton.swift */; };
D2FA83D42514F80C00564112 /* CollapsableNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2FA83D32514F80C00564112 /* CollapsableNotification.swift */; };
D2FA83D62515021F00564112 /* CollapsableNotificationTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2FA83D52515021F00564112 /* CollapsableNotificationTopView.swift */; };
D2FB151B23A2B65B00C20E10 /* MoleculeContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2FB151A23A2B65B00C20E10 /* MoleculeContainer.swift */; };
@ -1192,7 +1191,6 @@
D2ED27E9254B0CE600A1C293 /* ActionAlertModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionAlertModel.swift; sourceTree = "<group>"; };
D2ED27EA254B0CE700A1C293 /* AlertModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertModel.swift; sourceTree = "<group>"; };
D2ED27F3254B0E0200A1C293 /* AlertObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertObject.swift; sourceTree = "<group>"; };
D2FA83D12513EA6900564112 /* NotificationXButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationXButton.swift; sourceTree = "<group>"; };
D2FA83D32514F80C00564112 /* CollapsableNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsableNotification.swift; sourceTree = "<group>"; };
D2FA83D52515021F00564112 /* CollapsableNotificationTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsableNotificationTopView.swift; sourceTree = "<group>"; };
D2FB151A23A2B65B00C20E10 /* MoleculeContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeContainer.swift; sourceTree = "<group>"; };
@ -2559,7 +2557,6 @@
isa = PBXGroup;
children = (
D2CAC7CA251104E100C75681 /* NotificationXButtonModel.swift */,
D2FA83D12513EA6900564112 /* NotificationXButton.swift */,
D2CAC7CC251104FE00C75681 /* NotificationMoleculeModel.swift */,
D23118B225124E18001C8440 /* NotificationMoleculeView.swift */,
D2CAC7CE2511052300C75681 /* CollapsableNotificationModel.swift */,
@ -3169,7 +3166,6 @@
EACCF38C2ABB346700E0F104 /* VDS-Interpreters.swift in Sources */,
C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */,
0AE98BB523FF18D2004C5109 /* Arrow.swift in Sources */,
D2FA83D22513EA6900564112 /* NotificationXButton.swift in Sources */,
D2D90B442404789000DD6EC9 /* MoleculeContainerProtocol.swift in Sources */,
0A7ECC5F243CEB1200C828E8 /* ColorViewWithLabel.swift in Sources */,
BB3BC12F2550094500297977 /* ListLeftVariableIconWithRightCaretAllTextLinks.swift in Sources */,

View File

@ -140,6 +140,7 @@ open class TabsModel: MoleculeModelProtocol {
open class TabItemModel: Codable, Equatable, MoleculeModelComparisonProtocol {
open var label: LabelModel
open var action: ActionModelProtocol?
public var analyticsData: JSONValueDictionary?
public init(label: LabelModel) {
self.label = label
@ -148,6 +149,7 @@ open class TabItemModel: Codable, Equatable, MoleculeModelComparisonProtocol {
private enum CodingKeys: String, CodingKey {
case label
case action
case analyticsData
}
open func setDefaults() {
@ -166,6 +168,7 @@ open class TabItemModel: Codable, Equatable, MoleculeModelComparisonProtocol {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
label = try typeContainer.decode(LabelModel.self, forKey: .label)
action = try typeContainer.decodeModelIfPresent(codingKey: .action)
analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData)
setDefaults()
}
@ -173,6 +176,7 @@ open class TabItemModel: Codable, Equatable, MoleculeModelComparisonProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeModel(label, forKey: .label)
try container.encodeModelIfPresent(action, forKey: .action)
try container.encodeIfPresent(analyticsData, forKey: .analyticsData)
}
public static func == (lhs: TabItemModel, rhs: TabItemModel) -> Bool {

View File

@ -66,6 +66,11 @@ extension TabsTableViewCell: TabsDelegate {
MVMCoreUIActionHandler.performActionUnstructured(with: action, sourceModel: model.tabs, additionalData: nil, delegateObject: delegateObject)
}
MVMCoreUIActionHandler.performActionUnstructured(with: SwapMoleculesActionModel(index < previousTabIndex ? .left : .right), sourceModel: model, additionalData: nil, delegateObject: delegateObject)
if let analyticsData = try? model.tabs.tabs[index].analyticsData?.toJSONAny(),
let controller = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol {
MVMCoreUILoggingHandler.shared()?.defaultLogPageUpdate(forController: controller, from: ["analyticsData": analyticsData])
}
}
}

View File

@ -46,10 +46,16 @@ import VDS
self.accessibilityIdentifier = accessibilityIdentifier
}
if let closeButton = viewModel.closeButton {
if var closeButton = viewModel.closeButton {
onCloseClick = { [weak self] _ in
guard let self else { return }
self.executeAction(model: closeButton, delegateObject: self.delegateObject, additionalData: self.additionalData) }
if closeButton.action.actionType == ActionNoopModel.identifier {
closeButton.action = ActionDismissNotificationModel()
self.executeAction(model: closeButton, delegateObject: self.delegateObject, additionalData: self.additionalData)
} else {
self.executeAction(model: closeButton, delegateObject: self.delegateObject, additionalData: self.additionalData)
}
}
}
hideCloseButton = viewModel.closeButton == nil

View File

@ -1,41 +0,0 @@
//
// NotificationXButton.swift
// MVMCoreUI
//
// Created by Scott Pfeil on 9/17/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
import MVMCore
@objcMembers open class NotificationXButton: Button {
open func closeTopAlert(with delegateObject: MVMCoreUIDelegateObject?) {
MVMCoreUIActionHandler.performActionUnstructured(with: ActionDismissNotificationModel(), sourceModel: model, additionalData: nil, delegateObject: delegateObject)
}
open override func setupView() {
if let image = MVMCoreUIUtility.imageNamed("nav_close")?.withRenderingMode(.alwaysTemplate) {
setImage(image, for: .normal)
}
tintColor = .white
adjustsImageWhenHighlighted = false
accessibilityLabel = MVMCoreUIUtility.hardcodedString(withKey: "AccCloseButton")
setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
heightAnchor.constraint(equalToConstant: 16.0).isActive = true
widthAnchor.constraint(equalToConstant: 16.0).isActive = true
}
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? NotificationXButtonModel else { return }
// TODO: Temporary, consider action for dismissing top alert
if model.action.actionType == ActionNoopModel.identifier {
addActionBlock(event: .touchUpInside) { (button) in
(button as? NotificationXButton)?.closeTopAlert(with: delegateObject)
}
}
}
}