Extra data send from iOS to Flipper Desktop
Summary: Added `extraInfo` for node descriptor for ios. Analogical to android node descriptor Reviewed By: cuva, Andrey-Mishanin Differential Revision: D23105947 fbshipit-source-id: f21541e97d79c0009815f94e733a056320324459
This commit is contained in:
committed by
Facebook GitHub Bot
parent
939ed27aad
commit
41f1a0b454
@@ -484,6 +484,7 @@
|
||||
|
||||
NSMutableArray* attributes = [NSMutableArray new];
|
||||
NSMutableDictionary* data = [NSMutableDictionary new];
|
||||
NSMutableDictionary* extraInfo = [NSMutableDictionary new];
|
||||
|
||||
const auto* nodeAttributes = [nodeDescriptor attributesForNode:node];
|
||||
for (const SKNamed<NSString*>* namedPair in nodeAttributes) {
|
||||
@@ -502,6 +503,11 @@
|
||||
data[namedPair.name] = namedPair.value;
|
||||
}
|
||||
|
||||
const auto* nodeExtraInfo = [nodeDescriptor extraInfoForNode:node];
|
||||
for (const SKNamed<NSDictionary*>* namedPair in nodeExtraInfo) {
|
||||
extraInfo[namedPair.name] = namedPair.value;
|
||||
}
|
||||
|
||||
NSMutableArray* children = [self getChildrenForNode:node
|
||||
withDescriptor:nodeDescriptor];
|
||||
|
||||
@@ -514,6 +520,7 @@
|
||||
@"attributes" : attributes,
|
||||
@"data" : data,
|
||||
@"decoration" : [nodeDescriptor decorationForNode:node] ?: @"(unknown)",
|
||||
@"extraInfo" : extraInfo,
|
||||
};
|
||||
|
||||
return nodeDic;
|
||||
|
||||
@@ -77,6 +77,12 @@ typedef void (^SKNodeUpdateData)(id value);
|
||||
*/
|
||||
- (NSArray<SKNamed<NSDictionary*>*>*)dataForNode:(T)node;
|
||||
|
||||
/**
|
||||
Get the extra info to pass it back to Sonar application without showing them in
|
||||
the sidebar.
|
||||
*/
|
||||
- (NSArray<SKNamed<NSDictionary*>*>*)extraInfoForNode:(T)node;
|
||||
|
||||
/**
|
||||
Get the attributes for this node. Attributes will be showed in the Sonar
|
||||
application right next to the name of the node.
|
||||
|
||||
@@ -59,6 +59,10 @@
|
||||
return @[];
|
||||
}
|
||||
|
||||
- (NSArray<SKNamed<NSDictionary*>*>*)extraInfoForNode:(id)node {
|
||||
return @[];
|
||||
}
|
||||
|
||||
- (NSArray<SKNamed<NSString*>*>*)attributesForNode:(id)node {
|
||||
return @[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user