Skip to content

Commit af1135f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into kbn-81847-tag-usage-collector
2 parents 59716f8 + b44a0e5 commit af1135f

170 files changed

Lines changed: 4210 additions & 1318 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/src/plugins/vis_type_vislib/ @elastic/kibana-app
2727
/src/plugins/vis_type_xy/ @elastic/kibana-app
2828
/src/plugins/visualize/ @elastic/kibana-app
29-
/src/plugins/visualizations/ @elastic/kibana-application
29+
/src/plugins/visualizations/ @elastic/kibana-app
3030

3131
# Application Services
3232
/examples/bfetch_explorer/ @elastic/kibana-app-arch
@@ -123,8 +123,8 @@
123123
# ML team owns and maintains the transform plugin despite it living in the Elasticsearch management section.
124124
/x-pack/plugins/transform/ @elastic/ml-ui
125125
/x-pack/test/functional/apps/transform/ @elastic/ml-ui
126-
/x-pack/test/functional/services/transform/ @elastic/ml-ui/
127-
x-pack/test/api_integration_basic/apis/ml/ @elastic/ml-ui
126+
/x-pack/test/functional/services/transform/ @elastic/ml-ui
127+
/x-pack/test/api_integration_basic/apis/ml/ @elastic/ml-ui
128128
/x-pack/test/functional_basic/apps/ml/ @elastic/ml-ui
129129

130130
/x-pack/test/api_integration_basic/apis/transform/ @elastic/ml-ui
@@ -261,6 +261,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
261261
# Elasticsearch UI
262262
/src/plugins/dev_tools/ @elastic/es-ui
263263
/src/plugins/console/ @elastic/es-ui
264+
/src/plugins/es_ui_shared/ @elastic/es-ui
264265
/x-pack/plugins/cross_cluster_replication/ @elastic/es-ui
265266
/x-pack/plugins/index_lifecycle_management/ @elastic/es-ui
266267
/x-pack/plugins/console_extensions/ @elastic/es-ui

docs/maps/import-geospatial-data.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Choose an import tool based on the format of your geospatial data.
2626

2727
*Upload GeoJSON* indexes GeoJSON features as a geo_point or geo_shape.
2828

29-
. <<maps-create>>.
29+
. <<maps-create, Create a new map>>.
3030
. Click *Add layer*.
3131
. Select *Upload GeoJSON*.
3232
. Use the file chooser to select a GeoJSON file.

docs/user/dashboard/url-drilldown.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
beta[]
55

6-
The URL template input uses https://handlebarsjs.com/guide/expressions.html#expressions[Handlebars] — a simple templating language. Handlebars templates look like regular text with embedded Handlebars expressions.
6+
The URL template input uses https://ela.st/handlebars-docs#expressions[Handlebars] — a simple templating language. Handlebars templates look like regular text with embedded Handlebars expressions.
77

88
[source, bash]
99
----
@@ -13,7 +13,7 @@ https://github.com/elastic/kibana/issues?q={{event.value}}
1313
A Handlebars expression is a `{{`, some contents, followed by a `}}`. When the drilldown is executed, these expressions are replaced by values from the dashboard and interaction context.
1414

1515
[[helpers]]
16-
In addition to https://handlebarsjs.com/guide/builtin-helpers.html[built-in] Handlebars helpers, you can use custom helpers.
16+
In addition to https://ela.st/handlebars-helpers[built-in] Handlebars helpers, you can use custom helpers.
1717

1818
Refer to Handlebars https://ela.st/handlebars-docs#expressions[documentation] to learn about advanced use cases.
1919

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@
577577
"angular-recursion": "^1.0.5",
578578
"angular-route": "^1.8.0",
579579
"angular-sortable-view": "^0.0.17",
580-
"apidoc": "^0.20.1",
581-
"apidoc-markdown": "^5.0.0",
580+
"apidoc": "^0.25.0",
581+
"apidoc-markdown": "^5.1.8",
582582
"apollo-link": "^1.2.3",
583583
"apollo-link-error": "^1.1.7",
584584
"apollo-link-state": "^0.4.1",

packages/kbn-dev-utils/src/kbn_client/kbn_client_ui_settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export class KbnClientUiSettings {
102102
body: {
103103
changes: updates,
104104
},
105+
retries: 3,
105106
});
106107
}
107108

src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/utils/default_app_categories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const DEFAULT_APP_CATEGORIES: Record<string, AppCategory> = Object.freeze
2525
kibana: {
2626
id: 'kibana',
2727
label: i18n.translate('core.ui.kibanaNavList.label', {
28-
defaultMessage: 'Kibana',
28+
defaultMessage: 'Analytics',
2929
}),
3030
euiIconType: 'logoKibana',
3131
order: 1000,

src/dev/typescript/run_check_ts_projects_cli.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
import { resolve } from 'path';
20+
import { resolve, relative } from 'path';
2121

2222
import execa from 'execa';
2323

@@ -35,7 +35,7 @@ export async function runCheckTsProjectsCli() {
3535
});
3636

3737
const isNotInTsProject: File[] = [];
38-
const isInMultipleTsProjects: File[] = [];
38+
const isInMultipleTsProjects: string[] = [];
3939

