diff --git a/package.json b/package.json
index 05da90baf7a71..a669c4a64e846 100644
--- a/package.json
+++ b/package.json
@@ -71,11 +71,11 @@
"**/cross-fetch/node-fetch": "^2.6.1",
"**/deepmerge": "^4.2.2",
"**/fast-deep-equal": "^3.1.1",
- "**/graphql-toolkit/lodash": "^4.17.15",
+ "**/graphql-toolkit/lodash": "^4.17.21",
"**/hoist-non-react-statics": "^3.3.2",
"**/isomorphic-fetch/node-fetch": "^2.6.1",
"**/istanbul-instrumenter-loader/schema-utils": "1.0.0",
- "**/load-grunt-config/lodash": "^4.17.20",
+ "**/load-grunt-config/lodash": "^4.17.21",
"**/minimist": "^1.2.5",
"**/node-jose/node-forge": "^0.10.0",
"**/prismjs": "1.22.0",
@@ -231,7 +231,7 @@
"json-stringify-safe": "5.0.1",
"jsonwebtoken": "^8.5.1",
"load-json-file": "^6.2.0",
- "lodash": "^4.17.20",
+ "lodash": "^4.17.21",
"lru-cache": "^4.1.5",
"markdown-it": "^10.0.0",
"md5": "^2.1.0",
diff --git a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.test.ts b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.test.ts
index fc26c837d5e52..267d671361184 100644
--- a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.test.ts
+++ b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.test.ts
@@ -96,8 +96,7 @@ describe('getSearchDsl', () => {
mappings,
opts.type,
opts.sortField,
- opts.sortOrder,
- opts.pit
+ opts.sortOrder
);
});
diff --git a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts
index cae5e43897bcf..9820544f02bd1 100644
--- a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts
+++ b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts
@@ -78,7 +78,7 @@ export function getSearchDsl(
hasReferenceOperator,
kueryNode,
}),
- ...getSortingParams(mappings, type, sortField, sortOrder, pit),
+ ...getSortingParams(mappings, type, sortField, sortOrder),
...(pit ? getPitParams(pit) : {}),
...(searchAfter ? { search_after: searchAfter } : {}),
};
diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts
index 73c7065705fc5..1376f0d50a9da 100644
--- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts
+++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts
@@ -79,11 +79,6 @@ describe('searchDsl/getSortParams', () => {
],
});
});
- it('appends tiebreaker when PIT is provided', () => {
- expect(getSortingParams(MAPPINGS, 'saved', 'title', undefined, { id: 'abc' }).sort).toEqual(
- expect.arrayContaining([{ _shard_doc: 'asc' }])
- );
- });
});
describe('sortField is simple root property with multiple types', () => {
it('returns correct params', () => {
@@ -98,11 +93,6 @@ describe('searchDsl/getSortParams', () => {
],
});
});
- it('appends tiebreaker when PIT is provided', () => {
- expect(
- getSortingParams(MAPPINGS, ['saved', 'pending'], 'type', undefined, { id: 'abc' }).sort
- ).toEqual(expect.arrayContaining([{ _shard_doc: 'asc' }]));
- });
});
describe('sortField is simple non-root property with multiple types', () => {
it('returns correct params', () => {
@@ -124,11 +114,6 @@ describe('searchDsl/getSortParams', () => {
],
});
});
- it('appends tiebreaker when PIT is provided', () => {
- expect(
- getSortingParams(MAPPINGS, 'saved', 'title.raw', undefined, { id: 'abc' }).sort
- ).toEqual(expect.arrayContaining([{ _shard_doc: 'asc' }]));
- });
});
describe('sortField is multi-field with single type as array', () => {
it('returns correct params', () => {
@@ -143,11 +128,6 @@ describe('searchDsl/getSortParams', () => {
],
});
});
- it('appends tiebreaker when PIT is provided', () => {
- expect(
- getSortingParams(MAPPINGS, ['saved'], 'title.raw', undefined, { id: 'abc' }).sort
- ).toEqual(expect.arrayContaining([{ _shard_doc: 'asc' }]));
- });
});
describe('sortField is root multi-field with multiple types', () => {
it('returns correct params', () => {
@@ -162,12 +142,6 @@ describe('searchDsl/getSortParams', () => {
],
});
});
- it('appends tiebreaker when PIT is provided', () => {
- expect(
- getSortingParams(MAPPINGS, ['saved', 'pending'], 'type.raw', undefined, { id: 'abc' })
- .sort
- ).toEqual(expect.arrayContaining([{ _shard_doc: 'asc' }]));
- });
});
describe('sortField is not-root multi-field with multiple types', () => {
it('returns correct params', () => {
diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts
index abef9bfa0a300..e3bfba6a80f59 100644
--- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts
+++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts
@@ -8,12 +8,6 @@
import Boom from '@hapi/boom';
import { getProperty, IndexMapping } from '../../../mappings';
-import { SavedObjectsPitParams } from '../../../types';
-
-// TODO: The plan is for ES to automatically add this tiebreaker when
-// using PIT. We should remove this logic once that is resolved.
-// https://github.com/elastic/elasticsearch/issues/56828
-const ES_PROVIDED_TIEBREAKER = { _shard_doc: 'asc' };
const TOP_LEVEL_FIELDS = ['_id', '_score'];
@@ -21,8 +15,7 @@ export function getSortingParams(
mappings: IndexMapping,
type: string | string[],
sortField?: string,
- sortOrder?: string,
- pit?: SavedObjectsPitParams
+ sortOrder?: string
) {
if (!sortField) {
return {};
@@ -38,7 +31,6 @@ export function getSortingParams(
order: sortOrder,
},
},
- ...(pit ? [ES_PROVIDED_TIEBREAKER] : []),
],
};
}
@@ -59,7 +51,6 @@ export function getSortingParams(
unmapped_type: rootField.type,
},
},
- ...(pit ? [ES_PROVIDED_TIEBREAKER] : []),
],
};
}
@@ -84,7 +75,6 @@ export function getSortingParams(
unmapped_type: field.type,
},
},
- ...(pit ? [ES_PROVIDED_TIEBREAKER] : []),
],
};
}
diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts
index 5517011f05718..8c7e48f173031 100644
--- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts
+++ b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts
@@ -59,6 +59,7 @@ export function isFieldFiltered(
const scriptedOrMissing =
!filterState.missing ||
field.type === '_source' ||
+ field.type === 'unknown_selected' ||
field.scripted ||
fieldCounts[field.name] > 0;
const needle = filterState.name ? filterState.name.toLowerCase() : '';
diff --git a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts b/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts
index 9792e98ba84c7..68099fb0c8e2a 100644
--- a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts
+++ b/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts
@@ -217,6 +217,20 @@ describe('group_fields', function () {
]);
});
+ it('should filter fields by a given name', function () {
+ const fieldFilterState = { ...getDefaultFieldFilter(), ...{ name: 'curr' } };
+
+ const actual1 = groupFields(
+ fields as IndexPatternField[],
+ ['customer_birth_date', 'currency', 'unknown'],
+ 5,
+ fieldCounts,
+ fieldFilterState,
+ false
+ );
+ expect(actual1.selected.map((field) => field.name)).toEqual(['currency']);
+ });
+
it('excludes unmapped fields if showUnmappedFields set to false', function () {
const fieldFilterState = getDefaultFieldFilter();
const fieldsWithUnmappedField = [...fields];
diff --git a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.tsx b/src/plugins/discover/public/application/components/sidebar/lib/group_fields.tsx
index eefb96b78aac6..dc6cbcedc8086 100644
--- a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.tsx
+++ b/src/plugins/discover/public/application/components/sidebar/lib/group_fields.tsx
@@ -71,10 +71,18 @@ export function groupFields(
}
}
}
- // add columns, that are not part of the index pattern, to be removeable
+ // add selected columns, that are not part of the index pattern, to be removeable
for (const column of columns) {
- if (!result.selected.find((field) => field.name === column)) {
- result.selected.push({ name: column, displayName: column } as IndexPatternField);
+ const tmpField = {
+ name: column,
+ displayName: column,
+ type: 'unknown_selected',
+ } as IndexPatternField;
+ if (
+ !result.selected.find((field) => field.name === column) &&
+ isFieldFiltered(tmpField, fieldFilterState, fieldCounts)
+ ) {
+ result.selected.push(tmpField);
}
}
result.selected.sort((a, b) => {
diff --git a/src/plugins/embeddable/README.asciidoc b/src/plugins/embeddable/README.asciidoc
index daa6040eab7eb..007b16587e9f8 100644
--- a/src/plugins/embeddable/README.asciidoc
+++ b/src/plugins/embeddable/README.asciidoc
@@ -22,18 +22,17 @@ There is also an example of rendering dashboard container outside of dashboard a
=== Docs
-link:./docs/README.md[Embeddable docs, guides & caveats]
+link:https://github.com/elastic/kibana/blob/master/src/plugins/embeddable/docs/README.md[Embeddable docs, guides & caveats]
=== API docs
-==== Server API
-https://github.com/elastic/kibana/blob/master/docs/development/plugins/embeddable/server/kibana-plugin-plugins-embeddable-server.embeddablesetup.md[Server Setup contract]
-https://github.com/elastic/kibana/blob/master/docs/development/plugins/embeddable/server/kibana-plugin-plugins-embeddable-server.embeddablestart.md[Server Start contract]
-
===== Browser API
https://github.com/elastic/kibana/blob/master/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.embeddablesetup.md[Browser Setup contract]
https://github.com/elastic/kibana/blob/master/docs/development/plugins/embeddable/public/kibana-plugin-plugins-embeddable-public.embeddablestart.md[Browser Start contract]
+==== Server API
+https://github.com/elastic/kibana/blob/master/docs/development/plugins/embeddable/server/kibana-plugin-plugins-embeddable-server.embeddablesetup.md[Server Setup contract]
+
=== Testing
Run unit tests
diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts
index b234b026a513e..7fe5c6f50d046 100644
--- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts
+++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts
@@ -477,6 +477,29 @@ describe('
+ {localState.configurationValidationError[0].longMessage} +
+ + {showExtraErrors} + > + } + iconColor="danger" + iconType="alert" + />
+
{localState.expressionBuildError[0].longMessage}
+ > + } + iconColor="danger" + iconType="alert" />
+
visibleErrorMessage
+ ) : null} + > + } + iconColor="danger" + iconType="alert" />