diff --git a/MVMCoreUI/Alerts/MVMCoreAlertObject.m b/MVMCoreUI/Alerts/MVMCoreAlertObject.m index 4dfa560c..b99a5870 100644 --- a/MVMCoreUI/Alerts/MVMCoreAlertObject.m +++ b/MVMCoreUI/Alerts/MVMCoreAlertObject.m @@ -17,7 +17,6 @@ @import MVMCore.NSDictionary_MFConvenience; @import MVMCore.MVMCoreHardcodedStringsConstants; @import MVMCore.MVMCoreJSONConstants; -@import MVMCore.MVMCoreActionHandler; @import MVMCore.Swift; #import @@ -162,7 +161,7 @@ NSMutableArray *actionsForAlert = [NSMutableArray array]; for (NSDictionary *actionMap in actions) { [actionsForAlert addObject:[UIAlertAction actionWithTitle:[actionMap stringForKey:KeyTitle] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - [[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:actionMap additionalData:additionalData delegateObject:delegateObject]; + [[MVMCoreUIActionHandler sharedActionHandler] handleActionWithDictionary:actionMap additionalData:additionalData delegateObject:delegateObject]; }]]; } alert.actions = actionsForAlert; diff --git a/MVMCoreUI/Atomic/Actions/ActionAlertHandler.swift b/MVMCoreUI/Atomic/Actions/ActionAlertHandler.swift index f3996ab1..aa3ccc67 100644 --- a/MVMCoreUI/Atomic/Actions/ActionAlertHandler.swift +++ b/MVMCoreUI/Atomic/Actions/ActionAlertHandler.swift @@ -15,12 +15,13 @@ open class ActionAlertHandler: MVMCoreActionHandlerProtocol { open func performAction(_ model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws { guard let model = model as? ActionAlertModel else { return } - let json = try MVMCoreActionHandler.convertActionToJSON(model) - var error: MVMCoreErrorObject? = nil - guard let alertObject = MVMCoreAlertObject.alertObjectWith(action: json, additionalData: additionalData, delegateObject: delegateObject, error: &error) else { - throw MVMCoreError.errorObject(error!) + try await MVMCoreActionHandler.getOriginalJSON(with: model, additionalData: additionalData) { json, additionalData in + var error: MVMCoreErrorObject? = nil + guard let alertObject = MVMCoreAlertObject.alertObjectWith(action: json, additionalData: additionalData, delegateObject: delegateObject, error: &error) else { + throw MVMCoreError.errorObject(error!) + } + (delegateObject?.actionDelegate as? MVMCoreUIActionDelegateProtocol)?.willShowPopup(with: alertObject, alertJson: json) + MVMCoreAlertHandler.shared()?.showAlert(with: alertObject) } - (delegateObject?.actionDelegate as? MVMCoreUIActionDelegateProtocol)?.willShowPopup(with: alertObject, alertJson: json) - MVMCoreAlertHandler.shared()?.showAlert(with: alertObject) } } diff --git a/MVMCoreUI/Atomic/Actions/ActionOpenPanelHandler.swift b/MVMCoreUI/Atomic/Actions/ActionOpenPanelHandler.swift index 5493f128..87060a4b 100644 --- a/MVMCoreUI/Atomic/Actions/ActionOpenPanelHandler.swift +++ b/MVMCoreUI/Atomic/Actions/ActionOpenPanelHandler.swift @@ -15,11 +15,15 @@ open class ActionOpenPanelHandler: MVMCoreActionHandlerProtocol { open func performAction(_ model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws { guard let model = model as? ActionOpenPanelModel else { return } - switch model.panel { - case .left, .menu: - await MVMCoreUISplitViewController.main()?.showLeftPanel(animated: true) - case .right, .support: - await MVMCoreUISplitViewController.main()?.showRightPanel(animated: true) + try await MVMCoreActionHandler.getOriginalJSON(with: model, additionalData: additionalData) { json, additionalData in + switch model.panel { + case .left, .menu: + await MVMCoreUISplitViewController.main()?.leftPanel?.willOpen?(withActionInformation: json, additionalData: additionalData) + await MVMCoreUISplitViewController.main()?.showLeftPanel(animated: true) + case .right, .support: + await MVMCoreUISplitViewController.main()?.rightPanel?.willOpen?(withActionInformation: json, additionalData: additionalData) + await MVMCoreUISplitViewController.main()?.showRightPanel(animated: true) + } } } } diff --git a/MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift b/MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift index 83a58273..54302237 100644 --- a/MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift +++ b/MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift @@ -22,7 +22,7 @@ open class ActionTopAlertHandler: MVMCoreActionHandlerProtocol { return } let alertObject = MVMCoreAlertObject(forPageType: model.pageType, responseInfo: responseInfo, additionalData: additionalData, delegateObject: delegateObject)! - (delegateObject?.actionDelegate as? MVMCoreUIActionDelegateProtocol)?.willShowPopup(with: alertObject, alertJson: json!) + (delegateObject?.actionDelegate as? MVMCoreUIActionDelegateProtocol)?.willShowTopAlert(with: alertObject, alertJson: json!) MVMCoreAlertHandler.shared()?.showAlert(with: alertObject) continuation.resume() }) diff --git a/MVMCoreUI/MVMCoreUI.h b/MVMCoreUI/MVMCoreUI.h index ce663709..37083fd0 100644 --- a/MVMCoreUI/MVMCoreUI.h +++ b/MVMCoreUI/MVMCoreUI.h @@ -21,7 +21,6 @@ FOUNDATION_EXPORT const unsigned char MVMCoreUIVersionString[]; #import #import #import -#import // Alert Handling #import diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertBaseView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertBaseView.m index 174b1bfb..19570ca2 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertBaseView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertBaseView.m @@ -7,7 +7,6 @@ // #import "MVMCoreUITopAlertBaseView.h" -@import MVMCore.MVMCoreActionHandler; #import "MVMCoreUISplitViewController.h" @import MVMCore.MVMCoreLoadObject; @import MVMCore.MVMCoreRequestParameters; @@ -33,7 +32,7 @@ } if (performAction) { - [[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:actionMap additionalData:additionalData delegateObject:[MVMCoreUIDelegateObject createWithDelegateForAll:[MVMCoreUISession sharedGlobal].topAlertView]]; + [[MVMCoreUIActionHandler sharedActionHandler] handleActionWithDictionary:actionMap additionalData:additionalData delegateObject:[MVMCoreUIDelegateObject createWithDelegateForAll:[MVMCoreUISession sharedGlobal].topAlertView]]; } }]; } diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m index c0835541..108d7a84 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m @@ -22,7 +22,6 @@ @import MVMCore.MVMCoreNavigationHandler; @import MVMCore.MVMCoreBlockOperation; #import -@import MVMCore.MVMCoreActionHandler; #import @import MVMCore.NSDictionary_MFConvenience; @import MVMCore.MVMCoreRequestParameters;