diff --git a/src/plugins/navigation_embeddable/common/constants.ts b/src/plugins/navigation_embeddable/common/constants.ts index 46710d86f05f3..9731275e04f14 100644 --- a/src/plugins/navigation_embeddable/common/constants.ts +++ b/src/plugins/navigation_embeddable/common/constants.ts @@ -12,8 +12,6 @@ export const LATEST_VERSION = 1; export const CONTENT_ID = 'navigation_embeddable'; -export const NAVIGATION_EMBEDDABLE_TYPE = 'navigation'; - export const APP_ICON = 'link'; export const APP_NAME = i18n.translate('navigationEmbeddable.visTypeAlias.title', { diff --git a/src/plugins/navigation_embeddable/common/index.ts b/src/plugins/navigation_embeddable/common/index.ts index 1c5c974297430..9cb4fc42124aa 100644 --- a/src/plugins/navigation_embeddable/common/index.ts +++ b/src/plugins/navigation_embeddable/common/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { CONTENT_ID, LATEST_VERSION } from './constants'; +export { APP_ICON, APP_NAME, CONTENT_ID, LATEST_VERSION } from './constants'; diff --git a/src/plugins/navigation_embeddable/public/embeddable/navigation_embeddable.tsx b/src/plugins/navigation_embeddable/public/embeddable/navigation_embeddable.tsx index 7bb50eb9aa04a..58a665488b825 100644 --- a/src/plugins/navigation_embeddable/public/embeddable/navigation_embeddable.tsx +++ b/src/plugins/navigation_embeddable/public/embeddable/navigation_embeddable.tsx @@ -27,7 +27,7 @@ import { import { NavigationEmbeddableComponent } from '../components/navigation_embeddable_component'; import { NavigationEmbeddableInput, NavigationEmbeddableOutput } from './types'; import { NavigationEmbeddableAttributes } from '../../common/content_management'; -import { NAVIGATION_EMBEDDABLE_TYPE } from '../../common/constants'; +import { CONTENT_ID } from '../../common'; export const NavigationEmbeddableContext = createContext(null); export const useNavigationEmbeddable = (): NavigationEmbeddable => { @@ -55,7 +55,7 @@ export class NavigationEmbeddable NavigationEmbeddableByReferenceInput > { - public readonly type = NAVIGATION_EMBEDDABLE_TYPE; + public readonly type = CONTENT_ID; deferEmbeddableLoad = true; private isDestroyed?: boolean; @@ -107,7 +107,7 @@ export class NavigationEmbeddable } private async initializeSavedLinks(input: NavigationEmbeddableInput) { - const { metaInfo, attributes } = await this.attributeService.unwrapAttributes(input); + const { attributes } = await this.attributeService.unwrapAttributes(input); if (this.isDestroyed) return; // TODO handle metaInfo diff --git a/src/plugins/navigation_embeddable/public/embeddable/navigation_embeddable_factory.ts b/src/plugins/navigation_embeddable/public/embeddable/navigation_embeddable_factory.ts index f2c2fc98cec6c..9711c81b64125 100644 --- a/src/plugins/navigation_embeddable/public/embeddable/navigation_embeddable_factory.ts +++ b/src/plugins/navigation_embeddable/public/embeddable/navigation_embeddable_factory.ts @@ -25,7 +25,7 @@ import { import type { NavigationEmbeddable } from './navigation_embeddable'; import { coreServices, untilPluginStartServicesReady } from '../services/kibana_services'; import { getNavigationEmbeddableAttributeService } from '../services/attribute_service'; -import { APP_ICON, APP_NAME, CONTENT_ID, NAVIGATION_EMBEDDABLE_TYPE } from '../../common/constants'; +import { APP_ICON, APP_NAME, CONTENT_ID } from '../../common'; export type NavigationEmbeddableFactory = EmbeddableFactory; @@ -45,7 +45,7 @@ const getDefaultNavigationEmbeddableInput = (): Omit { - public readonly type = NAVIGATION_EMBEDDABLE_TYPE; + public readonly type = CONTENT_ID; public readonly isContainerType = false; @@ -59,7 +59,7 @@ export class NavigationEmbeddableFactoryDefinition // public inject: EmbeddablePersistableStateService['inject']; // public extract: EmbeddablePersistableStateService['extract']; - constructor(private readonly persistableStateService: EmbeddablePersistableStateService) { + constructor(persistableStateService: EmbeddablePersistableStateService) { // this.inject = createInject(this.persistableStateService); // this.extract = createExtract(this.persistableStateService); } diff --git a/src/plugins/navigation_embeddable/public/plugin.ts b/src/plugins/navigation_embeddable/public/plugin.ts index f039fec96dd1a..8863c4393b058 100644 --- a/src/plugins/navigation_embeddable/public/plugin.ts +++ b/src/plugins/navigation_embeddable/public/plugin.ts @@ -14,8 +14,8 @@ import { import { DashboardStart } from '@kbn/dashboard-plugin/public'; import { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; import { NavigationEmbeddableFactoryDefinition } from './embeddable'; -import { CONTENT_ID, LATEST_VERSION } from '../common/content_management'; -import { APP_NAME, NAVIGATION_EMBEDDABLE_TYPE } from '../common/constants'; +import { CONTENT_ID, LATEST_VERSION } from '../common'; +import { APP_NAME } from '../common'; import { setKibanaServices } from './services/kibana_services'; export interface NavigationEmbeddableSetupDependencies { @@ -46,7 +46,7 @@ export class NavigationEmbeddablePlugin ) { core.getStartServices().then(([_, deps]) => { plugins.embeddable.registerEmbeddableFactory( - NAVIGATION_EMBEDDABLE_TYPE, + CONTENT_ID, new NavigationEmbeddableFactoryDefinition(deps.embeddable) ); diff --git a/src/plugins/navigation_embeddable/public/services/attribute_service.ts b/src/plugins/navigation_embeddable/public/services/attribute_service.ts index a2d964fc0d3e1..7a7dbfe2bd139 100644 --- a/src/plugins/navigation_embeddable/public/services/attribute_service.ts +++ b/src/plugins/navigation_embeddable/public/services/attribute_service.ts @@ -17,7 +17,7 @@ import { } from '../embeddable/types'; import { embeddableService } from './kibana_services'; import { checkForDuplicateTitle, navigationEmbeddableClient } from '../content_management'; -import { NAVIGATION_EMBEDDABLE_TYPE } from '../../common/constants'; +import { CONTENT_ID } from '../../common'; export type NavigationEmbeddableDocument = NavigationEmbeddableAttributes & { references?: Reference[]; @@ -43,7 +43,7 @@ export function getNavigationEmbeddableAttributeService(): NavigationEmbeddableA NavigationEmbeddableByValueInput, NavigationEmbeddableByReferenceInput, NavigationEmbeddableUnwrapMetaInfo - >(NAVIGATION_EMBEDDABLE_TYPE, { + >(CONTENT_ID, { saveMethod: async (attributes: NavigationEmbeddableDocument, savedObjectId?: string) => { // TODO extract references const { diff --git a/src/plugins/navigation_embeddable/server/content_management/navigation_embeddable_storage.ts b/src/plugins/navigation_embeddable/server/content_management/navigation_embeddable_storage.ts index c2a19e0ff2496..07318f62a3e10 100644 --- a/src/plugins/navigation_embeddable/server/content_management/navigation_embeddable_storage.ts +++ b/src/plugins/navigation_embeddable/server/content_management/navigation_embeddable_storage.ts @@ -7,8 +7,8 @@ */ import { SOContentStorage } from '@kbn/content-management-utils'; -import type { NavigationEmbeddableCrudTypes } from '../../common/content_management'; import { CONTENT_ID } from '../../common'; +import type { NavigationEmbeddableCrudTypes } from '../../common/content_management'; import { cmServicesDefinition } from '../../common/content_management/cm_services'; export class NavigationEmbeddableStorage extends SOContentStorage { diff --git a/src/plugins/navigation_embeddable/server/plugin.ts b/src/plugins/navigation_embeddable/server/plugin.ts index 8594c70ebbd63..05e3ca79f9971 100644 --- a/src/plugins/navigation_embeddable/server/plugin.ts +++ b/src/plugins/navigation_embeddable/server/plugin.ts @@ -9,9 +9,9 @@ import { CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; import type { ContentManagementServerSetup } from '@kbn/content-management-plugin/server'; import { CONTENT_ID, LATEST_VERSION } from '../common'; +import { NavigationEmbeddableAttributes } from '../common/content_management'; import { NavigationEmbeddableStorage } from './content_management'; import { navigationEmbeddableSavedObjectType } from './saved_objects'; -import { NavigationEmbeddableAttributes } from '../common/content_management'; export class NavigationEmbeddableServerPlugin implements Plugin { public setup( diff --git a/src/plugins/navigation_embeddable/server/saved_objects/navigation_embeddable.ts b/src/plugins/navigation_embeddable/server/saved_objects/navigation_embeddable.ts index e6d13c0fad67f..0a2bfbd97897a 100644 --- a/src/plugins/navigation_embeddable/server/saved_objects/navigation_embeddable.ts +++ b/src/plugins/navigation_embeddable/server/saved_objects/navigation_embeddable.ts @@ -8,8 +8,7 @@ import type { SavedObjectsType } from '@kbn/core/server'; import { ANALYTICS_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; -import { CONTENT_ID } from '../../common'; -import { APP_ICON } from '../../common/constants'; +import { APP_ICON, CONTENT_ID } from '../../common'; export const navigationEmbeddableSavedObjectType: SavedObjectsType = { name: CONTENT_ID,