From d2a13626b6b657ca6833abe9c7ab89242deb7bf1 Mon Sep 17 00:00:00 2001 From: Naresh Date: Tue, 20 Feb 2024 23:34:18 +0530 Subject: [PATCH 1/4] As Per Scott Comment Updated Key to hide chat icon as per legacy As Per Scott Comment Updated Key to hide chat icon as per legacy --- MVMCoreUI/BaseControllers/ViewController.swift | 2 +- MVMCoreUI/Utility/MVMCoreUIConstants.h | 1 + MVMCoreUI/Utility/MVMCoreUIConstants.m | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index d3d7c3c0..8eb0737a 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -532,7 +532,7 @@ import MVMCore public func isRightPanelAccessible() -> Bool { // TODO: Remove when FAB is 100%. - if loadObject?.pageJSON?.boolForKey(KeyHideMainMenu) ?? false { + if loadObject?.pageJSON?.boolForKey(KeyHideChatSupport) ?? false { return false } return (MVMCoreUISession.sharedGlobal()?.launchAppLoadedSuccessfully ?? false) || showRightPanelForScreenBeforeLaunchApp() diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.h b/MVMCoreUI/Utility/MVMCoreUIConstants.h index ab77986b..f7c3ba0a 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.h +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.h @@ -26,6 +26,7 @@ extern NSString * const KeyEnabled; extern NSString * const KeyFieldName; extern NSString * const KeyHideMainMenu; +extern NSString * const KeyHideChatSupport; extern NSString * const KeyProgressPercent; extern NSString * const KeyPrimaryButton; diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.m b/MVMCoreUI/Utility/MVMCoreUIConstants.m index 2483826f..87a979c0 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.m +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.m @@ -27,6 +27,7 @@ NSString * const KeyFieldKey = @"fieldKey"; NSString * const KeyRequired = @"required"; NSString * const KeyHideMainMenu = @"hideMainMenu"; +NSString * const KeyHideChatSupport = @"hideChatSupport"; NSString * const KeyProgressPercent = @"progressPercent"; NSString * const KeyPrimaryButton = @"PrimaryButton"; From 5537961ddfb9757a0779eb6e6964c4d84e266082 Mon Sep 17 00:00:00 2001 From: Naresh Date: Wed, 28 Feb 2024 10:19:51 +0530 Subject: [PATCH 2/4] UpdatedKeyToHideRightPanel UpdatedKeyToHideRightPanel --- MVMCoreUI/BaseControllers/ViewController.swift | 2 +- MVMCoreUI/Utility/MVMCoreUIConstants.h | 2 +- MVMCoreUI/Utility/MVMCoreUIConstants.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 8eb0737a..ad554901 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -532,7 +532,7 @@ import MVMCore public func isRightPanelAccessible() -> Bool { // TODO: Remove when FAB is 100%. - if loadObject?.pageJSON?.boolForKey(KeyHideChatSupport) ?? false { + if loadObject?.pageJSON?.boolForKey(KeyHideRightPanel) ?? false { return false } return (MVMCoreUISession.sharedGlobal()?.launchAppLoadedSuccessfully ?? false) || showRightPanelForScreenBeforeLaunchApp() diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.h b/MVMCoreUI/Utility/MVMCoreUIConstants.h index f7c3ba0a..020c9e17 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.h +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.h @@ -26,7 +26,7 @@ extern NSString * const KeyEnabled; extern NSString * const KeyFieldName; extern NSString * const KeyHideMainMenu; -extern NSString * const KeyHideChatSupport; +extern NSString * const KeyHideRightPanel; extern NSString * const KeyProgressPercent; extern NSString * const KeyPrimaryButton; diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.m b/MVMCoreUI/Utility/MVMCoreUIConstants.m index 87a979c0..bee0a8b9 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.m +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.m @@ -27,7 +27,7 @@ NSString * const KeyFieldKey = @"fieldKey"; NSString * const KeyRequired = @"required"; NSString * const KeyHideMainMenu = @"hideMainMenu"; -NSString * const KeyHideChatSupport = @"hideChatSupport"; +NSString * const KeyHideRightPanel = @"hideRightPanel"; NSString * const KeyProgressPercent = @"progressPercent"; NSString * const KeyPrimaryButton = @"PrimaryButton"; From a21bf23d441b4ce1e61e26ffee25c2254315709b Mon Sep 17 00:00:00 2001 From: Naresh Date: Wed, 28 Feb 2024 11:25:55 +0530 Subject: [PATCH 3/4] AddedLeftPanelAndRightPanelInBaseTemplateModel AddedLeftPanelAndRightPanelInBaseTemplateModel --- MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift index daa3aed1..5a84078e 100644 --- a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift @@ -32,7 +32,8 @@ import Foundation public var tabBarIndex: Int? public var shouldMaskScreenWhileRecording: Bool? - + public var hideLeftPanel: Bool = false + public var hideRightPanel: Bool = false //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- @@ -56,6 +57,8 @@ import Foundation case tabBarHidden case tabBarIndex case shouldMaskScreenWhileRecording + case hideLeftPanel + case hideRightPanel } //-------------------------------------------------- @@ -79,6 +82,12 @@ import Foundation if let tabBarHidden = try typeContainer.decodeIfPresent(Bool.self, forKey: .tabBarHidden) { self.tabBarHidden = tabBarHidden } + if let hideLeftPanel = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideLeftPanel) { + self.hideLeftPanel = hideLeftPanel + } + if let hideRightPanel = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideRightPanel) { + self.hideRightPanel = hideRightPanel + } tabBarIndex = try typeContainer.decodeIfPresent(Int.self, forKey: .tabBarIndex) shouldMaskScreenWhileRecording = try typeContainer.decodeIfPresent(Bool.self, forKey: .shouldMaskScreenWhileRecording) } @@ -92,6 +101,8 @@ import Foundation try container.encodeIfPresent(formRules, forKey: .formRules) try container.encodeModelIfPresent(navigationBar, forKey: .navigationBar) try container.encode(tabBarHidden, forKey: .tabBarHidden) + try container.encode(hideLeftPanel, forKey: .hideLeftPanel) + try container.encode(hideRightPanel, forKey: .hideRightPanel) try container.encodeIfPresent(tabBarIndex, forKey: .tabBarIndex) try container.encode(shouldMaskScreenWhileRecording, forKey: .shouldMaskScreenWhileRecording) } From 335ca30c6fb1a1a54ce4323fcc4dd37cd8c94900 Mon Sep 17 00:00:00 2001 From: Naresh Date: Thu, 29 Feb 2024 22:36:52 +0530 Subject: [PATCH 4/4] AddedeLeftAndRightPanelKeysToPageModel AddedeLeftAndRightPanelKeysToPageModel --- .../Atomic/Protocols/ModelProtocols/PageModelProtocol.swift | 2 ++ MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift | 4 ++-- MVMCoreUI/BaseControllers/ViewController.swift | 2 +- MVMCoreUI/Utility/MVMCoreUIConstants.h | 1 - MVMCoreUI/Utility/MVMCoreUIConstants.m | 1 - 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift index 122adcee..5e998a53 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift @@ -14,4 +14,6 @@ public protocol PageModelProtocol { var backgroundColor: Color? { get set } var navigationBar: (NavigationItemModelProtocol & MoleculeModelProtocol)? { get set } var shouldMaskScreenWhileRecording: Bool? { get } + var hideLeftPanel: Bool? { get } + var hideRightPanel: Bool? { get } } diff --git a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift index 6c831ac8..b5c4763c 100644 --- a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift @@ -32,8 +32,8 @@ import Foundation public var tabBarIndex: Int? public var shouldMaskScreenWhileRecording: Bool? - public var hideLeftPanel: Bool = false - public var hideRightPanel: Bool = false + public var hideLeftPanel: Bool? + public var hideRightPanel: Bool? public func replaceChildMolecule(with molecule: MoleculeModelProtocol) throws -> Bool { return try replaceChildMolecule(at: &navigationBar, with: molecule) diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 08a84d83..5997847d 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -559,7 +559,7 @@ import MVMCore public func isRightPanelAccessible() -> Bool { // TODO: Remove when FAB is 100%. - if loadObject?.pageJSON?.boolForKey(KeyHideRightPanel) ?? false { + if let hideRightPanel = model?.hideRightPanel, hideRightPanel == true { return false } return (MVMCoreUISession.sharedGlobal()?.launchAppLoadedSuccessfully ?? false) || showRightPanelForScreenBeforeLaunchApp() diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.h b/MVMCoreUI/Utility/MVMCoreUIConstants.h index 020c9e17..ab77986b 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.h +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.h @@ -26,7 +26,6 @@ extern NSString * const KeyEnabled; extern NSString * const KeyFieldName; extern NSString * const KeyHideMainMenu; -extern NSString * const KeyHideRightPanel; extern NSString * const KeyProgressPercent; extern NSString * const KeyPrimaryButton; diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.m b/MVMCoreUI/Utility/MVMCoreUIConstants.m index bee0a8b9..2483826f 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.m +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.m @@ -27,7 +27,6 @@ NSString * const KeyFieldKey = @"fieldKey"; NSString * const KeyRequired = @"required"; NSString * const KeyHideMainMenu = @"hideMainMenu"; -NSString * const KeyHideRightPanel = @"hideRightPanel"; NSString * const KeyProgressPercent = @"progressPercent"; NSString * const KeyPrimaryButton = @"PrimaryButton";