diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift index a8e004c2..3b72d37c 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift @@ -19,6 +19,7 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat open class var identifier: String { "button" } public var backgroundColor: Color? public var accessibilityIdentifier: String? + public var accessibilityText: String? public var title: String public var action: ActionModelProtocol public var enabled: Bool = true @@ -168,6 +169,7 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat case moleculeName case backgroundColor case accessibilityIdentifier + case accessibilityText case title case inverted case action @@ -192,6 +194,7 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier) + accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText) title = try typeContainer.decode(String.self, forKey: .title) action = try typeContainer.decodeModel(codingKey: .action) @@ -250,6 +253,7 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat try container.encodeModel(action, forKey: .action) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier) + try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText) try container.encodeIfPresent(enabledFillColor, forKey: .fillColor) try container.encodeIfPresent(enabledTextColor, forKey: .textColor) try container.encodeIfPresent(enabledBorderColor, forKey: .borderColor) diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift b/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift index 49e67815..1ae5ca6a 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift @@ -51,7 +51,7 @@ import UIKit guard let model = model as? LinkModel else { return } setTitle(model.title, for: .normal) - accessibilityLabel = model.accessibilityIdentifier ?? model.title + accessibilityLabel = model.accessibilityText ?? model.title setTitleColor((model.inverted ? model.enabledColor_inverted : model.enabledColor).uiColor, for: .normal) setTitleColor((model.inverted ? model.disabledColor_inverted : model.disabledColor).uiColor, for: .disabled) isEnabled = model.enabled diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/Link/LinkModel.swift b/MVMCoreUI/Atomic/Atoms/Buttons/Link/LinkModel.swift index f3b48bd4..955601ac 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/Link/LinkModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/Link/LinkModel.swift @@ -19,6 +19,7 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol, EnableableMode public var backgroundColor: Color? public var accessibilityIdentifier: String? public var title: String + public var accessibilityText: String? public var action: ActionModelProtocol public var enabled = true public var enabledColor = Color(uiColor: .mvmBlack) @@ -44,6 +45,7 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol, EnableableMode case moleculeName case backgroundColor case accessibilityIdentifier + case accessibilityText case title case action case enabled @@ -64,6 +66,7 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol, EnableableMode backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier) title = try typeContainer.decode(String.self, forKey: .title) + accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText) action = try typeContainer.decodeModel(codingKey: .action) if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) { diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift b/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift index 9f048ca4..f184bf08 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/PillButton.swift @@ -188,9 +188,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol { guard let model = model as? ButtonModel else { return } setTitle(model.title, for: .normal) - if let accessibilityText = model.accessibilityIdentifier { - accessibilityLabel = accessibilityText - } + accessibilityLabel = model.accessibilityText ?? model.title if let size = model.size { buttonSize = size diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift index 72b74998..1359c2c0 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift @@ -63,9 +63,9 @@ import Foundation message += messageLabel } - if let accessibilityLabel = headlineBody.headlineLabel.accessibilityLabel { - message = accessibilityLabel - } +// if let accessibilityLabel = headlineBody.headlineLabel.accessibilityLabel { +// message = accessibilityLabel +// } accessibilityLabel = message }