diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d08676c5070b45..8269acd9242c4c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -144,7 +144,6 @@ /x-pack/plugins/dashboard_enhanced/ @elastic/kibana-presentation /x-pack/test/functional/apps/canvas/ @elastic/kibana-presentation #CC# /src/plugins/kibana_react/public/code_editor/ @elastic/kibana-presentation -#CC# /x-pack/plugins/dashboard_mode @elastic/kibana-presentation # Machine Learning /x-pack/plugins/ml/ @elastic/ml-ui diff --git a/api_docs/dashboard_mode.json b/api_docs/dashboard_mode.json deleted file mode 100644 index eb2927e3515781..00000000000000 --- a/api_docs/dashboard_mode.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "id": "dashboardMode", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [ - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin", - "type": "Class", - "tags": [], - "label": "DashboardModeServerPlugin", - "description": [], - "signature": [ - { - "pluginId": "dashboardMode", - "scope": "server", - "docId": "kibDashboardModePluginApi", - "section": "def-server.DashboardModeServerPlugin", - "text": "DashboardModeServerPlugin" - }, - " implements ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.Plugin", - "text": "Plugin" - }, - "" - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "initializerContext", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.PluginInitializerContext", - "text": "PluginInitializerContext" - }, - "" - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin.setup", - "type": "Function", - "tags": [], - "label": "setup", - "description": [], - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - ", { security }: DashboardModeServerSetupDependencies) => void" - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin.setup.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - "" - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin.setup.$2", - "type": "Object", - "tags": [], - "label": "{ security }", - "description": [], - "signature": [ - "DashboardModeServerSetupDependencies" - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin.start", - "type": "Function", - "tags": [], - "label": "start", - "description": [], - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreStart", - "text": "CoreStart" - }, - ") => void" - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin.start.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreStart", - "text": "CoreStart" - } - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "dashboardMode", - "id": "def-server.DashboardModeServerPlugin.stop", - "type": "Function", - "tags": [], - "label": "stop", - "description": [], - "signature": [ - "() => void" - ], - "path": "x-pack/plugins/dashboard_mode/server/plugin.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - } - ], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [ - { - "parentPluginId": "dashboardMode", - "id": "def-common.UI_SETTINGS", - "type": "Object", - "tags": [], - "label": "UI_SETTINGS", - "description": [], - "path": "x-pack/plugins/dashboard_mode/common/constants.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "dashboardMode", - "id": "def-common.UI_SETTINGS.CONFIG_DASHBOARD_ONLY_MODE_ROLES", - "type": "string", - "tags": [], - "label": "CONFIG_DASHBOARD_ONLY_MODE_ROLES", - "description": [], - "path": "x-pack/plugins/dashboard_mode/common/constants.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ] - } -} \ No newline at end of file diff --git a/api_docs/dashboard_mode.mdx b/api_docs/dashboard_mode.mdx deleted file mode 100644 index 606532e85fe783..00000000000000 --- a/api_docs/dashboard_mode.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: kibDashboardModePluginApi -slug: /kibana-dev-docs/dashboardModePluginApi -title: dashboardMode -image: https://source.unsplash.com/400x175/?github -summary: API docs for the dashboardMode plugin -date: 2020-11-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardMode'] -warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. ---- -import dashboardModeObj from './dashboard_mode.json'; - - - - - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 11 | 0 | 11 | 0 | - -## Server - -### Classes - - -## Common - -### Objects - - diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 3879a54a99470d..4addef8fbb9319 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -378,10 +378,6 @@ The client-side plugin configures following values: |Adds drilldown capabilities to dashboard. Owned by the Kibana App team. -|{kib-repo}blob/{branch}/x-pack/plugins/dashboard_mode/README.md[dashboardMode] -|The deprecated dashboard only mode. - - |{kib-repo}blob/{branch}/x-pack/plugins/data_enhanced/README.md[dataEnhanced] |The data_enhanced plugin is the x-pack counterpart to the src/plguins/data plugin. diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.md index c12fb45e6ab42f..f71eb03d89d725 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.md @@ -22,5 +22,4 @@ export interface ChromeNavLinks | [getForceAppSwitcherNavigation$()](./kibana-plugin-core-public.chromenavlinks.getforceappswitchernavigation_.md) | An observable of the forced app switcher state. | | [getNavLinks$()](./kibana-plugin-core-public.chromenavlinks.getnavlinks_.md) | Get an observable for a sorted list of navlinks. | | [has(id)](./kibana-plugin-core-public.chromenavlinks.has.md) | Check whether or not a navlink exists. | -| [showOnly(id)](./kibana-plugin-core-public.chromenavlinks.showonly.md) | Remove all navlinks except the one matching the given id. | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.showonly.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.showonly.md deleted file mode 100644 index 8f188f5fb71c93..00000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlinks.showonly.md +++ /dev/null @@ -1,28 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeNavLinks](./kibana-plugin-core-public.chromenavlinks.md) > [showOnly](./kibana-plugin-core-public.chromenavlinks.showonly.md) - -## ChromeNavLinks.showOnly() method - -Remove all navlinks except the one matching the given id. - -Signature: - -```typescript -showOnly(id: string): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| id | string | | - -Returns: - -`void` - -## Remarks - -NOTE: this is not reversible. - diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index b11458d6539e85..2070bad7b163ed 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -12,7 +12,6 @@ pageLoadAssetSize: crossClusterReplication: 65408 dashboard: 374194 dashboardEnhanced: 65646 - dashboardMode: 22716 data: 824229 dataEnhanced: 50420 devTools: 38637 diff --git a/src/core/public/chrome/chrome_service.mock.ts b/src/core/public/chrome/chrome_service.mock.ts index 5e29218250fb90..347b81abf6d512 100644 --- a/src/core/public/chrome/chrome_service.mock.ts +++ b/src/core/public/chrome/chrome_service.mock.ts @@ -19,7 +19,6 @@ const createStartContractMock = () => { has: jest.fn(), get: jest.fn(), getAll: jest.fn(), - showOnly: jest.fn(), enableForcedAppSwitcherNavigation: jest.fn(), getForceAppSwitcherNavigation$: jest.fn(), }, diff --git a/src/core/public/chrome/nav_links/nav_links_service.test.ts b/src/core/public/chrome/nav_links/nav_links_service.test.ts index e1d537da6959b7..294a6de914a422 100644 --- a/src/core/public/chrome/nav_links/nav_links_service.test.ts +++ b/src/core/public/chrome/nav_links/nav_links_service.test.ts @@ -89,10 +89,8 @@ describe('NavLinksService', () => { const navLinkIds$ = start.getNavLinks$().pipe(map((links) => links.map((l) => l.id))); const emittedLinks: string[][] = []; navLinkIds$.subscribe((r) => emittedLinks.push(r)); - start.showOnly('app1'); - service.stop(); - expect(emittedLinks).toEqual([['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1'], ['app1']]); + expect(emittedLinks).toEqual([['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']]); }); it('completes when service is stopped', async () => { @@ -133,74 +131,6 @@ describe('NavLinksService', () => { }); }); - describe('#showOnly()', () => { - it('does nothing if link does not exist', async () => { - start.showOnly('fake'); - expect( - await start - .getNavLinks$() - .pipe( - take(1), - map((links) => links.map((l) => l.id)) - ) - .toPromise() - ).toEqual(['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']); - }); - - it('does nothing on chromeless applications', async () => { - start.showOnly('chromelessApp'); - expect( - await start - .getNavLinks$() - .pipe( - take(1), - map((links) => links.map((l) => l.id)) - ) - .toPromise() - ).toEqual(['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']); - }); - - it('removes all other links', async () => { - start.showOnly('app2'); - expect( - await start - .getNavLinks$() - .pipe( - take(1), - map((links) => links.map((l) => l.id)) - ) - .toPromise() - ).toEqual(['app2']); - }); - - it('show only deep link', async () => { - start.showOnly('app2:deepApp1'); - expect( - await start - .getNavLinks$() - .pipe( - take(1), - map((links) => links.map((l) => l.id)) - ) - .toPromise() - ).toEqual(['app2:deepApp1']); - }); - - it('still removes all other links when availableApps are re-emitted', async () => { - start.showOnly('app2'); - mockAppService.applications$.next(mockAppService.applications$.value); - expect( - await start - .getNavLinks$() - .pipe( - take(1), - map((links) => links.map((l) => l.id)) - ) - .toPromise() - ).toEqual(['app2']); - }); - }); - describe('#enableForcedAppSwitcherNavigation()', () => { it('flips #getForceAppSwitcherNavigation$()', async () => { await expect(start.getForceAppSwitcherNavigation$().pipe(take(1)).toPromise()).resolves.toBe( diff --git a/src/core/public/chrome/nav_links/nav_links_service.ts b/src/core/public/chrome/nav_links/nav_links_service.ts index af961987a63095..6a91d4d1790766 100644 --- a/src/core/public/chrome/nav_links/nav_links_service.ts +++ b/src/core/public/chrome/nav_links/nav_links_service.ts @@ -7,7 +7,7 @@ */ import { sortBy } from 'lodash'; -import { BehaviorSubject, combineLatest, Observable, ReplaySubject } from 'rxjs'; +import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs'; import { map, takeUntil } from 'rxjs/operators'; import { InternalApplicationStart, PublicAppDeepLinkInfo, PublicAppInfo } from '../../application'; @@ -48,16 +48,6 @@ export interface ChromeNavLinks { */ has(id: string): boolean; - /** - * Remove all navlinks except the one matching the given id. - * - * @remarks - * NOTE: this is not reversible. - * - * @param id - */ - showOnly(id: string): void; - /** * Enable forced navigation mode, which will trigger a page refresh * when a nav link is clicked and only the hash is updated. @@ -78,39 +68,25 @@ export interface ChromeNavLinks { getForceAppSwitcherNavigation$(): Observable; } -type LinksUpdater = (navLinks: Map) => Map; - export class NavLinksService { private readonly stop$ = new ReplaySubject(1); public start({ application, http }: StartDeps): ChromeNavLinks { - const appLinks$ = application.applications$.pipe( - map((apps) => { - return new Map( - [...apps] - .filter(([, app]) => !app.chromeless) - .reduce((navLinks: Array<[string, NavLinkWrapper]>, [appId, app]) => { - navLinks.push( - [appId, toNavLink(app, http.basePath)], - ...toNavDeepLinks(app, app.deepLinks, http.basePath) - ); - return navLinks; - }, []) - ); - }) - ); - - // now that availableApps$ is an observable, we need to keep record of all - // manual link modifications to be able to re-apply then after every - // availableApps$ changes. - // Only in use by `showOnly` API, can be removed once dashboard_mode is removed in 8.0 - const linkUpdaters$ = new BehaviorSubject([]); const navLinks$ = new BehaviorSubject>(new Map()); - - combineLatest([appLinks$, linkUpdaters$]) + application.applications$ .pipe( - map(([appLinks, linkUpdaters]) => { - return linkUpdaters.reduce((links, updater) => updater(links), appLinks); + map((apps) => { + return new Map( + [...apps] + .filter(([, app]) => !app.chromeless) + .reduce((navLinks: Array<[string, NavLinkWrapper]>, [appId, app]) => { + navLinks.push( + [appId, toNavLink(app, http.basePath)], + ...toNavDeepLinks(app, app.deepLinks, http.basePath) + ); + return navLinks; + }, []) + ); }) ) .subscribe((navlinks) => { @@ -137,17 +113,6 @@ export class NavLinksService { return navLinks$.value.has(id); }, - showOnly(id: string) { - if (!this.has(id)) { - return; - } - - const updater: LinksUpdater = (navLinks) => - new Map([...navLinks.entries()].filter(([linkId]) => linkId === id)); - - linkUpdaters$.next([...linkUpdaters$.value, updater]); - }, - enableForcedAppSwitcherNavigation() { forceAppSwitcherNavigation$.next(true); }, diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 2217b71d2f1a31..043759378faa30 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -324,7 +324,6 @@ export interface ChromeNavLinks { getForceAppSwitcherNavigation$(): Observable; getNavLinks$(): Observable>>; has(id: string): boolean; - showOnly(id: string): void; } // @public diff --git a/src/plugins/dashboard/public/application/dashboard_router.tsx b/src/plugins/dashboard/public/application/dashboard_router.tsx index cb40b305428698..902a03bd84ad2c 100644 --- a/src/plugins/dashboard/public/application/dashboard_router.tsx +++ b/src/plugins/dashboard/public/application/dashboard_router.tsx @@ -80,7 +80,6 @@ export async function mountApp({ data: dataStart, share: shareStart, embeddable: embeddableStart, - kibanaLegacy: { dashboardConfig }, savedObjectsTaggingOss, visualizations, presentationUtil, @@ -117,12 +116,12 @@ export async function mountApp({ allowByValueEmbeddables: initializerContext.config.get() .allowByValueEmbeddables, dashboardCapabilities: { - hideWriteControls: dashboardConfig.getHideWriteControls(), show: Boolean(coreStart.application.capabilities.dashboard.show), saveQuery: Boolean(coreStart.application.capabilities.dashboard.saveQuery), createNew: Boolean(coreStart.application.capabilities.dashboard.createNew), mapsCapabilities: { save: Boolean(coreStart.application.capabilities.maps?.save) }, createShortUrl: Boolean(coreStart.application.capabilities.dashboard.createShortUrl), + showWriteControls: Boolean(coreStart.application.capabilities.dashboard.showWriteControls), visualizeCapabilities: { save: Boolean(coreStart.application.capabilities.visualize?.save) }, storeSearchSession: Boolean(coreStart.application.capabilities.dashboard.storeSearchSession), }, @@ -251,7 +250,7 @@ export async function mountApp({ ); addHelpMenuToAppChrome(dashboardServices.chrome, coreStart.docLinks); - if (dashboardServices.dashboardCapabilities.hideWriteControls) { + if (!dashboardServices.dashboardCapabilities.showWriteControls) { coreStart.chrome.setBadge({ text: dashboardReadonlyBadge.getText(), tooltip: dashboardReadonlyBadge.getTooltip(), diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index 953bd619c444b9..86f81aa1ee10d9 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -79,7 +79,7 @@ const defaultCapabilities: DashboardAppCapabilities = { createNew: false, saveQuery: false, createShortUrl: false, - hideWriteControls: true, + showWriteControls: false, mapsCapabilities: { save: false }, visualizeCapabilities: { save: false }, storeSearchSession: true, diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx index cbe10438e578aa..35b304f7cc65b4 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx @@ -117,7 +117,7 @@ export class DashboardViewport extends React.Component { setLastSavedState( savedObjectToDashboardState({ - hideWriteControls: dashboardBuildContext.dashboardCapabilities.hideWriteControls, + showWriteControls: dashboardBuildContext.dashboardCapabilities.showWriteControls, version: dashboardBuildContext.kibanaVersion, savedObjectsTagging, usageCollection, @@ -341,7 +341,12 @@ export const useDashboardAppState = ({ if (from && to) timefilter.setTime({ from, to }); if (refreshInterval) timefilter.setRefreshInterval(refreshInterval); } - dispatchDashboardStateChange(setDashboardState(lastSavedState)); + dispatchDashboardStateChange( + setDashboardState({ + ...lastSavedState, + viewMode: ViewMode.VIEW, + }) + ); }, [lastSavedState, dashboardAppState, data.query.timefilter, dispatchDashboardStateChange]); /** diff --git a/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts b/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts index 2e6290ec920c03..d17f8405d734f4 100644 --- a/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts +++ b/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts @@ -27,7 +27,7 @@ import { interface SavedObjectToDashboardStateProps { version: string; - hideWriteControls: boolean; + showWriteControls: boolean; savedDashboard: DashboardSavedObject; usageCollection: DashboardAppServices['usageCollection']; savedObjectsTagging: DashboardAppServices['savedObjectsTagging']; @@ -55,9 +55,9 @@ interface StateToRawDashboardStateProps { */ export const savedObjectToDashboardState = ({ version, - hideWriteControls, savedDashboard, usageCollection, + showWriteControls, savedObjectsTagging, }: SavedObjectToDashboardStateProps): DashboardState => { const rawState = migrateAppState( @@ -70,7 +70,7 @@ export const savedObjectToDashboardState = ({ description: savedDashboard.description || '', tags: getTagsFromSavedDashboard(savedDashboard, savedObjectsTagging), panels: savedDashboard.panelsJSON ? JSON.parse(savedDashboard.panelsJSON) : [], - viewMode: savedDashboard.id || hideWriteControls ? ViewMode.VIEW : ViewMode.EDIT, + viewMode: savedDashboard.id || showWriteControls ? ViewMode.EDIT : ViewMode.VIEW, options: savedDashboard.optionsJSON ? JSON.parse(savedDashboard.optionsJSON) : {}, }, version, diff --git a/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts b/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts index 9069173c15e8f8..04461a46ad0da5 100644 --- a/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts +++ b/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts @@ -38,7 +38,7 @@ export const loadSavedDashboardState = async ({ }: DashboardBuildContext & { savedDashboardId?: string }): Promise< LoadSavedDashboardStateReturn | undefined > => { - const { hideWriteControls } = dashboardCapabilities; + const { showWriteControls } = dashboardCapabilities; const { queryString } = query; // BWC - remove for 8.0 @@ -66,12 +66,12 @@ export const loadSavedDashboardState = async ({ const savedDashboardState = savedObjectToDashboardState({ savedDashboard, usageCollection, - hideWriteControls, + showWriteControls, savedObjectsTagging, version: initializerContext.env.packageInfo.version, }); - const isViewMode = hideWriteControls || Boolean(savedDashboard.id); + const isViewMode = !showWriteControls || Boolean(savedDashboard.id); savedDashboardState.viewMode = isViewMode ? ViewMode.VIEW : ViewMode.EDIT; savedDashboardState.filters = cleanFiltersForSerialize(savedDashboardState.filters); savedDashboardState.query = migrateLegacyQuery( diff --git a/src/plugins/dashboard/public/application/lib/session_restoration.test.ts b/src/plugins/dashboard/public/application/lib/session_restoration.test.ts index c8366387471452..571dfb0a8beeba 100644 --- a/src/plugins/dashboard/public/application/lib/session_restoration.test.ts +++ b/src/plugins/dashboard/public/application/lib/session_restoration.test.ts @@ -19,7 +19,7 @@ describe('createSessionRestorationDataProvider', () => { getAppState: () => savedObjectToDashboardState({ version, - hideWriteControls: false, + showWriteControls: true, usageCollection: undefined, savedObjectsTagging: undefined, savedDashboard: getSavedDashboardMock(), diff --git a/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.tsx.snap b/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.tsx.snap index e78583be56569b..2e37dc61fe851e 100644 --- a/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.tsx.snap +++ b/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.tsx.snap @@ -112,8 +112,9 @@ exports[`after fetch When given a title that matches multiple dashboards, filter `; -exports[`after fetch hideWriteControls 1`] = ` +exports[`after fetch initialFilter 1`] = ` + Create new dashboard + + } body={ -

