parsing JSON string for NTData subsections
Summary: Added separate subsections for ntData in objc - json string will be parsed on ios into correct subsections Reviewed By: priteshrnandgaonkar Differential Revision: D12817695 fbshipit-source-id: e1480303e121ceb537c47e6c30d328654ab91b8a
This commit is contained in:
committed by
Facebook Github Bot
parent
2ee2dfacfe
commit
e19489fbcb
@@ -98,8 +98,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(FLIPPER_OSS)
|
#if !defined(FLIPPER_OSS)
|
||||||
- (NSString *) getStackTrace:(CKFlexboxComponentChild)child{
|
- (NSString *) getNTMetaDataForChild:(CKFlexboxComponentChild)child
|
||||||
return [child.component sonar_getName];
|
qualifier:(NSString *) qualifier
|
||||||
|
{
|
||||||
|
NSString *str = @"{\"stackTrace\":{\"Content\":\":nt:flexbox :nt:text :nt:flexbox\"},\"unminifiedData\":{\"Content\":\"text\"}, \"graphQLCalls\":{\"Content\":\"text\"}}";
|
||||||
|
NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
|
id json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
|
||||||
|
if ([qualifier isEqualToString:@"Stack Trace"]) {
|
||||||
|
return [json objectForKey:@"stackTrace"];
|
||||||
|
} else if ([qualifier isEqualToString:@"Unminified Payload"]) {
|
||||||
|
return [json objectForKey:@"unminifiedData"];
|
||||||
|
} else if ([qualifier isEqualToString:@"GraphQL Calls"]) {
|
||||||
|
return [json objectForKey:@"graphQLCalls"];
|
||||||
|
}
|
||||||
|
return @"";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -107,7 +119,11 @@
|
|||||||
return @{
|
return @{
|
||||||
@"spacingBefore": SKObject(@(child.spacingBefore)),
|
@"spacingBefore": SKObject(@(child.spacingBefore)),
|
||||||
#if !defined(FLIPPER_OSS)
|
#if !defined(FLIPPER_OSS)
|
||||||
@"NT Stack Trace": [self getStackTrace:child],
|
@"Native Templates": @{
|
||||||
|
@"Stack Trace": [self getNTMetaDataForChild:child qualifier:@"Stack Trace"],
|
||||||
|
@"Unminified Payload":[self getNTMetaDataForChild:child qualifier:@"Unminified Payload"],
|
||||||
|
@"GraphQL Calls":[self getNTMetaDataForChild:child qualifier:@"GraphQL Calls"],
|
||||||
|
},
|
||||||
#endif
|
#endif
|
||||||
@"spacingAfter": SKObject(@(child.spacingAfter)),
|
@"spacingAfter": SKObject(@(child.spacingAfter)),
|
||||||
@"flexGrow": SKObject(@(child.flexGrow)),
|
@"flexGrow": SKObject(@(child.flexGrow)),
|
||||||
|
|||||||
Reference in New Issue
Block a user