Skip to content

Commit

Permalink
lint issues plus address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
  • Loading branch information
lezzago committed Jun 19, 2023
1 parent 70911d8 commit 95c957b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/plugins/vis_type_vislib/public/line_to_expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
LineVegaSpecExpressionFunctionDefinition,
} from '../../vis_type_vega/public';
import { isEligibleForVisLayers, VisAugmenterEmbeddableConfig } from '../../vis_augmenter/public';
import { getUISettings } from './services';

export const toExpressionAst = async (vis: Vis, params: any) => {
// Construct the existing expr fns that are ran for vislib line chart, up until the render fn.
Expand All @@ -33,7 +32,7 @@ export const toExpressionAst = async (vis: Vis, params: any) => {
if (
params.visLayers == null ||
Object.keys(params.visLayers).length === 0 ||
!isEligibleForVisLayers(vis, getUISettings())
!isEligibleForVisLayers(vis)
) {
// Render using vislib instead of vega-lite
const visConfig = { ...vis.params, dimensions };
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/vis_type_vislib/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import {
} from './vis_type_vislib_vis_types';
import { ChartsPluginSetup } from '../../charts/public';
import { DataPublicPluginStart } from '../../data/public';
import { setFormatService, setDataActions, setOpenSearchDashboardsLegacy, setUISettings } from './services';
import { setFormatService, setDataActions, setOpenSearchDashboardsLegacy } from './services';
import { OpenSearchDashboardsLegacyStart } from '../../opensearch_dashboards_legacy/public';

export interface VisTypeVislibDependencies {
Expand Down Expand Up @@ -91,7 +91,6 @@ export class VisTypeVislibPlugin implements Plugin<void, void> {
uiSettings: core.uiSettings,
charts,
};
setUISettings(core.uiSettings);
const vislibTypes = [
createHistogramVisTypeDefinition,
createLineVisTypeDefinition,
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/vis_type_vislib/public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import { createGetterSetter } from '../../opensearch_dashboards_utils/public';
import { DataPublicPluginStart } from '../../data/public';
import { OpenSearchDashboardsLegacyStart } from '../../opensearch_dashboards_legacy/public';
import { IUiSettingsClient } from 'opensearch-dashboards/public';

export const [getDataActions, setDataActions] = createGetterSetter<
DataPublicPluginStart['actions']
Expand All @@ -44,5 +43,3 @@ export const [getFormatService, setFormatService] = createGetterSetter<
export const [getOpenSearchDashboardsLegacy, setOpenSearchDashboardsLegacy] = createGetterSetter<
OpenSearchDashboardsLegacyStart
>('vislib opensearchDashboardsLegacy');

export const [getUISettings, setUISettings] = createGetterSetter<IUiSettingsClient>('UISettings');
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
} from '../../../expressions/public';
import { buildPipeline } from '../legacy/build_pipeline';
import { Vis, SerializedVis } from '../vis';
import { getExpressions, getNotifications, getUiActions, getUISettings } from '../services';
import { getExpressions, getNotifications, getUiActions } from '../services';
import { VIS_EVENT_TO_TRIGGER } from './events';
import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory';
import { TriggerId } from '../../../ui_actions/public';
Expand Down Expand Up @@ -533,7 +533,7 @@ export class VisualizeEmbeddable
this.savedAugmentVisLoader
);

if (!isEmpty(augmentVisSavedObjs) && !aborted && isEligibleForVisLayers(this.vis, getUISettings())) {
if (!isEmpty(augmentVisSavedObjs) && !aborted && isEligibleForVisLayers(this.vis)) {
const visLayersPipeline = buildPipelineFromAugmentVisSavedObjs(augmentVisSavedObjs);
// The initial input for the pipeline will just be an empty arr of VisLayers. As plugin
// expression functions are ran, they will incrementally append their generated VisLayers to it.
Expand Down

0 comments on commit 95c957b

Please sign in to comment.