Digital ACT-191 ONEAPP-10586 story: addressing feedback - Added textfield for footnote text, tooltip title and content. Removed 'hideSymbol'. Added 'none' to set empty text to symbolType.
This commit is contained in:
parent
7343b670e9
commit
1922791580
@ -15,6 +15,7 @@ class FootnoteViewController: BaseViewController<Footnote> {
|
|||||||
case asterisk
|
case asterisk
|
||||||
case doubleAsterisk
|
case doubleAsterisk
|
||||||
case character
|
case character
|
||||||
|
case none
|
||||||
|
|
||||||
public static var defaultValue: Self { .asterisk }
|
public static var defaultValue: Self { .asterisk }
|
||||||
|
|
||||||
@ -27,6 +28,8 @@ class FootnoteViewController: BaseViewController<Footnote> {
|
|||||||
return "**"
|
return "**"
|
||||||
case .character:
|
case .character:
|
||||||
return "1."
|
return "1."
|
||||||
|
case .none:
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,9 +52,11 @@ class FootnoteViewController: BaseViewController<Footnote> {
|
|||||||
items: Footnote.Size.allCases)
|
items: Footnote.Size.allCases)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
var hideSymbolSwitch = Toggle()
|
var footnoteTextField = TextField()
|
||||||
var widthTextField = NumericField()
|
var widthTextField = NumericField()
|
||||||
var percentageTextField = NumericField()
|
var percentageTextField = NumericField()
|
||||||
|
var tooltipTitleTextField = TextField()
|
||||||
|
var tooltipContentTextField = TextField()
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
@ -66,12 +71,16 @@ class FootnoteViewController: BaseViewController<Footnote> {
|
|||||||
addFormRow(label: "Kind", view: kindPickerSelectorView)
|
addFormRow(label: "Kind", view: kindPickerSelectorView)
|
||||||
addFormRow(label: "Size", view: sizePickerSelectorView)
|
addFormRow(label: "Size", view: sizePickerSelectorView)
|
||||||
addFormRow(label: "Symbol Type", view: symbolTypePickerSelectorView)
|
addFormRow(label: "Symbol Type", view: symbolTypePickerSelectorView)
|
||||||
addFormRow(label: "Hide Symbol", view: hideSymbolSwitch)
|
addFormRow(label: "Text", view: footnoteTextField)
|
||||||
addFormRow(label: "Width", view: widthTextField)
|
addFormRow(label: "Width", view: widthTextField)
|
||||||
addFormRow(label: "Percentage (1-100)", view: percentageTextField)
|
addFormRow(label: "Percentage (1-100)", view: percentageTextField)
|
||||||
|
addFormRow(label: "ToolTip Title", view: tooltipTitleTextField)
|
||||||
|
addFormRow(label: "ToolTip Content", view: tooltipContentTextField)
|
||||||
|
|
||||||
hideSymbolSwitch.publisher(for: .valueChanged).sink { [weak self] control in
|
footnoteTextField
|
||||||
self?.component.hideSymbol = control.isOn
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
self?.component.text = text
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
widthTextField
|
widthTextField
|
||||||
@ -96,15 +105,29 @@ class FootnoteViewController: BaseViewController<Footnote> {
|
|||||||
}
|
}
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
tooltipTitleTextField
|
||||||
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
self?.updateTooltip()
|
||||||
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
tooltipContentTextField
|
||||||
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
self?.updateTooltip()
|
||||||
|
}.store(in: &subscribers)
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupModel() {
|
func setupModel() {
|
||||||
component.text = "Service is included for free for two years with activation of any iPhone15 model. Connection and response times vary based on location, site conditions, and other factors. See support.apple.com/en-us/HT213885 for more information."
|
component.text = "Service is included for free for two years with activation of any iPhone15 model. Connection and response times vary based on location, site conditions, and other factors. See support.apple.com/en-us/HT213885 for more information."
|
||||||
component.tooltipModel = .init(title: "Check your item.", content:"Here is the content for your item.")
|
component.tooltipModel = nil
|
||||||
|
|
||||||
|
footnoteTextField.text = component.text
|
||||||
sizePickerSelectorView.text = component.size.rawValue
|
sizePickerSelectorView.text = component.size.rawValue
|
||||||
kindPickerSelectorView.text = component.kind.rawValue
|
kindPickerSelectorView.text = component.kind.rawValue
|
||||||
symbolTypePickerSelectorView.text = SymbolType.defaultValue.text
|
symbolTypePickerSelectorView.text = SymbolType.defaultValue.text
|
||||||
|
tooltipTitleTextField.text = component.tooltipModel?.title
|
||||||
|
tooltipContentTextField.text = component.tooltipModel?.content
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupPicker() {
|
func setupPicker() {
|
||||||
@ -125,4 +148,13 @@ class FootnoteViewController: BaseViewController<Footnote> {
|
|||||||
self?.component.symbolType = item.text
|
self?.component.symbolType = item.text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func updateTooltip() {
|
||||||
|
let title = tooltipTitleTextField.text ?? ""
|
||||||
|
let content = tooltipContentTextField.text ?? ""
|
||||||
|
|
||||||
|
component.tooltipModel = !title.isEmpty || !content.isEmpty ? .init(title: title,
|
||||||
|
content: content) : nil
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user