Change framework event seperator to .
Summary: Its easier this way since this is how they come out of android internally, also a bit nicer to display the full string this way Reviewed By: lblasa Differential Revision: D48346954 fbshipit-source-id: 997dd3922159683fcdf4b5f5f288702a5d998dc4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7b6aff245a
commit
3cd6079c24
@@ -78,6 +78,7 @@ function getAllLeaves(treeSelectNode: TreeSelectNode) {
|
||||
return result;
|
||||
}
|
||||
|
||||
export const frameworkEventSeparator = '.';
|
||||
/**
|
||||
* transformed flat event type data structure into tree
|
||||
*/
|
||||
@@ -85,7 +86,7 @@ export function buildTreeSelectData(eventTypes: string[]): TreeSelectNode[] {
|
||||
const root: TreeSelectNode = buildTreeSelectNode('root', 'root');
|
||||
|
||||
eventTypes.forEach((eventType) => {
|
||||
const eventSubtypes = eventType.split(':');
|
||||
const eventSubtypes = eventType.split(frameworkEventSeparator);
|
||||
let currentNode = root;
|
||||
|
||||
// Find the parent node for the current id
|
||||
@@ -101,7 +102,7 @@ export function buildTreeSelectData(eventTypes: string[]): TreeSelectNode[] {
|
||||
if (!foundChild) {
|
||||
const newNode: TreeSelectNode = buildTreeSelectNode(
|
||||
eventSubtypes[i],
|
||||
eventSubtypes.slice(0, i + 1).join(':'),
|
||||
eventSubtypes.slice(0, i + 1).join(frameworkEventSeparator),
|
||||
);
|
||||
|
||||
currentNode.children.push(newNode);
|
||||
@@ -112,7 +113,9 @@ export function buildTreeSelectData(eventTypes: string[]): TreeSelectNode[] {
|
||||
currentNode.children.push(
|
||||
buildTreeSelectNode(
|
||||
eventSubtypes[eventSubtypes.length - 1],
|
||||
eventSubtypes.slice(0, eventSubtypes.length).join(':'),
|
||||
eventSubtypes
|
||||
.slice(0, eventSubtypes.length)
|
||||
.join(frameworkEventSeparator),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user