diff --git a/src/plugins/vis_augmenter/public/index.ts b/src/plugins/vis_augmenter/public/index.ts index f89d8362db9b..1fba945ae82d 100644 --- a/src/plugins/vis_augmenter/public/index.ts +++ b/src/plugins/vis_augmenter/public/index.ts @@ -11,10 +11,6 @@ export function plugin(initializerContext: PluginInitializerContext) { } export { VisAugmenterSetup, VisAugmenterStart }; -export { - SavedAugmentVisLoader, - createSavedAugmentVisLoader, - createAugmentVisSavedObject, -} from './saved_augment_vis'; +export * from './saved_augment_vis'; export { ISavedAugmentVis, VisLayerExpressionFn, AugmentVisSavedObject } from './types'; diff --git a/src/plugins/vis_augmenter/public/saved_augment_vis/_saved_augment_vis.ts b/src/plugins/vis_augmenter/public/saved_augment_vis/_saved_augment_vis.ts index c17d0745061d..17b787b485c0 100644 --- a/src/plugins/vis_augmenter/public/saved_augment_vis/_saved_augment_vis.ts +++ b/src/plugins/vis_augmenter/public/saved_augment_vis/_saved_augment_vis.ts @@ -51,6 +51,8 @@ export function createSavedAugmentVisClass(services: SavedObjectOpenSearchDashbo version: 1, }, }); + // TODO: determine if this saved obj should be visible in saved_obj_management plugin. + // if not, we can set showInRecentlyAccessed to false and not persist any edit URL // probably set to false since this saved obj should be hidden by default this.showInRecentlyAccessed = false; diff --git a/src/plugins/vis_augmenter/public/saved_augment_vis/saved_augment_vis.ts b/src/plugins/vis_augmenter/public/saved_augment_vis/saved_augment_vis.ts index 6819af5c3904..2b58807310db 100644 --- a/src/plugins/vis_augmenter/public/saved_augment_vis/saved_augment_vis.ts +++ b/src/plugins/vis_augmenter/public/saved_augment_vis/saved_augment_vis.ts @@ -10,15 +10,9 @@ import { } from '../../../saved_objects/public'; import { createSavedAugmentVisClass } from './_saved_augment_vis'; -// currently visualizations have a 'vis_types' plugin that maintains all of the -// different vis types. in the saved vis loader, those types are then imported here, -// such that if a type returned by the client isn't in the list, the request is -// rejected. essentially just post-processing of the returned obj. We may do something -// same for the vis integration augment fn types, since we will have a set list -// of eligible augment fn types for plugins to choose from, when creating their saved objs. -// -// for now, and until it's determined where this code will live (separate plugin, within -// dashboards, etc.), we will not enforce the fn types. +// TODO: determine if there should be added enforcement on the augment fn types, and reject +// saved objs that don't have a valid one. Currently, visualizations does something similar +// in the saved vis loader. // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface SavedObjectOpenSearchDashboardsServicesWithAugmentVis @@ -30,9 +24,9 @@ export function createSavedAugmentVisLoader( const { savedObjectsClient } = services; class SavedObjectLoaderAugmentVis extends SavedObjectLoader { - // this is doing a lightweight version of injectReferences - // essentially we want to inject the saved object id/type - // by fetching the saved object reference and parsing out the id/type + // TODO: below fn is extracting the id & type from the source. Is this needed + // when we already have inject/extract reference fns? + // need to confirm if this codepath is different than the ones using the reference fns mapHitSource = (source: Record, id: string) => { source.id = id; source.savedObjectId = get(source, 'savedObjectReference.id', ''); diff --git a/src/plugins/vis_augmenter/public/types.ts b/src/plugins/vis_augmenter/public/types.ts index 883a85f6e494..790357067f58 100644 --- a/src/plugins/vis_augmenter/public/types.ts +++ b/src/plugins/vis_augmenter/public/types.ts @@ -10,6 +10,8 @@ export interface ISavedAugmentVis { description?: string; pluginResourceId: string; savedObjectName?: string; + // TODO: we may be able to remove savedObjectType field now that it's always assumed + // it will be a visualization savedObjectType?: string; savedObjectId?: string; visLayerExpressionFn: VisLayerExpressionFn; diff --git a/yarn.lock b/yarn.lock index b40434b8fc20..822684d097bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16566,6 +16566,11 @@ strip-json-comments@3.1.1, strip-json-comments@^3.0.1, strip-json-comments@^3.1. resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + strong-log-transformer@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10"