(defaultContextValue as CanvasServices);
export const useServices = () => useContext(context);
-export const usePlatformService = () => useServices().platform;
export const useEmbeddablesService = () => useServices().embeddables;
export const useExpressionsService = () => useServices().expressions;
export const useNavLinkService = () => useServices().navLink;
@@ -50,7 +48,6 @@ export const LegacyServicesProvider: FC<{
const value = {
embeddables: specifiedProviders.embeddables.getService(),
expressions: specifiedProviders.expressions.getService(),
- platform: specifiedProviders.platform.getService(),
navLink: specifiedProviders.navLink.getService(),
search: specifiedProviders.search.getService(),
reporting: specifiedProviders.reporting.getService(),
diff --git a/x-pack/plugins/canvas/public/services/legacy/index.ts b/x-pack/plugins/canvas/public/services/legacy/index.ts
index 763fd657ad800..01f252c8eb0d6 100644
--- a/x-pack/plugins/canvas/public/services/legacy/index.ts
+++ b/x-pack/plugins/canvas/public/services/legacy/index.ts
@@ -8,7 +8,6 @@
import { BehaviorSubject } from 'rxjs';
import { CoreSetup, CoreStart, AppUpdater } from '../../../../../../src/core/public';
import { CanvasSetupDeps, CanvasStartDeps } from '../../plugin';
-import { platformServiceFactory } from './platform';
import { navLinkServiceFactory } from './nav_link';
import { embeddablesServiceFactory } from './embeddables';
import { expressionsServiceFactory } from './expressions';
@@ -17,7 +16,6 @@ import { labsServiceFactory } from './labs';
import { reportingServiceFactory } from './reporting';
export { SearchService } from './search';
-export { PlatformService } from './platform';
export { NavLinkService } from './nav_link';
export { EmbeddablesService } from './embeddables';
export { ExpressionsService } from '../../../../../../src/plugins/expressions/common';
@@ -77,7 +75,6 @@ export type ServiceFromProvider = P extends CanvasServiceProvider ?
export const services = {
embeddables: new CanvasServiceProvider(embeddablesServiceFactory),
expressions: new CanvasServiceProvider(expressionsServiceFactory),
- platform: new CanvasServiceProvider(platformServiceFactory),
navLink: new CanvasServiceProvider(navLinkServiceFactory),
search: new CanvasServiceProvider(searchServiceFactory),
reporting: new CanvasServiceProvider(reportingServiceFactory),
@@ -89,7 +86,6 @@ export type CanvasServiceProviders = typeof services;
export interface CanvasServices {
embeddables: ServiceFromProvider;
expressions: ServiceFromProvider;
- platform: ServiceFromProvider;
navLink: ServiceFromProvider;
search: ServiceFromProvider;
reporting: ServiceFromProvider;
@@ -116,7 +112,6 @@ export const stopServices = () => {
export const {
embeddables: embeddableService,
- platform: platformService,
navLink: navLinkService,
expressions: expressionsService,
search: searchService,
diff --git a/x-pack/plugins/canvas/public/services/legacy/stubs/index.ts b/x-pack/plugins/canvas/public/services/legacy/stubs/index.ts
index cebefdd7682cc..9857e27d8a3cf 100644
--- a/x-pack/plugins/canvas/public/services/legacy/stubs/index.ts
+++ b/x-pack/plugins/canvas/public/services/legacy/stubs/index.ts
@@ -11,7 +11,6 @@ import { expressionsService } from './expressions';
import { reportingService } from './reporting';
import { navLinkService } from './nav_link';
import { labsService } from './labs';
-import { platformService } from './platform';
import { searchService } from './search';
export const stubs: CanvasServices = {
@@ -19,7 +18,6 @@ export const stubs: CanvasServices = {
expressions: expressionsService,
reporting: reportingService,
navLink: navLinkService,
- platform: platformService,
search: searchService,
labs: labsService,
};
diff --git a/x-pack/plugins/canvas/public/services/platform.ts b/x-pack/plugins/canvas/public/services/platform.ts
new file mode 100644
index 0000000000000..7a452d809a614
--- /dev/null
+++ b/x-pack/plugins/canvas/public/services/platform.ts
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+import {
+ SavedObjectsStart,
+ SavedObjectsClientContract,
+ IUiSettingsClient,
+ ChromeBreadcrumb,
+ IBasePath,
+ ChromeStart,
+} from '../../../../../src/core/public';
+
+export interface CanvasPlatformService {
+ getBasePath: () => string;
+ getBasePathInterface: () => IBasePath;
+ getDocLinkVersion: () => string;
+ getElasticWebsiteUrl: () => string;
+ getHasWriteAccess: () => boolean;
+ getUISetting: (key: string, defaultValue?: any) => any;
+ setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void;
+ setRecentlyAccessed: (link: string, label: string, id: string) => void;
+ setFullscreen: ChromeStart['setIsVisible'];
+
+ // TODO: these should go away. We want thin accessors, not entire objects.
+ // Entire objects are hard to mock, and hide our dependency on the external service.
+ getSavedObjects: () => SavedObjectsStart;
+ getSavedObjectsClient: () => SavedObjectsClientContract;
+ getUISettings: () => IUiSettingsClient;
+}
diff --git a/x-pack/plugins/canvas/public/services/stubs/index.ts b/x-pack/plugins/canvas/public/services/stubs/index.ts
index 5c3440cc4cdbc..1aa05647f7e9e 100644
--- a/x-pack/plugins/canvas/public/services/stubs/index.ts
+++ b/x-pack/plugins/canvas/public/services/stubs/index.ts
@@ -16,13 +16,16 @@ import {
import { CanvasPluginServices } from '..';
import { workpadServiceFactory } from './workpad';
import { notifyServiceFactory } from './notify';
+import { platformServiceFactory } from './platform';
export { workpadServiceFactory } from './workpad';
export { notifyServiceFactory } from './notify';
+export { platformServiceFactory } from './platform';
export const pluginServiceProviders: PluginServiceProviders = {
workpad: new PluginServiceProvider(workpadServiceFactory),
notify: new PluginServiceProvider(notifyServiceFactory),
+ platform: new PluginServiceProvider(platformServiceFactory),
};
export const pluginServiceRegistry = new PluginServiceRegistry(
diff --git a/x-pack/plugins/canvas/public/services/legacy/stubs/platform.ts b/x-pack/plugins/canvas/public/services/stubs/platform.ts
similarity index 72%
rename from x-pack/plugins/canvas/public/services/legacy/stubs/platform.ts
rename to x-pack/plugins/canvas/public/services/stubs/platform.ts
index 5776a1d0d6983..181d355df8a1c 100644
--- a/x-pack/plugins/canvas/public/services/legacy/stubs/platform.ts
+++ b/x-pack/plugins/canvas/public/services/stubs/platform.ts
@@ -5,7 +5,11 @@
* 2.0.
*/
-import { PlatformService } from '../platform';
+import { PluginServiceFactory } from '../../../../../../src/plugins/presentation_util/public';
+
+import { CanvasPlatformService } from '../platform';
+
+type CanvasPlatformServiceFactory = PluginServiceFactory;
const noop = (..._args: any[]): any => {};
@@ -15,7 +19,7 @@ const uiSettings: Record = {
const getUISetting = (setting: string) => uiSettings[setting];
-export const platformService: PlatformService = {
+export const platformServiceFactory: CanvasPlatformServiceFactory = () => ({
getBasePath: () => '/base/path',
getBasePathInterface: noop,
getDocLinkVersion: () => 'dockLinkVersion',
@@ -28,4 +32,4 @@ export const platformService: PlatformService = {
getSavedObjectsClient: noop,
getUISettings: noop,
setFullscreen: noop,
-};
+});
diff --git a/x-pack/plugins/canvas/public/state/initial_state.js b/x-pack/plugins/canvas/public/state/initial_state.js
index e4909bdb95081..c652cc573abe9 100644
--- a/x-pack/plugins/canvas/public/state/initial_state.js
+++ b/x-pack/plugins/canvas/public/state/initial_state.js
@@ -6,11 +6,12 @@
*/
import { get } from 'lodash';
-import { platformService } from '../services';
+import { pluginServices } from '../services';
import { getDefaultWorkpad } from './defaults';
export const getInitialState = (path) => {
- const { getHasWriteAccess } = platformService.getService();
+ const platformService = pluginServices.getServices().platform;
+ const { getHasWriteAccess } = platformService;
const state = {
app: {}, // Kibana stuff in here
diff --git a/x-pack/plugins/canvas/public/state/reducers/workpad.js b/x-pack/plugins/canvas/public/state/reducers/workpad.js
index acd371e9490fb..ebde0106f9c01 100644
--- a/x-pack/plugins/canvas/public/state/reducers/workpad.js
+++ b/x-pack/plugins/canvas/public/state/reducers/workpad.js
@@ -6,7 +6,7 @@
*/
import { handleActions } from 'redux-actions';
-import { platformService } from '../../services';
+import { pluginServices } from '../../services';
import { getDefaultWorkpad } from '../defaults';
import {
setWorkpad,
@@ -24,9 +24,13 @@ import { APP_ROUTE_WORKPAD } from '../../../common/lib/constants';
export const workpadReducer = handleActions(
{
[setWorkpad]: (workpadState, { payload }) => {
- platformService
- .getService()
- .setRecentlyAccessed(`${APP_ROUTE_WORKPAD}/${payload.id}`, payload.name, payload.id);
+ pluginServices
+ .getServices()
+ .platform.setRecentlyAccessed(
+ `${APP_ROUTE_WORKPAD}/${payload.id}`,
+ payload.name,
+ payload.id
+ );
return payload;
},
@@ -39,9 +43,13 @@ export const workpadReducer = handleActions(
},
[setName]: (workpadState, { payload }) => {
- platformService
- .getService()
- .setRecentlyAccessed(`${APP_ROUTE_WORKPAD}/${workpadState.id}`, payload, workpadState.id);
+ pluginServices
+ .getServices()
+ .platform.setRecentlyAccessed(
+ `${APP_ROUTE_WORKPAD}/${workpadState.id}`,
+ payload,
+ workpadState.id
+ );
return { ...workpadState, name: payload };
},
From fb20e0219221034ce1095c83e7e187f131834782 Mon Sep 17 00:00:00 2001
From: Nathan Reese
Date: Thu, 1 Jul 2021 15:10:09 -0600
Subject: [PATCH 13/68] [maps][docs] 7.14 doc updates (#103531)
* [maps][docs] 7.14 doc updates
* more details
* timeslider screenshot
* Update docs/maps/search.asciidoc
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
* Update docs/maps/search.asciidoc
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
* review feedback
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
---
.../images/enable_filter_by_map_extent.png | Bin 0 -> 724529 bytes
docs/maps/images/timeslider.gif | Bin 0 -> 656115 bytes
docs/maps/index.asciidoc | 10 ++++++
docs/maps/search.asciidoc | 32 ++++++++++++++----
.../dashboard/enhance-dashboards.asciidoc | 2 +-
5 files changed, 37 insertions(+), 7 deletions(-)
create mode 100644 docs/maps/images/enable_filter_by_map_extent.png
create mode 100644 docs/maps/images/timeslider.gif
diff --git a/docs/maps/images/enable_filter_by_map_extent.png b/docs/maps/images/enable_filter_by_map_extent.png
new file mode 100644
index 0000000000000000000000000000000000000000..5132dc8f73dbef31579e5a939931ddab22726adb
GIT binary patch
literal 724529
zcmb5VbyytBwmv*F*kEC>K+wT8XoAZCK_Wdq{BC;3T-a1$P->
zev^I9z4tud_s8C6o^HCR?yBytu3qb1@4Nbgijq7&4h0SX0Kk8)@azo$0EPkpXbE6U
zRE-DDs4@V6vuGhBqw-uv2CCv{XKG<>0sts{NKD33QQdh6A8Fp9%fW!e5P1@RA%?x!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