- There are no available dashboards. To change your permissions to view the dashboards in this space, contact your administrator. -

+ +

+ You can combine data views from any Kibana app into one dashboard and see everything in one place. +

+

+ + Install some sample data + , + } + } + /> +

+
} - iconType="glasses" + iconType="dashboardApp" title={

- No dashboards to view + Create your first dashboard

} /> @@ -154,7 +185,7 @@ exports[`after fetch hideWriteControls 1`] = ` entityNamePlural="dashboards" findItems={[Function]} headingId="dashboardListingHeading" - initialFilter="" + initialFilter="testFilter" initialPageSize={20} listingLimit={100} rowHeader="title" @@ -193,9 +224,8 @@ exports[`after fetch hideWriteControls 1`] = `
`; -exports[`after fetch initialFilter 1`] = ` +exports[`after fetch renders all table rows 1`] = ` `; -exports[`after fetch renders all table rows 1`] = ` +exports[`after fetch renders call to action when no dashboards exist 1`] = ` `; -exports[`after fetch renders call to action when no dashboards exist 1`] = ` +exports[`after fetch renders warning when listingLimit is exceeded 1`] = ` `; -exports[`after fetch renders warning when listingLimit is exceeded 1`] = ` +exports[`after fetch showWriteControls 1`] = ` - Create new dashboard - - } body={ - -

- You can combine data views from any Kibana app into one dashboard and see everything in one place. -

-

- - Install some sample data - , - } - } - /> -

