Skip to content

Commit

Permalink
set vislayerresourceids on input
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Mar 13, 2023
1 parent 244a8e1 commit 777038f
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export class VisualizeEmbeddable
>;
private savedVisualizationsLoader?: SavedVisualizationsLoader;
private savedAugmentVisLoader?: SavedAugmentVisLoader;
public visLayerResourceIds?: string[];
public visLayers?: VisLayer[];

constructor(
Expand Down Expand Up @@ -174,6 +175,7 @@ export class VisualizeEmbeddable
this.attributeService = attributeService;
this.savedVisualizationsLoader = savedVisualizationsLoader;
this.savedAugmentVisLoader = savedAugmentVisLoader;
this.visLayerResourceIds = initialInput.visLayerResourceIds;
this.autoRefreshFetchSubscription = timefilter
.getAutoRefreshFetch$()
.subscribe(this.updateHandler.bind(this));
Expand Down Expand Up @@ -440,7 +442,16 @@ export class VisualizeEmbeddable
],
},
] as PointInTimeEventsVisLayer[];
this.visLayers = visLayers;

// If visLayerResourceIds is defined on the input, then filter out the found
// VisLayers to only include ones in that specified list.
// By default, do no filtering.
this.visLayers =
this.visLayerResourceIds === undefined
? visLayers
: visLayers.filter((visLayer) =>
this.visLayerResourceIds?.includes(visLayer.pluginResource.id)
);

this.expression = await buildPipeline(this.vis, {
timefilter: this.timefilter,
Expand Down

0 comments on commit 777038f

Please sign in to comment.