From c6a302d4d4f17beb71a1f5feb0894155280e34bd Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Fri, 20 Sep 2024 12:38:25 +0530 Subject: [PATCH 1/9] Digital ACT-191 ONEAPP-10928 story: added new page for Modal --- VDSSample.xcodeproj/project.pbxproj | 4 + .../ViewControllers/ModalViewController.swift | 103 ++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 VDSSample/ViewControllers/ModalViewController.swift diff --git a/VDSSample.xcodeproj/project.pbxproj b/VDSSample.xcodeproj/project.pbxproj index 64ec822..7b82798 100644 --- a/VDSSample.xcodeproj/project.pbxproj +++ b/VDSSample.xcodeproj/project.pbxproj @@ -39,6 +39,7 @@ 186D13CD2BBA990800986B53 /* DropdownSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */; }; 18A3F1302BD9332500498E4A /* CalendarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A3F12F2BD9332500498E4A /* CalendarViewController.swift */; }; 18AE87522C06FDD60075F181 /* CarouselViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18AE87512C06FDD60075F181 /* CarouselViewController.swift */; }; + 18C0F9482C98177F00E1DD71 /* ModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18C0F9472C98177F00E1DD71 /* ModalViewController.swift */; }; 440B84CC2BD8E98B004A732A /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 440B84CB2BD8E98B004A732A /* TableViewController.swift */; }; 445BA07A29C088470036A7C5 /* NotificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 445BA07929C088470036A7C5 /* NotificationViewController.swift */; }; 44604AD929CE1CF900E62B51 /* LineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44604AD829CE1CF900E62B51 /* LineViewController.swift */; }; @@ -139,6 +140,7 @@ 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropdownSelectViewController.swift; sourceTree = ""; }; 18A3F12F2BD9332500498E4A /* CalendarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewController.swift; sourceTree = ""; }; 18AE87512C06FDD60075F181 /* CarouselViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselViewController.swift; sourceTree = ""; }; + 18C0F9472C98177F00E1DD71 /* ModalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalViewController.swift; sourceTree = ""; }; 440B84CB2BD8E98B004A732A /* TableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = ""; }; 445BA07929C088470036A7C5 /* NotificationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationViewController.swift; sourceTree = ""; }; 44604AD829CE1CF900E62B51 /* LineViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineViewController.swift; sourceTree = ""; }; @@ -347,6 +349,7 @@ EAB1D2D328AC409F00DAE764 /* LabelViewController.swift */, 44604AD829CE1CF900E62B51 /* LineViewController.swift */, EAD0688F2A55FC11002E3A2D /* LoaderViewController.swift */, + 18C0F9472C98177F00E1DD71 /* ModalViewController.swift */, 445BA07929C088470036A7C5 /* NotificationViewController.swift */, 71B23C302B921D730027F7D9 /* PaginationViewController.swift */, 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */, @@ -549,6 +552,7 @@ EAB5FEF32928153D00998C17 /* Helper.swift in Sources */, EA89204728B66CE2006B9984 /* KeyboardFrameChangeListener.swift in Sources */, EA4DB30428DCD25B00103EE3 /* BadgeViewController.swift in Sources */, + 18C0F9482C98177F00E1DD71 /* ModalViewController.swift in Sources */, EAB2376029E88D5D00AABE9A /* TooltipViewController.swift in Sources */, EA89204828B66CE2006B9984 /* ScrollViewKeyboardAvoiding.swift in Sources */, EA0FC2C12912DC5500DF80B4 /* TextLinkCaretViewController.swift in Sources */, diff --git a/VDSSample/ViewControllers/ModalViewController.swift b/VDSSample/ViewControllers/ModalViewController.swift new file mode 100644 index 0000000..82c5310 --- /dev/null +++ b/VDSSample/ViewControllers/ModalViewController.swift @@ -0,0 +1,103 @@ +// +// ModalViewController.swift +// VDSSample +// +// Created by Kanamarlapudi, Vasavi on 5/09/24. +// + +import Foundation +import UIKit +import VDS +import VDSCoreTokens +import Combine + +class ModalViewController: BaseViewController { + + var disabledSwitch = Toggle() + var showFooterSwitch = Toggle() + var fullScreenDialogSwitch = Toggle() + var singleButtonSwitch = Toggle() + var hideCloseSwitch = Toggle() + var disableAnimationSwitch = Toggle() + var disableOutsideSwitch = Toggle() + var openedSwitch = Toggle() + var enableBackSwitch = Toggle() + + var titleTextField = TextField() + var bodyTextField = TextField() + var heightTextField = TextField() + var widthTextField = TextField() + + override func viewDidLoad() { + super.viewDidLoad() + addContentTopView(view: .makeWrapper(for: component, edgeSpacing: 16.0), edgeSpacing: 0.0) + + setupPicker() + setupModel() + } + + override func setupForm(){ + super.setupForm() + addFormRow(label: "Disabled", view: disabledSwitch) + addFormRow(label: "Surface", view: surfacePickerSelectorView) + addFormRow(label: "Show Modal Footer", view: showFooterSwitch) + addFormRow(label: "Full Screen Dialog", view: fullScreenDialogSwitch) + addFormRow(label: "Single Button", view: singleButtonSwitch) + addFormRow(label: "Hide Close Button", view: hideCloseSwitch) + addFormRow(label: "Disable Animation", view: disableAnimationSwitch) + addFormRow(label: "Disable Outside Click", view: disableOutsideSwitch) + addFormRow(label: "Opened", view: openedSwitch) + addFormRow(label: "Modal Title", view: titleTextField) + addFormRow(label: "Modal Body", view: bodyTextField) + addFormRow(label: "Enable Back Button", view: enableBackSwitch) + addFormRow(label: "Max Height", view: heightTextField) + addFormRow(label: "Max Width", view: widthTextField) + + disabledSwitch.onChange = { [weak self] sender in + self?.component.isEnabled = !sender.isOn + } + + titleTextField + .textPublisher + .sink { [weak self] text in + self?.component.title = text + }.store(in: &subscribers) + + bodyTextField + .textPublisher + .sink { [weak self] text in + self?.component.content = text + }.store(in: &subscribers) + + } + + func setupModel() { + component.title = "5G Ultra Wideband is available in your area." + component.content = "$799.99 (128 GB only) " + //component.contentView = Icon().with { $0.name = .addFolder; $0.size = .medium } + + //setup UI + surfacePickerSelectorView.text = component.surface.rawValue + disabledSwitch.isOn = !component.isEnabled + titleTextField.text = component.title + bodyTextField.text = component.content + } + + //Picker + func setupPicker(){ + surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in + self?.component.surface = item + self?.contentTopView.backgroundColor = item.color + } + } +} + +extension ModalViewController: ComponentSampleable { + static func makeSample() -> ComponentSample { + let component = Self.makeComponent() + component.title = "5G Ultra Wideband is available in your area." + component.content = "$799.99 (128 GB only) " + return ComponentSample(component: component, trailingPinningType: .lessThanOrEqual, bottomPinningType: .lessThanOrEqual) + } +} + From 5aefd665ed25096575a4873bc2070f1c3ae37620 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Fri, 20 Sep 2024 12:57:25 +0530 Subject: [PATCH 2/9] Digital ACT-191 ONEAPP-10928 story: did set pinTrailing: false to all toggles --- .../ViewControllers/ModalViewController.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/VDSSample/ViewControllers/ModalViewController.swift b/VDSSample/ViewControllers/ModalViewController.swift index 82c5310..caa35fd 100644 --- a/VDSSample/ViewControllers/ModalViewController.swift +++ b/VDSSample/ViewControllers/ModalViewController.swift @@ -2,7 +2,7 @@ // ModalViewController.swift // VDSSample // -// Created by Kanamarlapudi, Vasavi on 5/09/24. +// Created by Kanamarlapudi, Vasavi on 05/09/24. // import Foundation @@ -38,18 +38,18 @@ class ModalViewController: BaseViewController { override func setupForm(){ super.setupForm() - addFormRow(label: "Disabled", view: disabledSwitch) + addFormRow(label: "Disabled", view: disabledSwitch, pinTrailing: false) addFormRow(label: "Surface", view: surfacePickerSelectorView) - addFormRow(label: "Show Modal Footer", view: showFooterSwitch) - addFormRow(label: "Full Screen Dialog", view: fullScreenDialogSwitch) - addFormRow(label: "Single Button", view: singleButtonSwitch) - addFormRow(label: "Hide Close Button", view: hideCloseSwitch) - addFormRow(label: "Disable Animation", view: disableAnimationSwitch) - addFormRow(label: "Disable Outside Click", view: disableOutsideSwitch) - addFormRow(label: "Opened", view: openedSwitch) + addFormRow(label: "Show Modal Footer", view: showFooterSwitch, pinTrailing: false) + addFormRow(label: "Full Screen Dialog", view: fullScreenDialogSwitch, pinTrailing: false) + addFormRow(label: "Single Button", view: singleButtonSwitch, pinTrailing: false) + addFormRow(label: "Hide Close Button", view: hideCloseSwitch, pinTrailing: false) + addFormRow(label: "Disable Animation", view: disableAnimationSwitch, pinTrailing: false) + addFormRow(label: "Disable Outside Click", view: disableOutsideSwitch, pinTrailing: false) + addFormRow(label: "Opened", view: openedSwitch, pinTrailing: false) addFormRow(label: "Modal Title", view: titleTextField) addFormRow(label: "Modal Body", view: bodyTextField) - addFormRow(label: "Enable Back Button", view: enableBackSwitch) + addFormRow(label: "Enable Back Button", view: enableBackSwitch, pinTrailing: false) addFormRow(label: "Max Height", view: heightTextField) addFormRow(label: "Max Width", view: widthTextField) From 1503310f429a005605d9e7e6c3c4b1adb6bc8639 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Tue, 24 Sep 2024 11:03:52 +0530 Subject: [PATCH 3/9] Digital ACT-191 ONEAPP-10928 story: removed disabled --- VDSSample/ViewControllers/ModalViewController.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/VDSSample/ViewControllers/ModalViewController.swift b/VDSSample/ViewControllers/ModalViewController.swift index caa35fd..0d2c518 100644 --- a/VDSSample/ViewControllers/ModalViewController.swift +++ b/VDSSample/ViewControllers/ModalViewController.swift @@ -13,7 +13,6 @@ import Combine class ModalViewController: BaseViewController { - var disabledSwitch = Toggle() var showFooterSwitch = Toggle() var fullScreenDialogSwitch = Toggle() var singleButtonSwitch = Toggle() @@ -38,7 +37,6 @@ class ModalViewController: BaseViewController { override func setupForm(){ super.setupForm() - addFormRow(label: "Disabled", view: disabledSwitch, pinTrailing: false) addFormRow(label: "Surface", view: surfacePickerSelectorView) addFormRow(label: "Show Modal Footer", view: showFooterSwitch, pinTrailing: false) addFormRow(label: "Full Screen Dialog", view: fullScreenDialogSwitch, pinTrailing: false) @@ -53,8 +51,8 @@ class ModalViewController: BaseViewController { addFormRow(label: "Max Height", view: heightTextField) addFormRow(label: "Max Width", view: widthTextField) - disabledSwitch.onChange = { [weak self] sender in - self?.component.isEnabled = !sender.isOn + fullScreenDialogSwitch.onChange = { [weak self] sender in + self?.component.fullScreenDialog = !sender.isOn } titleTextField @@ -78,7 +76,6 @@ class ModalViewController: BaseViewController { //setup UI surfacePickerSelectorView.text = component.surface.rawValue - disabledSwitch.isOn = !component.isEnabled titleTextField.text = component.title bodyTextField.text = component.content } From 6b57286b79c7ef62afd0764471b1de0d655d1a3d Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Wed, 25 Sep 2024 12:08:24 +0530 Subject: [PATCH 4/9] Digital ACT-191 ONEAPP-10928 story: updated modal text for huge content --- VDSSample/ViewControllers/ModalViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/VDSSample/ViewControllers/ModalViewController.swift b/VDSSample/ViewControllers/ModalViewController.swift index 0d2c518..ebe17db 100644 --- a/VDSSample/ViewControllers/ModalViewController.swift +++ b/VDSSample/ViewControllers/ModalViewController.swift @@ -70,9 +70,10 @@ class ModalViewController: BaseViewController { } func setupModel() { - component.title = "5G Ultra Wideband is available in your area." - component.content = "$799.99 (128 GB only) " - //component.contentView = Icon().with { $0.name = .addFolder; $0.size = .medium } + component.title = "Shipping Options To Deliver Your Order On Time!!!" + component.content = "Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed." + let onClick: (ButtonBase) -> Void = { button in print("\(button.text!) clicked")} + component.contentView = Button().with{ $0.use = .secondary; $0.text = "Secondary"; $0.onClick = onClick} //setup UI surfacePickerSelectorView.text = component.surface.rawValue From b0eba5ea82e6bb259c3a1433bbd5c8bae256067d Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Fri, 27 Sep 2024 17:22:19 +0530 Subject: [PATCH 5/9] Digital ACT-191 ONEAPP-10928 story: sending button data --- VDSSample/ViewControllers/MenuViewController.swift | 1 + VDSSample/ViewControllers/ModalViewController.swift | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/VDSSample/ViewControllers/MenuViewController.swift b/VDSSample/ViewControllers/MenuViewController.swift index 77ab906..104f8af 100644 --- a/VDSSample/ViewControllers/MenuViewController.swift +++ b/VDSSample/ViewControllers/MenuViewController.swift @@ -90,6 +90,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable { MenuComponent(title: "Label", completed: true, viewController: LabelViewController.self), MenuComponent(title: "Line", completed: true, viewController: LineViewController.self), MenuComponent(title: "Loader", completed: true, viewController: LoaderViewController.self), + MenuComponent(title: "Modal", completed: false, viewController: ModalViewController.self), MenuComponent(title: "Notification", completed: true, viewController: NotificationViewController.self), MenuComponent(title: "Pagination", completed: true, viewController: PaginationViewController.self), MenuComponent(title: "PriceLockup", completed: true, viewController: PriceLockupViewController.self), diff --git a/VDSSample/ViewControllers/ModalViewController.swift b/VDSSample/ViewControllers/ModalViewController.swift index ebe17db..377dd64 100644 --- a/VDSSample/ViewControllers/ModalViewController.swift +++ b/VDSSample/ViewControllers/ModalViewController.swift @@ -70,10 +70,14 @@ class ModalViewController: BaseViewController { } func setupModel() { - component.title = "Shipping Options To Deliver Your Order On Time!!!" + component.title = "Choose free 2-day shipping or In-store Pickup" component.content = "Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed." + component.contentView = Icon().with { $0.name = .addFolder; $0.size = .medium } let onClick: (ButtonBase) -> Void = { button in print("\(button.text!) clicked")} - component.contentView = Button().with{ $0.use = .secondary; $0.text = "Secondary"; $0.onClick = onClick} + component.buttonData = [ + Button().with{ $0.use = .primary; $0.text = "In-store Pickup"; $0.onClick = onClick; $0.size = .large }, + Button().with{ $0.use = .secondary; $0.text = "Close"; $0.onClick = { button in self.dismiss(animated: true); print("\(button.text!) clicked")} ; $0.size = .large } + ] //setup UI surfacePickerSelectorView.text = component.surface.rawValue @@ -93,8 +97,8 @@ class ModalViewController: BaseViewController { extension ModalViewController: ComponentSampleable { static func makeSample() -> ComponentSample { let component = Self.makeComponent() - component.title = "5G Ultra Wideband is available in your area." - component.content = "$799.99 (128 GB only) " + component.title = "Choose free 2-day shipping or In-store Pickup" + component.content = "Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed." return ComponentSample(component: component, trailingPinningType: .lessThanOrEqual, bottomPinningType: .lessThanOrEqual) } } From 71a299a3d0ec4d92735f74b08924671ae245c9f0 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Fri, 27 Sep 2024 18:13:49 +0530 Subject: [PATCH 6/9] Digital ACT-191 ONEAPP-10928 story: updating fullScreenDialog flag on control changes --- VDSSample/ViewControllers/ModalViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VDSSample/ViewControllers/ModalViewController.swift b/VDSSample/ViewControllers/ModalViewController.swift index 377dd64..351e97d 100644 --- a/VDSSample/ViewControllers/ModalViewController.swift +++ b/VDSSample/ViewControllers/ModalViewController.swift @@ -51,10 +51,10 @@ class ModalViewController: BaseViewController { addFormRow(label: "Max Height", view: heightTextField) addFormRow(label: "Max Width", view: widthTextField) - fullScreenDialogSwitch.onChange = { [weak self] sender in - self?.component.fullScreenDialog = !sender.isOn - } - + fullScreenDialogSwitch.publisher(for: .valueChanged).sink { [weak self] control in + self?.component.fullScreenDialog = control.isOn + }.store(in: &subscribers) + titleTextField .textPublisher .sink { [weak self] text in From fb292038f37eb6917b9f05c8eb95661a80a18cd8 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Fri, 27 Sep 2024 18:57:14 +0530 Subject: [PATCH 7/9] Digital ACT-191 ONEAPP-10928 story: updating flags for hide close button, single butting for dialog, show/hide footer on modal --- .../ViewControllers/ModalViewController.swift | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/VDSSample/ViewControllers/ModalViewController.swift b/VDSSample/ViewControllers/ModalViewController.swift index 351e97d..9d2764a 100644 --- a/VDSSample/ViewControllers/ModalViewController.swift +++ b/VDSSample/ViewControllers/ModalViewController.swift @@ -17,10 +17,6 @@ class ModalViewController: BaseViewController { var fullScreenDialogSwitch = Toggle() var singleButtonSwitch = Toggle() var hideCloseSwitch = Toggle() - var disableAnimationSwitch = Toggle() - var disableOutsideSwitch = Toggle() - var openedSwitch = Toggle() - var enableBackSwitch = Toggle() var titleTextField = TextField() var bodyTextField = TextField() @@ -42,18 +38,35 @@ class ModalViewController: BaseViewController { addFormRow(label: "Full Screen Dialog", view: fullScreenDialogSwitch, pinTrailing: false) addFormRow(label: "Single Button", view: singleButtonSwitch, pinTrailing: false) addFormRow(label: "Hide Close Button", view: hideCloseSwitch, pinTrailing: false) - addFormRow(label: "Disable Animation", view: disableAnimationSwitch, pinTrailing: false) - addFormRow(label: "Disable Outside Click", view: disableOutsideSwitch, pinTrailing: false) - addFormRow(label: "Opened", view: openedSwitch, pinTrailing: false) addFormRow(label: "Modal Title", view: titleTextField) addFormRow(label: "Modal Body", view: bodyTextField) - addFormRow(label: "Enable Back Button", view: enableBackSwitch, pinTrailing: false) addFormRow(label: "Max Height", view: heightTextField) addFormRow(label: "Max Width", view: widthTextField) fullScreenDialogSwitch.publisher(for: .valueChanged).sink { [weak self] control in self?.component.fullScreenDialog = control.isOn }.store(in: &subscribers) + + showFooterSwitch.publisher(for: .valueChanged).sink { [weak self] control in + guard let self else { return } + if control.isOn { + showFooter(with: singleButtonSwitch.isOn) + } else { + self.component.buttonData = nil + } + }.store(in: &subscribers) + + singleButtonSwitch.publisher(for: .valueChanged).sink { [weak self] control in + guard let self else { return } + if control.isOn { + showFooterSwitch.isOn = true + } + showFooter(with: control.isOn) + }.store(in: &subscribers) + + hideCloseSwitch.publisher(for: .valueChanged).sink { [weak self] control in + self?.component.hideCloseButton = control.isOn + }.store(in: &subscribers) titleTextField .textPublisher @@ -69,6 +82,19 @@ class ModalViewController: BaseViewController { } + func showFooter(with singleButton: Bool) { + if singleButton { + component.buttonData = [ + Button().with{ $0.use = .secondary; $0.text = "Close"; $0.onClick = { button in self.dismiss(animated: true); print("\(button.text!) clicked")} ; $0.size = .large } + ] + } else { + component.buttonData = [ + Button().with{ $0.use = .primary; $0.text = "In-store Pickup"; $0.onClick = { button in print("\(button.text!) clicked")}; $0.size = .large }, + Button().with{ $0.use = .secondary; $0.text = "Close"; $0.onClick = { button in self.dismiss(animated: true); print("\(button.text!) clicked")} ; $0.size = .large } + ] + } + } + func setupModel() { component.title = "Choose free 2-day shipping or In-store Pickup" component.content = "Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed. \n \n Order online, pickup in store, or get free 2-day shipping. Free 2-day shipping available for device and accessory orders of $49 or more. Free 2-day shipping when you order online M-F by 8PM EST. In-Store Pickup is available across the U.S. at participating Verizon Wireless stores. Please bring photo ID and credit/debit card only if used as payment. Order will be held for 3 days from the time if was placed." @@ -83,6 +109,7 @@ class ModalViewController: BaseViewController { surfacePickerSelectorView.text = component.surface.rawValue titleTextField.text = component.title bodyTextField.text = component.content + showFooterSwitch.isOn = true } //Picker From 70fb11b8100be45c51a9ed1a17d76a0c34a5194f Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Fri, 27 Sep 2024 20:47:06 +0530 Subject: [PATCH 8/9] Digital ACT-191 ONEAPP-10928 story: removed unnecessary code --- VDSSample/ViewControllers/ModalViewController.swift | 5 ----- 1 file changed, 5 deletions(-) diff --git a/VDSSample/ViewControllers/ModalViewController.swift b/VDSSample/ViewControllers/ModalViewController.swift index 9d2764a..9c03677 100644 --- a/VDSSample/ViewControllers/ModalViewController.swift +++ b/VDSSample/ViewControllers/ModalViewController.swift @@ -17,11 +17,8 @@ class ModalViewController: BaseViewController { var fullScreenDialogSwitch = Toggle() var singleButtonSwitch = Toggle() var hideCloseSwitch = Toggle() - var titleTextField = TextField() var bodyTextField = TextField() - var heightTextField = TextField() - var widthTextField = TextField() override func viewDidLoad() { super.viewDidLoad() @@ -40,8 +37,6 @@ class ModalViewController: BaseViewController { addFormRow(label: "Hide Close Button", view: hideCloseSwitch, pinTrailing: false) addFormRow(label: "Modal Title", view: titleTextField) addFormRow(label: "Modal Body", view: bodyTextField) - addFormRow(label: "Max Height", view: heightTextField) - addFormRow(label: "Max Width", view: widthTextField) fullScreenDialogSwitch.publisher(for: .valueChanged).sink { [weak self] control in self?.component.fullScreenDialog = control.isOn From 100e20056ed96796f67a45f38f0874cd2fea21a2 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 2 Oct 2024 14:05:46 -0500 Subject: [PATCH 9/9] updated artifiactory Signed-off-by: Matt Bruce --- VDSSample/Supporting Files/Artifactory/Artifactory.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDSSample/Supporting Files/Artifactory/Artifactory.sh b/VDSSample/Supporting Files/Artifactory/Artifactory.sh index 6ad5af6..3dff00f 100755 --- a/VDSSample/Supporting Files/Artifactory/Artifactory.sh +++ b/VDSSample/Supporting Files/Artifactory/Artifactory.sh @@ -4,10 +4,10 @@ VERSION="2.0" #Update onces stable #APITOKEN=AKCp5cbwXBA2Rarq6WagmFFxQxcxsARGxSq5g1H8NaGm7837KTgwdWPqsp7FdgRa13B7AcpGN -#URL=https://oneartifactorycloud.verizon.com/artifactory +#URL=https://oneartifactorycloud.verizon.com/artifactory/ APITOKEN=AKCp5ZmHP8B1dkLtdSh23bMcWHtrWzoB3SfhoCNpEC5e3dKNhiKsn8TPMZQafXzm2qkeXFXE6 -URL=https://oneartifactoryprod.verizon.com/artifactory +URL=https://oneartifactoryci.verizon.com/artifactory LOCALPATH="${1}" REMOTEPATH="${2}"