Modernization migrations and json passing
This commit is contained in:
parent
768aa578d2
commit
9ea9894e80
@ -17,7 +17,6 @@
|
|||||||
@import MVMCore.NSDictionary_MFConvenience;
|
@import MVMCore.NSDictionary_MFConvenience;
|
||||||
@import MVMCore.MVMCoreHardcodedStringsConstants;
|
@import MVMCore.MVMCoreHardcodedStringsConstants;
|
||||||
@import MVMCore.MVMCoreJSONConstants;
|
@import MVMCore.MVMCoreJSONConstants;
|
||||||
@import MVMCore.MVMCoreActionHandler;
|
|
||||||
@import MVMCore.Swift;
|
@import MVMCore.Swift;
|
||||||
#import <MVMCoreUI/MVMCoreUI-Swift.h>
|
#import <MVMCoreUI/MVMCoreUI-Swift.h>
|
||||||
|
|
||||||
@ -162,7 +161,7 @@
|
|||||||
NSMutableArray <UIAlertAction *> *actionsForAlert = [NSMutableArray array];
|
NSMutableArray <UIAlertAction *> *actionsForAlert = [NSMutableArray array];
|
||||||
for (NSDictionary *actionMap in actions) {
|
for (NSDictionary *actionMap in actions) {
|
||||||
[actionsForAlert addObject:[UIAlertAction actionWithTitle:[actionMap stringForKey:KeyTitle] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
[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;
|
alert.actions = actionsForAlert;
|
||||||
|
|||||||
@ -15,12 +15,13 @@ open class ActionAlertHandler: MVMCoreActionHandlerProtocol {
|
|||||||
|
|
||||||
open func performAction(_ model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws {
|
open func performAction(_ model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws {
|
||||||
guard let model = model as? ActionAlertModel else { return }
|
guard let model = model as? ActionAlertModel else { return }
|
||||||
let json = try MVMCoreActionHandler.convertActionToJSON(model)
|
try await MVMCoreActionHandler.getOriginalJSON(with: model, additionalData: additionalData) { json, additionalData in
|
||||||
var error: MVMCoreErrorObject? = nil
|
var error: MVMCoreErrorObject? = nil
|
||||||
guard let alertObject = MVMCoreAlertObject.alertObjectWith(action: json, additionalData: additionalData, delegateObject: delegateObject, error: &error) else {
|
guard let alertObject = MVMCoreAlertObject.alertObjectWith(action: json, additionalData: additionalData, delegateObject: delegateObject, error: &error) else {
|
||||||
throw MVMCoreError.errorObject(error!)
|
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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,11 +15,15 @@ open class ActionOpenPanelHandler: MVMCoreActionHandlerProtocol {
|
|||||||
|
|
||||||
open func performAction(_ model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws {
|
open func performAction(_ model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws {
|
||||||
guard let model = model as? ActionOpenPanelModel else { return }
|
guard let model = model as? ActionOpenPanelModel else { return }
|
||||||
switch model.panel {
|
try await MVMCoreActionHandler.getOriginalJSON(with: model, additionalData: additionalData) { json, additionalData in
|
||||||
case .left, .menu:
|
switch model.panel {
|
||||||
await MVMCoreUISplitViewController.main()?.showLeftPanel(animated: true)
|
case .left, .menu:
|
||||||
case .right, .support:
|
await MVMCoreUISplitViewController.main()?.leftPanel?.willOpen?(withActionInformation: json, additionalData: additionalData)
|
||||||
await MVMCoreUISplitViewController.main()?.showRightPanel(animated: true)
|
await MVMCoreUISplitViewController.main()?.showLeftPanel(animated: true)
|
||||||
|
case .right, .support:
|
||||||
|
await MVMCoreUISplitViewController.main()?.rightPanel?.willOpen?(withActionInformation: json, additionalData: additionalData)
|
||||||
|
await MVMCoreUISplitViewController.main()?.showRightPanel(animated: true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ open class ActionTopAlertHandler: MVMCoreActionHandlerProtocol {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let alertObject = MVMCoreAlertObject(forPageType: model.pageType, responseInfo: responseInfo, additionalData: additionalData, delegateObject: delegateObject)!
|
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)
|
MVMCoreAlertHandler.shared()?.showAlert(with: alertObject)
|
||||||
continuation.resume()
|
continuation.resume()
|
||||||
})
|
})
|
||||||
|
|||||||
@ -21,7 +21,6 @@ FOUNDATION_EXPORT const unsigned char MVMCoreUIVersionString[];
|
|||||||
#import <MVMCoreUI/MVMCoreUIViewControllerMappingObject.h>
|
#import <MVMCoreUI/MVMCoreUIViewControllerMappingObject.h>
|
||||||
#import <MVMCoreUI/MVMCoreUIViewConstrainingProtocol.h>
|
#import <MVMCoreUI/MVMCoreUIViewConstrainingProtocol.h>
|
||||||
#import <MVMCoreUI/MVMCoreUIActionDelegateProtocol.h>
|
#import <MVMCoreUI/MVMCoreUIActionDelegateProtocol.h>
|
||||||
#import <MVMCoreUI/MVMCoreUIActionHandler.h>
|
|
||||||
|
|
||||||
// Alert Handling
|
// Alert Handling
|
||||||
#import <MVMCoreUI/MVMCoreAlertObject.h>
|
#import <MVMCoreUI/MVMCoreAlertObject.h>
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MVMCoreUITopAlertBaseView.h"
|
#import "MVMCoreUITopAlertBaseView.h"
|
||||||
@import MVMCore.MVMCoreActionHandler;
|
|
||||||
#import "MVMCoreUISplitViewController.h"
|
#import "MVMCoreUISplitViewController.h"
|
||||||
@import MVMCore.MVMCoreLoadObject;
|
@import MVMCore.MVMCoreLoadObject;
|
||||||
@import MVMCore.MVMCoreRequestParameters;
|
@import MVMCore.MVMCoreRequestParameters;
|
||||||
@ -33,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (performAction) {
|
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]];
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,6 @@
|
|||||||
@import MVMCore.MVMCoreNavigationHandler;
|
@import MVMCore.MVMCoreNavigationHandler;
|
||||||
@import MVMCore.MVMCoreBlockOperation;
|
@import MVMCore.MVMCoreBlockOperation;
|
||||||
#import <MVMCoreUI/MVMCoreAlertObject.h>
|
#import <MVMCoreUI/MVMCoreAlertObject.h>
|
||||||
@import MVMCore.MVMCoreActionHandler;
|
|
||||||
#import <MVMCoreUI/MVMCoreAlertHandler.h>
|
#import <MVMCoreUI/MVMCoreAlertHandler.h>
|
||||||
@import MVMCore.NSDictionary_MFConvenience;
|
@import MVMCore.NSDictionary_MFConvenience;
|
||||||
@import MVMCore.MVMCoreRequestParameters;
|
@import MVMCore.MVMCoreRequestParameters;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user