elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.63k stars 8.22k forks source link

[lens] LensSavedObjectAttributes declared in 2 places with 2 different definitions #177041

Open nreese opened 9 months ago

nreese commented 9 months ago

LensSavedObjectAttributes declared in 2 places with 2 different definitions. Duplicate definition should be replaced or renamed with comment to avoid confusion.

https://github.com/elastic/kibana/blob/main/x-pack/plugins/lens/common/content_management/v1/types.ts#L36

export type LensSavedObjectAttributes = {
  title: string;
  description?: string;
  visualizationType: string | null;
  state?: unknown;
};

https://github.com/elastic/kibana/blob/main/x-pack/plugins/lens/public/embeddable/embeddable.tsx#L147

export type LensSavedObjectAttributes = Omit<Document, 'savedObjectId' | 'type'>;

export interface Document {
  savedObjectId?: string;
  type?: string;
  visualizationType: string | null;
  title: string;
  description?: string;
  state: {
    datasourceStates: Record<string, unknown>;
    visualization: unknown;
    query: Query;
    globalPalette?: {
      activePaletteId: string;
      state?: unknown;
    };
    filters: Filter[];
    adHocDataViews?: Record<string, DataViewSpec>;
    internalReferences?: SavedObjectReference[];
  };
  references: SavedObjectReference[];
}
elasticmachine commented 9 months ago

Pinging @elastic/kibana-visualizations (Team:Visualizations)