From 91cee993b3db84fb53b3d757c699c97c67652870 Mon Sep 17 00:00:00 2001 From: Nandhini Rajendran Date: Wed, 8 May 2024 08:01:14 +0530 Subject: [PATCH 1/5] CXTDT-552665 Fixing top notification close button --- .../TopNotification/NotificationMoleculeView.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationMoleculeView.swift b/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationMoleculeView.swift index 38c58aa9..a0cd0b17 100644 --- a/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationMoleculeView.swift +++ b/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationMoleculeView.swift @@ -49,7 +49,15 @@ import VDS if let 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 { + if var dismissAction = self.viewModel.closeButton { + dismissAction.action = ActionDismissNotificationModel() + self.executeAction(model: dismissAction, delegateObject: self.delegateObject, additionalData: self.additionalData) + } + } else { + self.executeAction(model: closeButton, delegateObject: self.delegateObject, additionalData: self.additionalData) + } + } } hideCloseButton = viewModel.closeButton == nil From c628616e4a5c41d9c30f0b26bc1d8327313c5ff8 Mon Sep 17 00:00:00 2001 From: Nandhini Rajendran Date: Wed, 8 May 2024 08:25:54 +0530 Subject: [PATCH 2/5] Remove NotificationXButton class --- MVMCoreUI.xcodeproj/project.pbxproj | 4 -- .../TopNotification/NotificationXButton.swift | 41 ------------------- 2 files changed, 45 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/TopNotification/NotificationXButton.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 62792baf..f9443f01 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -558,7 +558,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 */; }; @@ -1168,7 +1167,6 @@ D2ED27E9254B0CE600A1C293 /* ActionAlertModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionAlertModel.swift; sourceTree = ""; }; D2ED27EA254B0CE700A1C293 /* AlertModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertModel.swift; sourceTree = ""; }; D2ED27F3254B0E0200A1C293 /* AlertObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertObject.swift; sourceTree = ""; }; - D2FA83D12513EA6900564112 /* NotificationXButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationXButton.swift; sourceTree = ""; }; D2FA83D32514F80C00564112 /* CollapsableNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsableNotification.swift; sourceTree = ""; }; D2FA83D52515021F00564112 /* CollapsableNotificationTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsableNotificationTopView.swift; sourceTree = ""; }; D2FB151A23A2B65B00C20E10 /* MoleculeContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeContainer.swift; sourceTree = ""; }; @@ -2496,7 +2494,6 @@ isa = PBXGroup; children = ( D2CAC7CA251104E100C75681 /* NotificationXButtonModel.swift */, - D2FA83D12513EA6900564112 /* NotificationXButton.swift */, D2CAC7CC251104FE00C75681 /* NotificationMoleculeModel.swift */, D23118B225124E18001C8440 /* NotificationMoleculeView.swift */, D2CAC7CE2511052300C75681 /* CollapsableNotificationModel.swift */, @@ -3063,7 +3060,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 */, diff --git a/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationXButton.swift b/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationXButton.swift deleted file mode 100644 index c102d064..00000000 --- a/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationXButton.swift +++ /dev/null @@ -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) - } - } - } -} From b6ac373e0faf1f98f2265295187d44c3a936a393 Mon Sep 17 00:00:00 2001 From: Nandhini Rajendran Date: Wed, 8 May 2024 21:01:07 +0530 Subject: [PATCH 3/5] Addressing review comments. --- .../TopNotification/NotificationMoleculeView.swift | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationMoleculeView.swift b/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationMoleculeView.swift index a0cd0b17..414d3dfa 100644 --- a/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationMoleculeView.swift +++ b/MVMCoreUI/Atomic/Molecules/TopNotification/NotificationMoleculeView.swift @@ -46,14 +46,12 @@ import VDS self.accessibilityIdentifier = accessibilityIdentifier } - if let closeButton = viewModel.closeButton { + if var closeButton = viewModel.closeButton { onCloseClick = { [weak self] _ in guard let self else { return } if closeButton.action.actionType == ActionNoopModel.identifier { - if var dismissAction = self.viewModel.closeButton { - dismissAction.action = ActionDismissNotificationModel() - self.executeAction(model: dismissAction, delegateObject: self.delegateObject, additionalData: self.additionalData) - } + closeButton.action = ActionDismissNotificationModel() + self.executeAction(model: closeButton, delegateObject: self.delegateObject, additionalData: self.additionalData) } else { self.executeAction(model: closeButton, delegateObject: self.delegateObject, additionalData: self.additionalData) } From 7557e913a21b8760271705551ed6aebec7d67a1b Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Fri, 17 May 2024 14:42:35 -0400 Subject: [PATCH 4/5] Digital PCT265 defect CXTDT-546581: Tabs page state tracking. --- .../Molecules/HorizontalCombinationViews/TabsModel.swift | 6 +++++- MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift index a7acadf6..16416933 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift @@ -112,6 +112,7 @@ open class TabsModel: MoleculeModelProtocol { open class TabItemModel: Codable { open var label: LabelModel open var action: ActionModelProtocol? + public var analyticsData: JSONValueDictionary? public init(label: LabelModel) { self.label = label @@ -120,6 +121,7 @@ open class TabItemModel: Codable { private enum CodingKeys: String, CodingKey { case label case action + case analyticsData } open func setDefaults() { @@ -138,12 +140,14 @@ open class TabItemModel: Codable { 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() } - + open func encode(to encoder: Encoder) throws { 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) } } diff --git a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift index 631bf50f..3bb8ce43 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift @@ -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 = self.delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol { + MVMCoreUILoggingHandler.shared()?.defaultLogPageUpdate(forController: controller, from: ["analyticsData": analyticsData]) + } } } From 8e70aba1573780f9ec3646fbef70e9a43fc84271 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Mon, 20 May 2024 11:54:01 -0400 Subject: [PATCH 5/5] Digital PCT265 defect CXTDT-54658: Code review. --- MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift index 3bb8ce43..c97c0ed1 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/TabsTableViewCell.swift @@ -68,7 +68,7 @@ extension TabsTableViewCell: TabsDelegate { 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 = self.delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol { + let controller = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol { MVMCoreUILoggingHandler.shared()?.defaultLogPageUpdate(forController: controller, from: ["analyticsData": analyticsData]) } }