[Security Solution] [Platform] do not display index if a rule has a data view and index defined on it (#137305)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Devin W. Hurley 2022-07-28 10:24:49 -04:00 committed by GitHub
parent a58b705077
commit 2b08fcecbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,6 +164,7 @@ export const addFilterStateIfNotThere = (filters: Filter[]): Filter[] => {
};
/* eslint complexity: ["error", 25]*/
// eslint-disable-next-line complexity
export const getDescriptionItem = (
field: string,
label: string,
@ -247,6 +248,10 @@ export const getDescriptionItem = (
} else if (Array.isArray(get(field, data)) && field !== 'threatMapping') {
const values: string[] = get(field, data);
return buildStringArrayDescription(label, field, values);
} else if (field === 'index') {
if (get('dataViewId', data)) {
return [];
}
}
const description: string = get(field, data);