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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 2b08fcecbb)

Co-authored-by: Devin W. Hurley <devin.hurley@elastic.co>
This commit is contained in:
Kibana Machine 2022-07-28 14:10:55 -04:00 committed by GitHub
parent 2feeda13f1
commit 751c1e0cba
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);