Merge branch 'bugfix/CXTDT-530449' into 'release/11_4_0'

ecoding & decoding fillContainer param in TwoButtonView molecule

### Summary
ecoding & decoding fillContainer param in TwoButtonView molecule, so json can control to fill the buttonView

### JIRA Ticket
[CXTDT-530449](https://onejira.verizon.com/browse/CXTDT-530449)
[CXTDT-530454](https://onejira.verizon.com/browse/CXTDT-530454)
[CXTDT-530459](https://onejira.verizon.com/browse/CXTDT-530459)

Co-authored-by: Sumanth Nadigadda <sumanth.nadigadda@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1065
This commit is contained in:
Bruce, Matt R 2024-03-08 14:31:27 +00:00
commit f0d9664d16

View File

@ -38,6 +38,7 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
case backgroundColor
case primaryButton
case secondaryButton
case fillContainer
}
//--------------------------------------------------
@ -69,6 +70,7 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
try decoder.setContext(value: Use.secondary, for: "style") {
self.secondaryButton = try typeContainer.decodeMoleculeIfPresent(codingKey: .secondaryButton)
}
fillContainer = try typeContainer.decodeIfPresent(Bool.self, forKey: .fillContainer) ?? false
}
public func encode(to encoder: Encoder) throws {
@ -78,5 +80,6 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(primaryButton, forKey: .primaryButton)
try container.encodeIfPresent(secondaryButton, forKey: .secondaryButton)
try container.encodeIfPresent(fillContainer, forKey: .fillContainer)
}
}