4040
for (const lineRaw of files.split('\n')) {
4141
const line = lineRaw.trim();
@@ -56,7 +56,11 @@ export async function runCheckTsProjectsCli() {
5656
isNotInTsProject.push(file);
5757
}
5858
if (projects.length > 1 && !file.isTypescriptAmbient()) {
59-
isInMultipleTsProjects.push(file);
59+
isInMultipleTsProjects.push(
60+
` - ${file.getRelativePath()}:\n${projects
61+
.map((p) => ` - ${relative(process.cwd(), p.tsConfigPath)}`)
62+
.join('\n')}`
63+
);
6064
}
6165
}
6266

@@ -74,10 +78,9 @@ export async function runCheckTsProjectsCli() {
7478
}
7579

7680
if (isInMultipleTsProjects.length) {
81+
const details = isInMultipleTsProjects.join('\n');
7782
log.error(
78-
`The following files belong to multiple tsconfig.json files listed in src/dev/typescript/projects.ts\n${isInMultipleTsProjects
79-
.map((file) => ` - ${file.getRelativePath()}`)
80-
.join('\n')}`
83+
`The following files belong to multiple tsconfig.json files listed in src/dev/typescript/projects.ts\n${details}`
8184
);
8285
}
8386

src/plugins/discover/public/application/angular/discover.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ import {
8383
MODIFY_COLUMNS_ON_SWITCH,
8484
} from '../../../common';
8585
import { METRIC_TYPE } from '@kbn/analytics';
86+
import { SEARCH_SESSION_ID_QUERY_PARAM } from '../../url_generator';
87+
import { removeQueryParam, getQueryParams } from '../../../../kibana_utils/public';
8688

8789
const fetchStatuses = {
8890
UNINITIALIZED: 'uninitialized',
@@ -91,6 +93,9 @@ const fetchStatuses = {
9193
ERROR: 'error',
9294
};
9395

96+
const getSearchSessionIdFromURL = (history) =>
97+
getQueryParams(history.location)[SEARCH_SESSION_ID_QUERY_PARAM];
98+
9499
const app = getAngularModule();
95100

96101
app.config(($routeProvider) => {
@@ -208,6 +213,8 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise
208213
};
209214

210215
const history = getHistory();
216+
// used for restoring background session
217+
let isInitialSearch = true;
211218

212219
const {
213220
appStateContainer,
@@ -798,17 +805,30 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise
798805
if (abortController) abortController.abort();
799806
abortController = new AbortController();
800807

801-
const sessionId = data.search.session.start();
808+
const searchSessionId = (() => {
809+
const searchSessionIdFromURL = getSearchSessionIdFromURL(history);
810+
if (searchSessionIdFromURL) {
811+
if (isInitialSearch) {
812+
data.search.session.restore(searchSessionIdFromURL);
813+
isInitialSearch = false;
814+
return searchSessionIdFromURL;
815+
} else {
816+
// navigating away from background search
817+
removeQueryParam(history, SEARCH_SESSION_ID_QUERY_PARAM);
818+
}
819+
}
820+
return data.search.session.start();
821+
})();
802822

803823
$scope
804824
.updateDataSource()
805825
.then(setupVisualization)
806826
.then(function () {
807827
$scope.fetchStatus = fetchStatuses.LOADING;
808-
logInspectorRequest();
828+
logInspectorRequest({ searchSessionId });
809829
return $scope.searchSource.fetch({
810830
abortSignal: abortController.signal,
811-
sessionId,
831+
sessionId: searchSessionId,
812832
});
813833
})
814834
.then(onResults)
@@ -900,15 +920,15 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise
900920
$scope.fetchStatus = fetchStatuses.COMPLETE;
901921
}
902922

903-
function logInspectorRequest() {
923+
function logInspectorRequest({ searchSessionId = null } = { searchSessionId: null }) {
904924
inspectorAdapters.requests.reset();
905925
const title = i18n.translate('discover.inspectorRequestDataTitle', {
906926
defaultMessage: 'data',
907927
});
908928
const description = i18n.translate('discover.inspectorRequestDescription', {
909929
defaultMessage: 'This request queries Elasticsearch to fetch the data for the search.',
910930
});
911-
inspectorRequest = inspectorAdapters.requests.start(title, { description });
931+
inspectorRequest = inspectorAdapters.requests.start(title, { description, searchSessionId });
912932
inspectorRequest.stats(getRequestInspectorStats($scope.searchSource));
913933
$scope.searchSource.getSearchRequestBody().then((body) => {
914934
inspectorRequest.json(body);

src/plugins/discover/public/url_generator.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,15 @@ describe('Discover url generator', () => {
212212
});
213213
});
214214

215+
test('can specify a search session id', async () => {
216+
const { generator } = await setup();
217+
const url = await generator.createUrl({
218+
searchSessionId: '__test__',
219+
});
220+
expect(url).toMatchInlineSnapshot(`"xyz/app/discover#/?_g=()&_a=()&searchSessionId=__test__"`);
221+
expect(url).toContain('__test__');
222+
});
223+
215224
describe('useHash property', () => {
216225
describe('when default useHash is set to false', () => {
217226
test('when using default, sets index pattern ID in the generated URL', async () => {

0 commit comments

Comments
 (0)