-
+

+ There are no available dashboards. To change your permissions to view the dashboards in this space, contact your administrator. +

} - iconType="dashboardApp" + iconType="glasses" title={

- Create your first dashboard + No dashboards to view

} /> @@ -601,7 +601,7 @@ exports[`after fetch renders warning when listingLimit is exceeded 1`] = ` headingId="dashboardListingHeading" initialFilter="" initialPageSize={20} - listingLimit={1} + listingLimit={100} rowHeader="title" searchFilters={Array []} tableCaption="Dashboards" diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx index 7602b2ed68b62d..37ee0ec13d7c94 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx @@ -133,9 +133,9 @@ describe('after fetch', () => { }); }); - test('hideWriteControls', async () => { + test('showWriteControls', async () => { const services = makeDefaultServices(); - services.dashboardCapabilities.hideWriteControls = true; + services.dashboardCapabilities.showWriteControls = false; const { component } = mountWith({ services }); // Ensure all promises resolve await new Promise((resolve) => process.nextTick(resolve)); diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx b/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx index 7f72c77009cb9a..5f5923cb78696f 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx @@ -87,7 +87,7 @@ export const DashboardListing = ({ }; }, [title, savedObjectsClient, redirectTo, data.query, kbnUrlStateStorage]); - const hideWriteControls = dashboardCapabilities.hideWriteControls; + const { showWriteControls } = dashboardCapabilities; const listingLimit = savedObjects.settings.getListingLimit(); const defaultFilter = title ? `"${title}"` : ''; @@ -118,8 +118,8 @@ export const DashboardListing = ({ }, [dashboardSessionStorage, redirectTo, core.overlays]); const emptyPrompt = useMemo( - () => getNoItemsMessage(hideWriteControls, core.application, createItem), - [createItem, core.application, hideWriteControls] + () => getNoItemsMessage(showWriteControls, core.application, createItem), + [createItem, core.application, showWriteControls] ); const fetchItems = useCallback( @@ -171,10 +171,10 @@ export const DashboardListing = ({ } = dashboardListingTable; return ( void ) => { - if (hideWriteControls) { + if (!showWriteControls) { return ( ({ config: { defaultAppId: 'home', }, - dashboardConfig: { - turnHideWriteControlsOn: jest.fn(), - getHideWriteControls: jest.fn(), - }, loadFontAwesome: jest.fn(), loadAngularBootstrap: jest.fn(), }); diff --git a/src/plugins/kibana_legacy/public/plugin.ts b/src/plugins/kibana_legacy/public/plugin.ts index f60130d367b584..af22ceadaa9e1c 100644 --- a/src/plugins/kibana_legacy/public/plugin.ts +++ b/src/plugins/kibana_legacy/public/plugin.ts @@ -8,7 +8,6 @@ import { PluginInitializerContext, CoreStart, CoreSetup } from 'kibana/public'; import { ConfigSchema } from '../config'; -import { getDashboardConfig } from './dashboard_config'; import { injectHeaderStyle } from './utils/inject_header_style'; export class KibanaLegacyPlugin { @@ -21,11 +20,6 @@ export class KibanaLegacyPlugin { public start({ application, http: { basePath }, uiSettings }: CoreStart) { injectHeaderStyle(uiSettings); return { - /** - * Used to power dashboard mode. Should be removed when dashboard mode is removed eventually. - * @deprecated - */ - dashboardConfig: getDashboardConfig(!application.capabilities.dashboard.showWriteControls), /** * Loads the font-awesome icon font. Should be removed once the last consumer has migrated to EUI * @deprecated diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts index 54a3fe9e4399c0..d29d6d6a86e853 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts @@ -134,7 +134,6 @@ export const applicationUsageSchema = { // X-Pack apm: commonSchema, canvas: commonSchema, - dashboard_mode: commonSchema, // It's a forward app so we'll likely never report it enterpriseSearch: commonSchema, appSearch: commonSchema, workplaceSearch: commonSchema, diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts index b64c23a2af2898..fec314fc6b87e0 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts @@ -35,7 +35,6 @@ const uiMetricFromDataPluginSchema: MakeSchemaFrom = { apm: commonSchema, csm: commonSchema, canvas: commonSchema, - dashboard_mode: commonSchema, // It's a forward app so we'll likely never report it enterpriseSearch: commonSchema, appSearch: commonSchema, workplaceSearch: commonSchema, diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index ad19362dbf7db7..2cc16305109833 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -2136,137 +2136,6 @@ } } }, - "dashboard_mode": { - "properties": { - "appId": { - "type": "keyword", - "_meta": { - "description": "The application being tracked" - } - }, - "viewId": { - "type": "keyword", - "_meta": { - "description": "Always `main`" - } - }, - "clicks_total": { - "type": "long", - "_meta": { - "description": "General number of clicks in the application since we started counting them" - } - }, - "clicks_7_days": { - "type": "long", - "_meta": { - "description": "General number of clicks in the application over the last 7 days" - } - }, - "clicks_30_days": { - "type": "long", - "_meta": { - "description": "General number of clicks in the application over the last 30 days" - } - }, - "clicks_90_days": { - "type": "long", - "_meta": { - "description": "General number of clicks in the application over the last 90 days" - } - }, - "minutes_on_screen_total": { - "type": "float", - "_meta": { - "description": "Minutes the application is active and on-screen since we started counting them." - } - }, - "minutes_on_screen_7_days": { - "type": "float", - "_meta": { - "description": "Minutes the application is active and on-screen over the last 7 days" - } - }, - "minutes_on_screen_30_days": { - "type": "float", - "_meta": { - "description": "Minutes the application is active and on-screen over the last 30 days" - } - }, - "minutes_on_screen_90_days": { - "type": "float", - "_meta": { - "description": "Minutes the application is active and on-screen over the last 90 days" - } - }, - "views": { - "type": "array", - "items": { - "properties": { - "appId": { - "type": "keyword", - "_meta": { - "description": "The application being tracked" - } - }, - "viewId": { - "type": "keyword", - "_meta": { - "description": "The application view being tracked" - } - }, - "clicks_total": { - "type": "long", - "_meta": { - "description": "General number of clicks in the application sub view since we started counting them" - } - }, - "clicks_7_days": { - "type": "long", - "_meta": { - "description": "General number of clicks in the active application sub view over the last 7 days" - } - }, - "clicks_30_days": { - "type": "long", - "_meta": { - "description": "General number of clicks in the active application sub view over the last 30 days" - } - }, - "clicks_90_days": { - "type": "long", - "_meta": { - "description": "General number of clicks in the active application sub view over the last 90 days" - } - }, - "minutes_on_screen_total": { - "type": "float", - "_meta": { - "description": "Minutes the application sub view is active and on-screen since we started counting them." - } - }, - "minutes_on_screen_7_days": { - "type": "float", - "_meta": { - "description": "Minutes the application is active and on-screen active application sub view over the last 7 days" - } - }, - "minutes_on_screen_30_days": { - "type": "float", - "_meta": { - "description": "Minutes the application is active and on-screen active application sub view over the last 30 days" - } - }, - "minutes_on_screen_90_days": { - "type": "float", - "_meta": { - "description": "Minutes the application is active and on-screen active application sub view over the last 90 days" - } - } - } - } - } - } - }, "enterpriseSearch": { "properties": { "appId": { @@ -8487,25 +8356,6 @@ } } }, - "dashboard_mode": { - "type": "array", - "items": { - "properties": { - "key": { - "type": "keyword", - "_meta": { - "description": "The event that is tracked" - } - }, - "value": { - "type": "long", - "_meta": { - "description": "The value of the event" - } - } - } - } - }, "enterpriseSearch": { "type": "array", "items": { diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 9b98ca864f4960..b51363f1b70064 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -13,7 +13,6 @@ "xpack.dashboard": "plugins/dashboard_enhanced", "xpack.discover": "plugins/discover_enhanced", "xpack.crossClusterReplication": "plugins/cross_cluster_replication", - "xpack.dashboardMode": "plugins/dashboard_mode", "xpack.data": "plugins/data_enhanced", "xpack.embeddableEnhanced": "plugins/embeddable_enhanced", "xpack.endpoint": "plugins/endpoint", diff --git a/x-pack/plugins/dashboard_mode/README.md b/x-pack/plugins/dashboard_mode/README.md deleted file mode 100644 index 4e244afb97fdf6..00000000000000 --- a/x-pack/plugins/dashboard_mode/README.md +++ /dev/null @@ -1 +0,0 @@ -The deprecated dashboard only mode. \ No newline at end of file diff --git a/x-pack/plugins/dashboard_mode/common/constants.ts b/x-pack/plugins/dashboard_mode/common/constants.ts deleted file mode 100644 index b58afc9b663c8d..00000000000000 --- a/x-pack/plugins/dashboard_mode/common/constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * 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. - */ - -export const UI_SETTINGS = { - CONFIG_DASHBOARD_ONLY_MODE_ROLES: 'xpackDashboardMode:roles', -}; diff --git a/x-pack/plugins/dashboard_mode/common/index.ts b/x-pack/plugins/dashboard_mode/common/index.ts deleted file mode 100644 index e055aa4f577f5e..00000000000000 --- a/x-pack/plugins/dashboard_mode/common/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export { UI_SETTINGS } from './constants'; diff --git a/x-pack/plugins/dashboard_mode/jest.config.js b/x-pack/plugins/dashboard_mode/jest.config.js deleted file mode 100644 index 7d0585938d166d..00000000000000 --- a/x-pack/plugins/dashboard_mode/jest.config.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - * 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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/dashboard_mode'], -}; diff --git a/x-pack/plugins/dashboard_mode/kibana.json b/x-pack/plugins/dashboard_mode/kibana.json deleted file mode 100644 index 6fc59ce9a7fa11..00000000000000 --- a/x-pack/plugins/dashboard_mode/kibana.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "dashboardMode", - "owner": { - "name": "Kibana Presentation", - "githubTeam": "kibana-presentation" - }, - "version": "8.0.0", - "kibanaVersion": "kibana", - "configPath": ["xpack", "dashboard_mode"], - "optionalPlugins": ["security"], - "requiredPlugins": ["kibanaLegacy", "urlForwarding", "dashboard"], - "server": true, - "ui": true -} diff --git a/x-pack/plugins/dashboard_mode/public/index.ts b/x-pack/plugins/dashboard_mode/public/index.ts deleted file mode 100644 index 2418c0592acc1f..00000000000000 --- a/x-pack/plugins/dashboard_mode/public/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export { plugin } from './plugin'; diff --git a/x-pack/plugins/dashboard_mode/public/plugin.ts b/x-pack/plugins/dashboard_mode/public/plugin.ts deleted file mode 100644 index efad46ab47fe7b..00000000000000 --- a/x-pack/plugins/dashboard_mode/public/plugin.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 { trimStart } from 'lodash'; -import { CoreSetup } from 'kibana/public'; -import { KibanaLegacyStart } from '../../../../src/plugins/kibana_legacy/public'; -import { UrlForwardingStart } from '../../../../src/plugins/url_forwarding/public'; -import { - createDashboardEditUrl, - DashboardConstants, -} from '../../../../src/plugins/dashboard/public'; -import { AppNavLinkStatus } from '../../../../src/core/public'; - -function defaultUrl(defaultAppId: string) { - const isDashboardId = defaultAppId.startsWith(dashboardAppIdPrefix()); - return isDashboardId ? `/${defaultAppId}` : DashboardConstants.LANDING_PAGE_PATH; -} - -function dashboardAppIdPrefix() { - return trimStart(createDashboardEditUrl(''), '/'); -} - -function migratePath( - currentHash: string, - kibanaLegacy: KibanaLegacyStart, - urlForwarding: UrlForwardingStart -) { - if (currentHash === '' || currentHash === '#' || currentHash === '#/') { - return `#${defaultUrl(kibanaLegacy.config.defaultAppId || '')}`; - } - if (!currentHash.startsWith('#/dashboard')) { - return currentHash; - } - - const forwards = urlForwarding.getForwards(); - - if (currentHash.startsWith('#/dashboards')) { - const { rewritePath: migrateListingPath } = forwards.find( - ({ legacyAppId }) => legacyAppId === 'dashboards' - )!; - return migrateListingPath(currentHash); - } - - const { rewritePath: migrateDetailPath } = forwards.find( - ({ legacyAppId }) => legacyAppId === 'dashboard' - )!; - return migrateDetailPath(currentHash); -} - -export const plugin = () => ({ - setup(core: CoreSetup<{ kibanaLegacy: KibanaLegacyStart; urlForwarding: UrlForwardingStart }>) { - core.application.register({ - id: 'dashboard_mode', - title: 'Dashboard mode', - navLinkStatus: AppNavLinkStatus.hidden, - mount: async () => { - const [coreStart, { kibanaLegacy, urlForwarding }] = await core.getStartServices(); - kibanaLegacy.dashboardConfig.turnHideWriteControlsOn(); - coreStart.chrome.navLinks.showOnly('dashboards'); - setTimeout(() => { - coreStart.application.navigateToApp('dashboards', { - path: migratePath(window.location.hash, kibanaLegacy, urlForwarding), - }); - }, 0); - return () => {}; - }, - }); - }, - start() {}, -}); diff --git a/x-pack/plugins/dashboard_mode/server/index.ts b/x-pack/plugins/dashboard_mode/server/index.ts deleted file mode 100644 index 8be8ec09a28984..00000000000000 --- a/x-pack/plugins/dashboard_mode/server/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 { PluginConfigDescriptor, PluginInitializerContext } from 'kibana/server'; -import { schema } from '@kbn/config-schema'; - -import { DashboardModeServerPlugin } from './plugin'; - -export const config: PluginConfigDescriptor = { - schema: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - }), -}; - -export function plugin(initializerContext: PluginInitializerContext) { - return new DashboardModeServerPlugin(initializerContext); -} - -export { DashboardModeServerPlugin as Plugin }; diff --git a/x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.test.ts b/x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.test.ts deleted file mode 100644 index e2e2c8c005670f..00000000000000 --- a/x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.test.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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 { parse as parseUrl } from 'url'; -import { - OnPostAuthHandler, - OnPostAuthToolkit, - KibanaRequest, - LifecycleResponseFactory, - IUiSettingsClient, -} from 'kibana/server'; -import { coreMock } from '../../../../../src/core/server/mocks'; - -import { AuthenticatedUser } from '../../../security/server'; -import { securityMock } from '../../../security/server/mocks'; - -import { setupDashboardModeRequestInterceptor } from './dashboard_mode_request_interceptor'; - -const DASHBOARD_ONLY_MODE_ROLE = 'test_dashboard_only_mode_role'; - -describe('DashboardOnlyModeRequestInterceptor', () => { - const core = coreMock.createSetup(); - const security = securityMock.createSetup(); - - let interceptor: OnPostAuthHandler; - let toolkit: OnPostAuthToolkit; - let uiSettingsMock: any; - - beforeEach(() => { - toolkit = { - next: jest.fn(), - }; - interceptor = setupDashboardModeRequestInterceptor({ - http: core.http, - security, - getUiSettingsClient: () => - (Promise.resolve({ - get: () => Promise.resolve(uiSettingsMock), - }) as unknown) as Promise, - }); - }); - - test('should not redirects for not app/* requests', async () => { - const request = ({ - url: { - pathname: 'api/test', - }, - } as unknown) as KibanaRequest; - - interceptor(request, {} as LifecycleResponseFactory, toolkit); - - expect(toolkit.next).toHaveBeenCalled(); - }); - - test('should not redirects not authenticated users', async () => { - const request = ({ - url: { - pathname: '/app/home', - }, - } as unknown) as KibanaRequest; - - interceptor(request, {} as LifecycleResponseFactory, toolkit); - - expect(toolkit.next).toHaveBeenCalled(); - }); - - describe('request for dashboard-only user', () => { - function testRedirectToDashboardModeApp(url: string) { - describe(`requests to url:"${url}"`, () => { - test('redirects to the dashboard_mode app instead', async () => { - const { pathname, search, hash } = parseUrl(url); - const request = ({ - url: { pathname, search, hash }, - credentials: { - roles: [DASHBOARD_ONLY_MODE_ROLE], - }, - } as unknown) as KibanaRequest; - - const response = ({ - redirected: jest.fn(), - } as unknown) as LifecycleResponseFactory; - - security.authc.getCurrentUser = jest.fn( - (r: KibanaRequest) => - (({ - roles: [DASHBOARD_ONLY_MODE_ROLE], - } as unknown) as AuthenticatedUser) - ); - - uiSettingsMock = [DASHBOARD_ONLY_MODE_ROLE]; - - await interceptor(request, response, toolkit); - - expect(response.redirected).toHaveBeenCalledWith({ - headers: { location: `/mock-server-basepath/app/dashboard_mode` }, - }); - }); - }); - } - - testRedirectToDashboardModeApp('/app/kibana'); - testRedirectToDashboardModeApp('/app/kibana#/foo/bar'); - testRedirectToDashboardModeApp('/app/kibana/foo/bar'); - testRedirectToDashboardModeApp('/app/kibana?foo=bar'); - testRedirectToDashboardModeApp('/app/dashboards?foo=bar'); - testRedirectToDashboardModeApp('/app/home?foo=bar'); - }); -}); diff --git a/x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.ts b/x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.ts deleted file mode 100644 index c177d24de0009f..00000000000000 --- a/x-pack/plugins/dashboard_mode/server/interceptors/dashboard_mode_request_interceptor.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 { HttpServiceSetup, OnPostAuthHandler, IUiSettingsClient } from 'kibana/server'; -import { SecurityPluginSetup } from '../../../security/server'; -import { UI_SETTINGS } from '../../common'; - -const superuserRole = 'superuser'; - -interface DashboardModeRequestInterceptorDependencies { - http: HttpServiceSetup; - security: SecurityPluginSetup; - getUiSettingsClient: () => Promise; -} - -export const setupDashboardModeRequestInterceptor = ({ - http, - security, - getUiSettingsClient, -}: DashboardModeRequestInterceptorDependencies) => - (async (request, response, toolkit) => { - const path = request.url.pathname; - const isAppRequest = path.startsWith('/app/'); - - if (!isAppRequest) { - return toolkit.next(); - } - - const authenticatedUser = security.authc.getCurrentUser(request); - const roles = authenticatedUser?.roles || []; - - if (!authenticatedUser || roles.length === 0) { - return toolkit.next(); - } - - const uiSettings = await getUiSettingsClient(); - const dashboardOnlyModeRoles = await uiSettings.get( - UI_SETTINGS.CONFIG_DASHBOARD_ONLY_MODE_ROLES - ); - - if (!dashboardOnlyModeRoles) { - return toolkit.next(); - } - - const isDashboardOnlyModeUser = roles.find((role) => dashboardOnlyModeRoles.includes(role)); - const isSuperUser = roles.find((role) => role === superuserRole); - - const enforceDashboardOnlyMode = isDashboardOnlyModeUser && !isSuperUser; - - if (enforceDashboardOnlyMode) { - if ( - path.startsWith('/app/home') || - path.startsWith('/app/kibana') || - path.startsWith('/app/dashboards') - ) { - const dashBoardModeUrl = `${http.basePath.get(request)}/app/dashboard_mode`; - // If the user is in "Dashboard only mode" they should only be allowed to see - // the dashboard app and none others. - - return response.redirected({ - headers: { - location: dashBoardModeUrl, - }, - }); - } - - if (path.startsWith('/app/dashboard_mode')) { - // let through requests to the dashboard_mode app - return toolkit.next(); - } - - return response.notFound(); - } - - return toolkit.next(); - }) as OnPostAuthHandler; diff --git a/x-pack/plugins/dashboard_mode/server/interceptors/index.ts b/x-pack/plugins/dashboard_mode/server/interceptors/index.ts deleted file mode 100644 index 5736fb5c86e226..00000000000000 --- a/x-pack/plugins/dashboard_mode/server/interceptors/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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. - */ - -export { setupDashboardModeRequestInterceptor } from './dashboard_mode_request_interceptor'; diff --git a/x-pack/plugins/dashboard_mode/server/plugin.ts b/x-pack/plugins/dashboard_mode/server/plugin.ts deleted file mode 100644 index 2c526ba03ef561..00000000000000 --- a/x-pack/plugins/dashboard_mode/server/plugin.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 { - PluginInitializerContext, - CoreSetup, - CoreStart, - Plugin, - SavedObjectsClient, - Logger, -} from '../../../../src/core/server'; - -import { SecurityPluginSetup } from '../../security/server'; -import { setupDashboardModeRequestInterceptor } from './interceptors'; - -import { getUiSettings } from './ui_settings'; - -interface DashboardModeServerSetupDependencies { - security?: SecurityPluginSetup; -} - -export class DashboardModeServerPlugin implements Plugin { - private initializerContext: PluginInitializerContext; - private logger?: Logger; - - constructor(initializerContext: PluginInitializerContext) { - this.initializerContext = initializerContext; - } - - public setup(core: CoreSetup, { security }: DashboardModeServerSetupDependencies) { - this.logger = this.initializerContext.logger.get(); - - core.uiSettings.register(getUiSettings()); - - const getUiSettingsClient = async () => { - const [coreStart] = await core.getStartServices(); - const { savedObjects, uiSettings } = coreStart; - const savedObjectsClient = new SavedObjectsClient(savedObjects.createInternalRepository()); - - return uiSettings.asScopedToClient(savedObjectsClient); - }; - - if (security) { - const dashboardModeRequestInterceptor = setupDashboardModeRequestInterceptor({ - http: core.http, - security, - getUiSettingsClient, - }); - - core.http.registerOnPostAuth(dashboardModeRequestInterceptor); - - this.logger.debug(`registered DashboardModeRequestInterceptor`); - } - } - - public start(core: CoreStart) {} - - public stop() {} -} diff --git a/x-pack/plugins/dashboard_mode/server/ui_settings.ts b/x-pack/plugins/dashboard_mode/server/ui_settings.ts deleted file mode 100644 index a0678b7b27bdd5..00000000000000 --- a/x-pack/plugins/dashboard_mode/server/ui_settings.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 { i18n } from '@kbn/i18n'; -import { schema } from '@kbn/config-schema'; -import { UiSettingsParams } from 'kibana/server'; -import { UI_SETTINGS } from '../common'; - -const DASHBOARD_ONLY_USER_ROLE = 'kibana_dashboard_only_user'; - -export function getUiSettings(): Record> { - return { - [UI_SETTINGS.CONFIG_DASHBOARD_ONLY_MODE_ROLES]: { - name: i18n.translate('xpack.dashboardMode.uiSettings.dashboardsOnlyRolesTitle', { - defaultMessage: 'Dashboards only roles', - }), - description: i18n.translate('xpack.dashboardMode.uiSettings.dashboardsOnlyRolesDescription', { - defaultMessage: 'Roles that belong to View Dashboards Only mode', - }), - value: [DASHBOARD_ONLY_USER_ROLE], - category: ['dashboard'], - sensitive: true, - deprecation: { - message: i18n.translate('xpack.dashboardMode.uiSettings.dashboardsOnlyRolesDeprecation', { - defaultMessage: 'This setting is deprecated and will be removed in Kibana 8.0.', - }), - docLinksKey: 'dashboardSettings', - }, - schema: schema.arrayOf(schema.string()), - }, - }; -} diff --git a/x-pack/plugins/dashboard_mode/tsconfig.json b/x-pack/plugins/dashboard_mode/tsconfig.json deleted file mode 100644 index 8094e70e96b602..00000000000000 --- a/x-pack/plugins/dashboard_mode/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true, - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*" - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/dashboard/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_legacy/tsconfig.json" }, - { "path": "../../../src/plugins/url_forwarding/tsconfig.json" }, - { "path": "../security/tsconfig.json" } - ] -} diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/abstract_explore_data_action.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/abstract_explore_data_action.ts index 44ea53fe0b8706..c1c84c040f51e6 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/abstract_explore_data_action.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/abstract_explore_data_action.ts @@ -9,7 +9,6 @@ import { i18n } from '@kbn/i18n'; import { DiscoverStart } from '../../../../../../src/plugins/discover/public'; import { ViewMode, IEmbeddable } from '../../../../../../src/plugins/embeddable/public'; import { StartServicesGetter } from '../../../../../../src/plugins/kibana_utils/public'; -import { KibanaLegacyStart } from '../../../../../../src/plugins/kibana_legacy/public'; import { CoreStart } from '../../../../../../src/core/public'; import { KibanaLocation } from '../../../../../../src/plugins/share/public'; import * as shared from './shared'; @@ -18,11 +17,6 @@ export const ACTION_EXPLORE_DATA = 'ACTION_EXPLORE_DATA'; export interface PluginDeps { discover: Pick; - kibanaLegacy?: { - dashboardConfig: { - getHideWriteControls: KibanaLegacyStart['dashboardConfig']['getHideWriteControls']; - }; - }; } export interface CoreDeps { @@ -53,11 +47,6 @@ export abstract class AbstractExploreDataAction { const core = coreMock.createStart(); @@ -65,11 +63,6 @@ const setup = ( discover: { locator, }, - kibanaLegacy: { - dashboardConfig: { - getHideWriteControls: () => dashboardOnlyMode, - }, - }, }; const params: Params = { @@ -193,13 +186,6 @@ describe('"Explore underlying data" panel action', () => { expect(isCompatible).toBe(false); }); - test('return false for dashboard_only mode', async () => { - const { action, context } = setup({ dashboardOnlyMode: true }); - const isCompatible = await action.isCompatible(context); - - expect(isCompatible).toBe(false); - }); - test('returns false if Discover app is disabled', async () => { const { action, context, core } = setup(); diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts index e0a8cf20ee943d..334898ada6a3ef 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts @@ -28,7 +28,7 @@ afterEach(() => { i18nTranslateSpy.mockClear(); }); -const setup = ({ dashboardOnlyMode = false }: { dashboardOnlyMode?: boolean } = {}) => { +const setup = () => { const core = coreMock.createStart(); const locator: DiscoverAppLocator = { getLocation: jest.fn(() => @@ -51,11 +51,6 @@ const setup = ({ dashboardOnlyMode = false }: { dashboardOnlyMode?: boolean } = discover: { locator, }, - kibanaLegacy: { - dashboardConfig: { - getHideWriteControls: () => dashboardOnlyMode, - }, - }, }; const params: Params = { @@ -177,13 +172,6 @@ describe('"Explore underlying data" panel action', () => { expect(isCompatible).toBe(false); }); - test('return false for dashboard_only mode', async () => { - const { action, context } = setup({ dashboardOnlyMode: true }); - const isCompatible = await action.isCompatible(context); - - expect(isCompatible).toBe(false); - }); - test('returns false if Discover app is disabled', async () => { const { action, context, core } = setup(); diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index dcea8f43a8f54d..87d10ff1ff13bf 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7609,9 +7609,6 @@ "xpack.dashboard.drilldown.goToDashboard": "ダッシュボードに移動", "xpack.dashboard.FlyoutCreateDrilldownAction.displayName": "ドリルダウンを作成", "xpack.dashboard.panel.openFlyoutEditDrilldown.displayName": "ドリルダウンを管理", - "xpack.dashboardMode.uiSettings.dashboardsOnlyRolesDeprecation": "この設定はサポートが終了し、Kibana 8.0 では削除されます。", - "xpack.dashboardMode.uiSettings.dashboardsOnlyRolesDescription": "ダッシュボード表示専用モードのロールです", - "xpack.dashboardMode.uiSettings.dashboardsOnlyRolesTitle": "ダッシュボード専用ロール", "xpack.data.mgmt.searchSessions.actionDelete": "削除", "xpack.data.mgmt.searchSessions.actionExtend": "延長", "xpack.data.mgmt.searchSessions.actionRename": "名前を編集", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 95cd134e16f71a..0d546e6b9455a4 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7851,9 +7851,6 @@ "xpack.dashboard.drilldown.goToDashboard": "前往仪表板", "xpack.dashboard.FlyoutCreateDrilldownAction.displayName": "创建向下钻取", "xpack.dashboard.panel.openFlyoutEditDrilldown.displayName": "管理向下钻取", - "xpack.dashboardMode.uiSettings.dashboardsOnlyRolesDeprecation": "此设置已过时,将在 Kibana 8.0 中移除。", - "xpack.dashboardMode.uiSettings.dashboardsOnlyRolesDescription": "属于“仅查看仪表板”模式的角色", - "xpack.dashboardMode.uiSettings.dashboardsOnlyRolesTitle": "仅限仪表板的角色", "xpack.data.mgmt.searchSessions.actionDelete": "删除", "xpack.data.mgmt.searchSessions.actionExtend": "延长", "xpack.data.mgmt.searchSessions.actionRename": "编辑名称", diff --git a/x-pack/test/functional/apps/dashboard_mode/dashboard_empty_screen.js b/x-pack/test/functional/apps/dashboard_mode/dashboard_empty_screen.js deleted file mode 100644 index 2adf13db26250d..00000000000000 --- a/x-pack/test/functional/apps/dashboard_mode/dashboard_empty_screen.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 expect from '@kbn/expect'; - -export default function ({ getPageObjects, getService }) { - const testSubjects = getService('testSubjects'); - const esArchiver = getService('esArchiver'); - const dashboardPanelActions = getService('dashboardPanelActions'); - const PageObjects = getPageObjects(['common', 'dashboard', 'visualize', 'lens']); - - // FLAKY: https://github.com/elastic/kibana/issues/102366 - describe.skip('empty dashboard', function () { - before(async () => { - await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); - await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/lens/basic'); - await PageObjects.common.navigateToApp('dashboard'); - await PageObjects.dashboard.preserveCrossAppState(); - await PageObjects.dashboard.clickNewDashboard(); - }); - - after(async () => { - await PageObjects.dashboard.gotoDashboardLandingPage(); - }); - - it('adds Lens visualization to empty dashboard', async () => { - const title = 'Dashboard Test Lens'; - await PageObjects.lens.createAndAddLensFromDashboard({ title, redirectToOrigin: true }); - await PageObjects.dashboard.waitForRenderComplete(); - await testSubjects.exists(`embeddablePanelHeading-${title}`); - }); - - it('redirects via save and return button after edit', async () => { - await dashboardPanelActions.openContextMenu(); - await dashboardPanelActions.clickEdit(); - await PageObjects.lens.saveAndReturn(); - }); - - it('redirects via save as button after edit, renaming itself', async () => { - const newTitle = 'wowee, looks like I have a new title'; - const originalPanelCount = await PageObjects.dashboard.getPanelCount(); - await PageObjects.dashboard.waitForRenderComplete(); - await dashboardPanelActions.openContextMenu(); - await dashboardPanelActions.clickEdit(); - await PageObjects.lens.save(newTitle, false, true); - await PageObjects.dashboard.waitForRenderComplete(); - const newPanelCount = await PageObjects.dashboard.getPanelCount(); - expect(newPanelCount).to.eql(originalPanelCount); - const titles = await PageObjects.dashboard.getPanelTitles(); - expect(titles.indexOf(newTitle)).to.not.be(-1); - }); - - it('redirects via save as button after edit, adding a new panel', async () => { - const newTitle = 'wowee, my title just got cooler'; - const originalPanelCount = await PageObjects.dashboard.getPanelCount(); - await PageObjects.dashboard.waitForRenderComplete(); - await dashboardPanelActions.openContextMenu(); - await dashboardPanelActions.clickEdit(); - await PageObjects.lens.save(newTitle, true, true); - await PageObjects.dashboard.waitForRenderComplete(); - const newPanelCount = await PageObjects.dashboard.getPanelCount(); - expect(newPanelCount).to.eql(originalPanelCount + 1); - const titles = await PageObjects.dashboard.getPanelTitles(); - expect(titles.indexOf(newTitle)).to.not.be(-1); - }); - - it('loses originatingApp connection after save as when redirectToOrigin is false', async () => { - await PageObjects.dashboard.saveDashboard('empty dashboard test'); - await PageObjects.dashboard.switchToEditMode(); - const newTitle = 'wowee, my title just got cooler again'; - await PageObjects.dashboard.waitForRenderComplete(); - await dashboardPanelActions.openContextMenu(); - await dashboardPanelActions.clickEdit(); - await PageObjects.lens.save(newTitle, true, false); - await PageObjects.lens.notLinkedToOriginatingApp(); - await PageObjects.common.navigateToApp('dashboard'); - }); - - it('loses originatingApp connection after first save when redirectToOrigin is false', async () => { - const title = 'non-dashboard Test Lens'; - await PageObjects.dashboard.loadSavedDashboard('empty dashboard test'); - await PageObjects.dashboard.switchToEditMode(); - await PageObjects.lens.createAndAddLensFromDashboard({ title }); - await PageObjects.lens.notLinkedToOriginatingApp(); - await PageObjects.common.navigateToApp('dashboard'); - }); - }); -} diff --git a/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js b/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js deleted file mode 100644 index af7d16969c6058..00000000000000 --- a/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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 expect from '@kbn/expect'; - -export default function ({ getService, getPageObjects }) { - const kibanaServer = getService('kibanaServer'); - const esArchiver = getService('esArchiver'); - const browser = getService('browser'); - const log = getService('log'); - const pieChart = getService('pieChart'); - const security = getService('security'); - const testSubjects = getService('testSubjects'); - const dashboardPanelActions = getService('dashboardPanelActions'); - const appsMenu = getService('appsMenu'); - const filterBar = getService('filterBar'); - const PageObjects = getPageObjects([ - 'security', - 'common', - 'discover', - 'dashboard', - 'header', - 'settings', - 'timePicker', - 'share', - ]); - const dashboardName = 'Dashboard View Mode Test Dashboard'; - - describe('Dashboard View Mode', function () { - this.tags(['skipFirefox']); - - before('initialize tests', async () => { - log.debug('Dashboard View Mode:initTests'); - await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); - await kibanaServer.importExport.load( - 'x-pack/test/functional/fixtures/kbn_archiver/dashboard_view_mode' - ); - await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' }); - await browser.setWindowSize(1600, 1000); - - await PageObjects.common.navigateToApp('dashboard'); - }); - - after(async () => { - await kibanaServer.importExport.unload( - 'x-pack/test/functional/fixtures/kbn_archiver/dashboard_view_mode' - ); - const types = [ - 'search', - 'dashboard', - 'visualization', - 'search-session', - 'core-usage-stats', - 'event_loop_delays_daily', - 'search-telemetry', - 'core-usage-stats', - ]; - await kibanaServer.savedObjects.clean({ types }); - }); - - // FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/109351 - describe.skip('Dashboard viewer', () => { - after(async () => { - await security.testUser.restoreDefaults(); - }); - - it('shows only the dashboard app link', async () => { - await security.testUser.setRoles(['test_logstash_reader', 'kibana_dashboard_only_user']); - await PageObjects.header.waitUntilLoadingHasFinished(); - const appLinks = await appsMenu.readLinks(); - expect(appLinks).to.have.length(1); - expect(appLinks[0]).to.have.property('text', 'Dashboard'); - }); - - it('shows the dashboard landing page by default', async () => { - const currentUrl = await browser.getCurrentUrl(); - console.log('url: ', currentUrl); - expect(currentUrl).to.contain('dashboards'); - }); - - it('does not show the create dashboard button', async () => { - const createNewButtonExists = await testSubjects.exists('newItemButton'); - expect(createNewButtonExists).to.be(false); - }); - - it('opens a dashboard up', async () => { - await PageObjects.dashboard.loadSavedDashboard(dashboardName); - const onDashboardLandingPage = await PageObjects.dashboard.onDashboardLandingPage(); - expect(onDashboardLandingPage).to.be(false); - }); - - it('can filter on a visualization', async () => { - await PageObjects.timePicker.setHistoricalDataRange(); - await pieChart.filterOnPieSlice(); - const filterCount = await filterBar.getFilterCount(); - expect(filterCount).to.equal(1); - }); - - it('shows the full screen menu item', async () => { - const fullScreenMenuItemExists = await testSubjects.exists('dashboardFullScreenMode'); - expect(fullScreenMenuItemExists).to.be(true); - }); - - it('does not show the edit menu item', async () => { - const editMenuItemExists = await testSubjects.exists('dashboardEditMode'); - expect(editMenuItemExists).to.be(false); - }); - - it('does not show the view menu item', async () => { - const viewMenuItemExists = await testSubjects.exists('dashboardViewOnlyMode'); - expect(viewMenuItemExists).to.be(false); - }); - - it('does not show the reporting menu item', async () => { - const reportingMenuItemExists = await testSubjects.exists('topNavReportingLink'); - expect(reportingMenuItemExists).to.be(false); - }); - - it('shows the sharing menu item', async () => { - const shareMenuItemExists = await testSubjects.exists('shareTopNavButton'); - expect(shareMenuItemExists).to.be(true); - }); - - it(`Permalinks doesn't show create short-url button`, async () => { - await PageObjects.share.openShareMenuItem('Permalinks'); - await PageObjects.share.createShortUrlMissingOrFail(); - }); - - it('does not show the visualization edit icon', async () => { - await dashboardPanelActions.expectMissingEditPanelAction(); - }); - - it('does not show the visualization delete icon', async () => { - await dashboardPanelActions.expectMissingRemovePanelAction(); - }); - - it('shows the timepicker', async () => { - const timePickerExists = await PageObjects.timePicker.timePickerExists(); - expect(timePickerExists).to.be(true); - }); - - it('can paginate on a saved search', async () => { - await PageObjects.dashboard.expectToolbarPaginationDisplayed({ displayed: true }); - }); - - it('is loaded for a user who is assigned a non-dashboard mode role', async () => { - await security.testUser.setRoles([ - 'test_logstash_reader', - 'kibana_dashboard_only_user', - 'kibana_admin', - ]); - await PageObjects.header.waitUntilLoadingHasFinished(); - - if (await appsMenu.linkExists('Stack Management')) { - throw new Error('Expected management nav link to not be shown'); - } - }); - - it('is not loaded for a user who is assigned a superuser role', async () => { - await security.testUser.setRoles(['kibana_dashboard_only_user', 'superuser']); - await PageObjects.header.waitUntilLoadingHasFinished(); - - if (!(await appsMenu.linkExists('Stack Management'))) { - throw new Error('Expected management nav link to be shown'); - } - }); - }); - }); -} diff --git a/x-pack/test/functional/apps/dashboard_mode/index.js b/x-pack/test/functional/apps/dashboard_mode/index.js deleted file mode 100644 index c28b805dc6b23f..00000000000000 --- a/x-pack/test/functional/apps/dashboard_mode/index.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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. - */ - -export default function ({ loadTestFile }) { - describe('dashboard mode', function () { - this.tags('ciGroup7'); - - loadTestFile(require.resolve('./dashboard_view_mode')); - loadTestFile(require.resolve('./dashboard_empty_screen')); - }); -} diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 704ce819b5b382..c8822b62ebd812 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -29,7 +29,6 @@ export default async function ({ readConfigFile }) { resolve(__dirname, './apps/monitoring'), resolve(__dirname, './apps/watcher'), resolve(__dirname, './apps/dashboard'), - resolve(__dirname, './apps/dashboard_mode'), resolve(__dirname, './apps/discover'), resolve(__dirname, './apps/security'), resolve(__dirname, './apps/spaces'), diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 1bfd24d6ad29db..0744af0776597f 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -54,7 +54,6 @@ { "path": "../plugins/banners/tsconfig.json" }, { "path": "../plugins/cases/tsconfig.json" }, { "path": "../plugins/cloud/tsconfig.json" }, - { "path": "../plugins/dashboard_mode/tsconfig.json" }, { "path": "../plugins/enterprise_search/tsconfig.json" }, { "path": "../plugins/fleet/tsconfig.json" }, { "path": "../plugins/global_search/tsconfig.json" },