- Create your first index lifecycle policy -
- -- An index lifecycle policy helps you manage your indices as they age. -
-From 8424a925332d5bd7d93148fbab72d1f518933485 Mon Sep 17 00:00:00 2001
From: Alison Goryachev
- An index lifecycle policy helps you manage your indices as they age.
-
- {message} ({statusCode})
-
+ {message} ({statusCode})
+
- Create your first index lifecycle policy
-
-
-
- {isNewPolicy
- ? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.createPolicyMessage', {
- defaultMessage: 'Create policy',
- })
- : i18n.translate('xpack.indexLifecycleMgmt.editPolicy.editPolicyMessage', {
- defaultMessage: 'Edit policy {originalPolicyName}',
- values: { originalPolicyName },
- })}
-
-
- {message} ({statusCode}) -
- } - actions={ -+ {message} ({statusCode}) +
+ } + actions={ +
-
+
{packageInfo.license}
+ {packageInfo.notice && ( +
+
+
+
+
-
-
+
{i18n.translate( - 'xpack.rollupJobs.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph1Text', + 'indexPatternManagement.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph1Text', { defaultMessage: "Kibana's support for rollup index patterns is in beta. You might encounter issues using " + @@ -25,7 +26,7 @@ export const RollupPrompt = () => (
{i18n.translate(
- 'xpack.rollupJobs.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph2Text',
+ 'indexPatternManagement.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph2Text',
{
defaultMessage:
'You can match a rollup index pattern against one rollup index and zero or more regular ' +
diff --git a/src/plugins/index_pattern_management/public/service/creation/index.ts b/src/plugins/index_pattern_management/public/service/creation/index.ts
index 51610bc83e371b..e1f464b01e5505 100644
--- a/src/plugins/index_pattern_management/public/service/creation/index.ts
+++ b/src/plugins/index_pattern_management/public/service/creation/index.ts
@@ -8,3 +8,5 @@
export { IndexPatternCreationConfig, IndexPatternCreationOption } from './config';
export { IndexPatternCreationManager } from './manager';
+// @ts-ignore
+export { RollupIndexPatternCreationConfig } from './rollup_creation_config';
diff --git a/x-pack/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js b/src/plugins/index_pattern_management/public/service/creation/rollup_creation_config.js
similarity index 84%
rename from x-pack/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js
rename to src/plugins/index_pattern_management/public/service/creation/rollup_creation_config.js
index 8e5203fca90347..2a85dfa01143c7 100644
--- a/x-pack/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js
+++ b/src/plugins/index_pattern_management/public/service/creation/rollup_creation_config.js
@@ -1,43 +1,44 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import React from 'react';
import { i18n } from '@kbn/i18n';
import { RollupPrompt } from './components/rollup_prompt';
-import { IndexPatternCreationConfig } from '../../../../../src/plugins/index_pattern_management/public';
+import { IndexPatternCreationConfig } from '.';
const rollupIndexPatternTypeName = i18n.translate(
- 'xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultTypeName',
+ 'indexPatternManagement.editRollupIndexPattern.createIndex.defaultTypeName',
{ defaultMessage: 'rollup index pattern' }
);
const rollupIndexPatternButtonText = i18n.translate(
- 'xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultButtonText',
+ 'indexPatternManagement.editRollupIndexPattern.createIndex.defaultButtonText',
{ defaultMessage: 'Rollup index pattern' }
);
const rollupIndexPatternButtonDescription = i18n.translate(
- 'xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultButtonDescription',
+ 'indexPatternManagement.editRollupIndexPattern.createIndex.defaultButtonDescription',
{ defaultMessage: 'Perform limited aggregations against summarized data' }
);
const rollupIndexPatternNoMatchError = i18n.translate(
- 'xpack.rollupJobs.editRollupIndexPattern.createIndex.noMatchError',
+ 'indexPatternManagement.editRollupIndexPattern.createIndex.noMatchError',
{ defaultMessage: 'Rollup index pattern error: must match one rollup index' }
);
const rollupIndexPatternTooManyMatchesError = i18n.translate(
- 'xpack.rollupJobs.editRollupIndexPattern.createIndex.tooManyMatchesError',
+ 'indexPatternManagement.editRollupIndexPattern.createIndex.tooManyMatchesError',
{ defaultMessage: 'Rollup index pattern error: can only match one rollup index' }
);
const rollupIndexPatternIndexLabel = i18n.translate(
- 'xpack.rollupJobs.editRollupIndexPattern.createIndex.indexLabel',
+ 'indexPatternManagement.editRollupIndexPattern.createIndex.indexLabel',
{ defaultMessage: 'Rollup' }
);
@@ -127,7 +128,7 @@ export class RollupIndexPatternCreationConfig extends IndexPatternCreationConfig
if (error) {
const errorMessage = i18n.translate(
- 'xpack.rollupJobs.editRollupIndexPattern.createIndex.uncaughtError',
+ 'indexPatternManagement.editRollupIndexPattern.createIndex.uncaughtError',
{
defaultMessage: 'Rollup index pattern error: {error}',
values: {
diff --git a/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts b/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts
index f30ccfcb9f3ed7..19346dbf31d185 100644
--- a/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts
+++ b/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts
@@ -6,11 +6,22 @@
* Side Public License, v 1.
*/
-import { HttpSetup } from '../../../../core/public';
-import { IndexPatternCreationManager, IndexPatternCreationConfig } from './creation';
-import { IndexPatternListManager, IndexPatternListConfig } from './list';
+import { HttpSetup, CoreSetup } from '../../../../core/public';
+import {
+ IndexPatternCreationManager,
+ IndexPatternCreationConfig,
+ RollupIndexPatternCreationConfig,
+} from './creation';
+import {
+ IndexPatternListManager,
+ IndexPatternListConfig,
+ RollupIndexPatternListConfig,
+} from './list';
+
+import { CONFIG_ROLLUPS } from '../constants';
interface SetupDependencies {
httpClient: HttpSetup;
+ uiSettings: CoreSetup['uiSettings'];
}
/**
@@ -27,17 +38,17 @@ export class IndexPatternManagementService {
this.indexPatternListConfig = new IndexPatternListManager();
}
- public setup({ httpClient }: SetupDependencies) {
+ public setup({ httpClient, uiSettings }: SetupDependencies) {
const creationManagerSetup = this.indexPatternCreationManager.setup(httpClient);
creationManagerSetup.addCreationConfig(IndexPatternCreationConfig);
const indexPatternListConfigSetup = this.indexPatternListConfig.setup();
indexPatternListConfigSetup.addListConfig(IndexPatternListConfig);
- return {
- creation: creationManagerSetup,
- list: indexPatternListConfigSetup,
- };
+ if (uiSettings.get(CONFIG_ROLLUPS)) {
+ creationManagerSetup.addCreationConfig(RollupIndexPatternCreationConfig);
+ indexPatternListConfigSetup.addListConfig(RollupIndexPatternListConfig);
+ }
}
public start() {
diff --git a/src/plugins/index_pattern_management/public/service/list/index.ts b/src/plugins/index_pattern_management/public/service/list/index.ts
index 620d4c7600733b..738b807ac76246 100644
--- a/src/plugins/index_pattern_management/public/service/list/index.ts
+++ b/src/plugins/index_pattern_management/public/service/list/index.ts
@@ -8,3 +8,5 @@
export { IndexPatternListConfig } from './config';
export { IndexPatternListManager } from './manager';
+// @ts-ignore
+export { RollupIndexPatternListConfig } from './rollup_list_config';
diff --git a/x-pack/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js b/src/plugins/index_pattern_management/public/service/list/rollup_list_config.js
similarity index 86%
rename from x-pack/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js
rename to src/plugins/index_pattern_management/public/service/list/rollup_list_config.js
index 43eee6ca27f9a0..9a80d5fd0d622b 100644
--- a/x-pack/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js
+++ b/src/plugins/index_pattern_management/public/service/list/rollup_list_config.js
@@ -1,11 +1,12 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
-import { IndexPatternListConfig } from '../../../../../src/plugins/index_pattern_management/public';
+import { IndexPatternListConfig } from '.';
function isRollup(indexPattern) {
return (
diff --git a/x-pack/plugins/rollup/kibana.json b/x-pack/plugins/rollup/kibana.json
index 725b563c3674f3..10541d9a4ebddc 100644
--- a/x-pack/plugins/rollup/kibana.json
+++ b/x-pack/plugins/rollup/kibana.json
@@ -5,7 +5,6 @@
"server": true,
"ui": true,
"requiredPlugins": [
- "indexPatternManagement",
"management",
"licensing",
"features"
diff --git a/x-pack/plugins/rollup/public/plugin.ts b/x-pack/plugins/rollup/public/plugin.ts
index 17e352e1a44729..0d345e326193c7 100644
--- a/x-pack/plugins/rollup/public/plugin.ts
+++ b/x-pack/plugins/rollup/public/plugin.ts
@@ -12,14 +12,13 @@ import { rollupBadgeExtension, rollupToggleExtension } from './extend_index_mana
import { RollupIndexPatternCreationConfig } from './index_pattern_creation/rollup_index_pattern_creation_config';
// @ts-ignore
import { RollupIndexPatternListConfig } from './index_pattern_list/rollup_index_pattern_list_config';
-import { CONFIG_ROLLUPS, UIM_APP_NAME } from '../common';
+import { UIM_APP_NAME } from '../common';
import {
FeatureCatalogueCategory,
HomePublicPluginSetup,
} from '../../../../src/plugins/home/public';
import { ManagementSetup } from '../../../../src/plugins/management/public';
import { IndexManagementPluginSetup } from '../../index_management/public';
-import { IndexPatternManagementSetup } from '../../../../src/plugins/index_pattern_management/public';
// @ts-ignore
import { setHttp, init as initDocumentation } from './crud_app/services/index';
import { setNotifications, setFatalErrors, setUiStatsReporter } from './kibana_services';
@@ -29,20 +28,13 @@ export interface RollupPluginSetupDependencies {
home?: HomePublicPluginSetup;
management: ManagementSetup;
indexManagement?: IndexManagementPluginSetup;
- indexPatternManagement: IndexPatternManagementSetup;
usageCollection?: UsageCollectionSetup;
}
export class RollupPlugin implements Plugin {
setup(
core: CoreSetup,
- {
- home,
- management,
- indexManagement,
- indexPatternManagement,
- usageCollection,
- }: RollupPluginSetupDependencies
+ { home, management, indexManagement, usageCollection }: RollupPluginSetupDependencies
) {
setFatalErrors(core.fatalErrors);
if (usageCollection) {
@@ -54,13 +46,6 @@ export class RollupPlugin implements Plugin {
indexManagement.extensionsService.addToggle(rollupToggleExtension);
}
- const isRollupIndexPatternsEnabled = core.uiSettings.get(CONFIG_ROLLUPS);
-
- if (isRollupIndexPatternsEnabled) {
- indexPatternManagement.creation.addCreationConfig(RollupIndexPatternCreationConfig);
- indexPatternManagement.list.addListConfig(RollupIndexPatternListConfig);
- }
-
if (home) {
home.featureCatalogue.register({
id: 'rollup_jobs',
diff --git a/x-pack/plugins/rollup/tsconfig.json b/x-pack/plugins/rollup/tsconfig.json
index 9b994d1710ffc2..6885081ce4bdd1 100644
--- a/x-pack/plugins/rollup/tsconfig.json
+++ b/x-pack/plugins/rollup/tsconfig.json
@@ -16,7 +16,6 @@
"references": [
{ "path": "../../../src/core/tsconfig.json" },
// required plugins
- { "path": "../../../src/plugins/index_pattern_management/tsconfig.json" },
{ "path": "../../../src/plugins/management/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 74a0154c3242be..7409000156ae2f 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -18030,15 +18030,15 @@
"xpack.rollupJobs.detailPanel.jobActionMenu.buttonLabel": "管理",
"xpack.rollupJobs.detailPanel.loadingLabel": "ロールアップジョブを読み込み中...",
"xpack.rollupJobs.detailPanel.notFoundLabel": "ロールアップジョブが見つかりません",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultButtonDescription": "要約データに制限された集約を実行します。",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultButtonText": "ロールアップインデックスパターン",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultTypeName": "ロールアップインデックスパターン",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.indexLabel": "ロールアップ",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.noMatchError": "ロールアップインデックスパターンエラー:ロールアップインデックスの 1 つと一致している必要があります",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.tooManyMatchesError": "ロールアップインデックスパターンエラー:一致できるロールアップインデックスは 1 つだけです",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.uncaughtError": "ロールアップインデックスパターンエラー:{error}",
- "xpack.rollupJobs.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph1Text": "ロールアップインデックスパターンのKibanaのサポートはベータ版です。保存された検索、可視化、ダッシュボードでこれらのパターンを使用すると問題が発生する場合があります。Timelionや機械学習などの一部の高度な機能ではサポートされていません。",
- "xpack.rollupJobs.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph2Text": "ロールアップインデックスパターンは、1つのロールアップインデックスとゼロ以上の標準インデックスと一致させることができます。ロールアップインデックスパターンでは、メトリック、フィールド、間隔、アグリゲーションが制限されています。ロールアップインデックスは、1つのジョブ構成があるインデックス、または複数のジョブと互換する構成があるインデックスに制限されています。",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.defaultButtonDescription": "要約データに制限された集約を実行します。",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.defaultButtonText": "ロールアップインデックスパターン",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.defaultTypeName": "ロールアップインデックスパターン",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.indexLabel": "ロールアップ",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.noMatchError": "ロールアップインデックスパターンエラー:ロールアップインデックスの 1 つと一致している必要があります",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.tooManyMatchesError": "ロールアップインデックスパターンエラー:一致できるロールアップインデックスは 1 つだけです",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.uncaughtError": "ロールアップインデックスパターンエラー:{error}",
+ "indexPatternManagement.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph1Text": "ロールアップインデックスパターンのKibanaのサポートはベータ版です。保存された検索、可視化、ダッシュボードでこれらのパターンを使用すると問題が発生する場合があります。Timelionや機械学習などの一部の高度な機能ではサポートされていません。",
+ "indexPatternManagement.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph2Text": "ロールアップインデックスパターンは、1つのロールアップインデックスとゼロ以上の標準インデックスと一致させることができます。ロールアップインデックスパターンでは、メトリック、フィールド、間隔、アグリゲーションが制限されています。ロールアップインデックスは、1つのジョブ構成があるインデックス、または複数のジョブと互換する構成があるインデックスに制限されています。",
"xpack.rollupJobs.featureCatalogueDescription": "今後の分析用に履歴データを小さなインデックスに要約して格納します。",
"xpack.rollupJobs.indexMgmtBadge.rollupLabel": "ロールアップ",
"xpack.rollupJobs.indexMgmtToggle.toggleLabel": "ロールアップインデックスを含める",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index aebee851043b6b..72a0d5f26b4235 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -18270,15 +18270,15 @@
"xpack.rollupJobs.detailPanel.jobActionMenu.buttonLabel": "管理",
"xpack.rollupJobs.detailPanel.loadingLabel": "正在加载汇总/打包作业……",
"xpack.rollupJobs.detailPanel.notFoundLabel": "未找到汇总/打包作业",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultButtonDescription": "针对汇总数据执行有限聚合",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultButtonText": "汇总/打包索引模式",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultTypeName": "汇总/打包索引模式",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.indexLabel": "汇总/打包",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.noMatchError": "汇总/打包索引模式错误:必须匹配一个汇总/打包索引",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.tooManyMatchesError": "汇总/打包索引模式错误:只能匹配一个汇总/打包索引",
- "xpack.rollupJobs.editRollupIndexPattern.createIndex.uncaughtError": "汇总索引模式错误:{error}",
- "xpack.rollupJobs.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph1Text": "Kibana 对汇总/打包索引模式的支持处于公测版状态。将这些模式用于已保存搜索、可视化以及仪表板可能会遇到问题。某些高级功能,如 Timelion 和 Machine Learning,不支持这些模式。",
- "xpack.rollupJobs.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph2Text": "可以根据一个汇总/打包索引和零个或更多常规索引匹配汇总/打包索引模式。汇总/打包索引模式的指标、字段、时间间隔和聚合有限。汇总/打包索引仅限于具有一个作业配置或多个作业配置兼容的索引。",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.defaultButtonDescription": "针对汇总数据执行有限聚合",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.defaultButtonText": "汇总/打包索引模式",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.defaultTypeName": "汇总/打包索引模式",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.indexLabel": "汇总/打包",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.noMatchError": "汇总/打包索引模式错误:必须匹配一个汇总/打包索引",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.tooManyMatchesError": "汇总/打包索引模式错误:只能匹配一个汇总/打包索引",
+ "indexPatternManagement.editRollupIndexPattern.createIndex.uncaughtError": "汇总索引模式错误:{error}",
+ "indexPatternManagement.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph1Text": "Kibana 对汇总/打包索引模式的支持处于公测版状态。将这些模式用于已保存搜索、可视化以及仪表板可能会遇到问题。某些高级功能,如 Timelion 和 Machine Learning,不支持这些模式。",
+ "indexPatternManagement.editRollupIndexPattern.rollupPrompt.betaCalloutParagraph2Text": "可以根据一个汇总/打包索引和零个或更多常规索引匹配汇总/打包索引模式。汇总/打包索引模式的指标、字段、时间间隔和聚合有限。汇总/打包索引仅限于具有一个作业配置或多个作业配置兼容的索引。",
"xpack.rollupJobs.featureCatalogueDescription": "汇总历史数据并将其存储在较小的索引中以供将来分析。",
"xpack.rollupJobs.indexMgmtBadge.rollupLabel": "汇总/打包",
"xpack.rollupJobs.indexMgmtToggle.toggleLabel": "包括汇总索引",
From 0d6ce5da276cc67aecd94bf92d7f9feb969f4eb7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20G=C3=B3mez?=
+ {error.message} {error.message}
+
-
+
}
- message={
-
-
-
+
}
- color="danger"
- iconType="alert"
- data-test-subj="fetchPipelineError"
- >
-
-
-
-
{error.message}
} + actions={ +
+
+
+ {statusCode} {errorString} +
+ } + /> +
-
+
- filebeat-4-3-22
-
-
-
- filebeat-*
-
-
-
-
- .
-
-
-
-
+ Create test index pattern
+
+
+
+
+ filebeat-4-3-22
+
+
+
+ filebeat-*
+
+
+
+
-
+
- filebeat-4-3-22
-
-
-
- filebeat-*
-
-
-
-
- .
-
-
-
-
+ Create test index pattern
+
+
+
+ filebeat-4-3-22
+
+
+
+ filebeat-*
+
+
+
+
-
+
- filebeat-4-3-22
-
-
-
- filebeat-*
-
-
-
-
- .
-
-
-
-
+ Create test index pattern
+
+
+
+ filebeat-4-3-22
+
+
+
+ filebeat-*
+
+
+
+
-
+ <>
+
-
string
| |
-| options | {
path?: string;
absolute?: boolean;
}
| |
+| options | {
path?: string;
absolute?: boolean;
deepLinkId?: string;
}
| |
Returns:
diff --git a/src/core/public/application/application_service.test.ts b/src/core/public/application/application_service.test.ts
index 5658d3f6260772..3ed164088bf5c7 100644
--- a/src/core/public/application/application_service.test.ts
+++ b/src/core/public/application/application_service.test.ts
@@ -497,6 +497,56 @@ describe('#start()', () => {
expect(getUrlForApp('app1', { path: 'deep/link///' })).toBe('/base-path/app/app1/deep/link');
});
+ describe('deepLinkId option', () => {
+ it('ignores the deepLinkId parameter if it is unknown', async () => {
+ service.setup(setupDeps);
+
+ service.setup(setupDeps);
+ const { getUrlForApp } = await service.start(startDeps);
+
+ expect(getUrlForApp('app1', { deepLinkId: 'unkown-deep-link' })).toBe(
+ '/base-path/app/app1'
+ );
+ });
+
+ it('creates URLs with deepLinkId parameter', async () => {
+ const { register } = service.setup(setupDeps);
+
+ register(
+ Symbol(),
+ createApp({
+ id: 'app1',
+ appRoute: '/custom/app-path',
+ deepLinks: [{ id: 'dl1', title: 'deep link 1', path: '/deep-link' }],
+ })
+ );
+
+ const { getUrlForApp } = await service.start(startDeps);
+
+ expect(getUrlForApp('app1', { deepLinkId: 'dl1' })).toBe(
+ '/base-path/custom/app-path/deep-link'
+ );
+ });
+
+ it('creates URLs with deepLinkId and path parameters', async () => {
+ const { register } = service.setup(setupDeps);
+
+ register(
+ Symbol(),
+ createApp({
+ id: 'app1',
+ appRoute: '/custom/app-path',
+ deepLinks: [{ id: 'dl1', title: 'deep link 1', path: '/deep-link' }],
+ })
+ );
+
+ const { getUrlForApp } = await service.start(startDeps);
+ expect(getUrlForApp('app1', { deepLinkId: 'dl1', path: 'foo/bar' })).toBe(
+ '/base-path/custom/app-path/deep-link/foo/bar'
+ );
+ });
+ });
+
it('does not append trailing slash if hash is provided in path parameter', async () => {
service.setup(setupDeps);
const { getUrlForApp } = await service.start(startDeps);
diff --git a/src/core/public/application/application_service.tsx b/src/core/public/application/application_service.tsx
index 32d45b32c32ffd..8c6090caabce19 100644
--- a/src/core/public/application/application_service.tsx
+++ b/src/core/public/application/application_service.tsx
@@ -282,8 +282,19 @@ export class ApplicationService {
history: this.history!,
getUrlForApp: (
appId,
- { path, absolute = false }: { path?: string; absolute?: boolean } = {}
+ {
+ path,
+ absolute = false,
+ deepLinkId,
+ }: { path?: string; absolute?: boolean; deepLinkId?: string } = {}
) => {
+ if (deepLinkId) {
+ const deepLinkPath = getAppDeepLinkPath(availableMounters, appId, deepLinkId);
+ if (deepLinkPath) {
+ path = appendAppPath(deepLinkPath, path);
+ }
+ }
+
const relUrl = http.basePath.prepend(getAppUrl(availableMounters, appId, path));
return absolute ? relativeToAbsolute(relUrl) : relUrl;
},
diff --git a/src/core/public/application/types.ts b/src/core/public/application/types.ts
index 60b0dbf158dd91..5803f2e3779abc 100644
--- a/src/core/public/application/types.ts
+++ b/src/core/public/application/types.ts
@@ -780,7 +780,10 @@ export interface ApplicationStart {
* @param options.path - optional path inside application to deep link to
* @param options.absolute - if true, will returns an absolute url instead of a relative one
*/
- getUrlForApp(appId: string, options?: { path?: string; absolute?: boolean }): string;
+ getUrlForApp(
+ appId: string,
+ options?: { path?: string; absolute?: boolean; deepLinkId?: string }
+ ): string;
/**
* An observable that emits the current application id and each subsequent id update.
diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md
index 235110aeb4633c..d3426b50f76143 100644
--- a/src/core/public/public.api.md
+++ b/src/core/public/public.api.md
@@ -150,6 +150,7 @@ export interface ApplicationStart {
getUrlForApp(appId: string, options?: {
path?: string;
absolute?: boolean;
+ deepLinkId?: string;
}): string;
navigateToApp(appId: string, options?: NavigateToAppOptions): Promise{message || errorString}
} + {cause && ( + <> +test
; + const sidebar =test
; + + it('renders', () => { + const wrapper = shallow( +test
; - beforeEach(() => { setMockValues({ ...mockValues }); }); it('renders', () => { - const wrapper = shallow(This demo only works if your default index pattern is set and time based
diff --git a/x-pack/examples/embedded_lens_example/public/mount.tsx b/x-pack/examples/embedded_lens_example/public/mount.tsx index 5cf7c25fbf160e..ff1e6ef8818f05 100644 --- a/x-pack/examples/embedded_lens_example/public/mount.tsx +++ b/x-pack/examples/embedded_lens_example/public/mount.tsx @@ -23,7 +23,13 @@ export const mount = (coreSetup: CoreSetup