part 2 of filter/sort drill down from charts (#16013)
in this PR, we will handle simple filter translations (ie, fields that use the contains operand)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export const splitFieldNameIntoBaseAndSubField = (
|
||||
fieldName: string,
|
||||
): {
|
||||
baseFieldName: string;
|
||||
subFieldName?: string;
|
||||
} => {
|
||||
const fieldParts = fieldName.split('.');
|
||||
const baseFieldName = fieldParts[0];
|
||||
const subFieldName =
|
||||
fieldParts.length > 1 ? fieldParts.slice(1).join('.') : undefined;
|
||||
|
||||
return {
|
||||
baseFieldName,
|
||||
subFieldName,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user