diff --git a/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap b/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap index bbbaeb6cf..5340e2d02 100644 --- a/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap +++ b/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap @@ -531,11 +531,11 @@ exports[`Added Integration View Test Renders added integration view using dummy >
`${BASE_URL}/${obj.id}/edit`, - viewUrlPathFn: (obj: SavedObject) => `${BASE_URL}/${obj.id}`, - createLinkText: 'Observability Dashboard', - createSortText: 'Observability Dashboard', - createUrl: `${BASE_URL}/create`, - }); + // if MDS is not enabled register observability dashboards & PPL visualizations in core + if (!setupDeps.dataSource) { + const BASE_URL = core.http.basePath.prepend('/app/observability-dashboards#'); + setupDeps.dashboard.registerDashboardProvider({ + appId: 'observability-panel', + savedObjectsType: 'observability-panel', + savedObjectsName: 'Observability', + editUrlPathFn: (obj: SavedObject) => `${BASE_URL}/${obj.id}/edit`, + viewUrlPathFn: (obj: SavedObject) => `${BASE_URL}/${obj.id}`, + createLinkText: 'Observability Dashboard', + createSortText: 'Observability Dashboard', + createUrl: `${BASE_URL}/create`, + }); + + setupDeps.visualizations.registerAlias({ + name: OBSERVABILITY_EMBEDDABLE_ID, + title: OBSERVABILITY_EMBEDDABLE_DISPLAY_NAME, + description: OBSERVABILITY_EMBEDDABLE_DESCRIPTION, + icon: OBSERVABILITY_EMBEDDABLE_ICON, + aliasApp: observabilityLogsID, + aliasPath: `#/explorer/?${CREATE_TAB_PARAM_KEY}=${CREATE_TAB_PARAM[TAB_CHART_ID]}`, + stage: 'production', + appExtensions: { + visualizations: { + docTypes: [VISUALIZATION_SAVED_OBJECT], + toListItem: ({ id, attributes, updated_at: updatedAt }) => ({ + description: attributes?.description, + editApp: observabilityLogsID, + editUrl: `#/explorer/${VISUALIZATION_SAVED_OBJECT}:${id}`, + icon: OBSERVABILITY_EMBEDDABLE_ICON, + id, + savedObjectType: VISUALIZATION_SAVED_OBJECT, + title: attributes?.title, + typeTitle: OBSERVABILITY_EMBEDDABLE_DISPLAY_NAME, + stage: 'production', + updated_at: updatedAt, + }), + }, + }, + }); + } const OBSERVABILITY_APP_CATEGORIES: Record = Object.freeze({ observability: { @@ -401,34 +431,6 @@ export class ObservabilityPlugin })); setupDeps.embeddable.registerEmbeddableFactory(OBSERVABILITY_EMBEDDABLE, embeddableFactory); - if (!setupDeps.dataSource) - setupDeps.visualizations.registerAlias({ - name: OBSERVABILITY_EMBEDDABLE_ID, - title: OBSERVABILITY_EMBEDDABLE_DISPLAY_NAME, - description: OBSERVABILITY_EMBEDDABLE_DESCRIPTION, - icon: OBSERVABILITY_EMBEDDABLE_ICON, - aliasApp: observabilityLogsID, - aliasPath: `#/explorer/?${CREATE_TAB_PARAM_KEY}=${CREATE_TAB_PARAM[TAB_CHART_ID]}`, - stage: 'production', - appExtensions: { - visualizations: { - docTypes: [VISUALIZATION_SAVED_OBJECT], - toListItem: ({ id, attributes, updated_at: updatedAt }) => ({ - description: attributes?.description, - editApp: observabilityLogsID, - editUrl: `#/explorer/${VISUALIZATION_SAVED_OBJECT}:${id}`, - icon: OBSERVABILITY_EMBEDDABLE_ICON, - id, - savedObjectType: VISUALIZATION_SAVED_OBJECT, - title: attributes?.title, - typeTitle: OBSERVABILITY_EMBEDDABLE_DISPLAY_NAME, - stage: 'production', - updated_at: updatedAt, - }), - }, - }, - }); - registerAsssitantDependencies(setupDeps.assistantDashboards); // Return methods that should be available to other plugins