Skip to content

Commit

Permalink
explorereFields type fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Ramneet Chopra <ramneet_chopra@persistent.com>
  • Loading branch information
ramneet-persistent committed Sep 19, 2022
1 parent 1b30e6e commit c909d01
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
7 changes: 7 additions & 0 deletions dashboards-observability/common/types/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export interface IField {
label?: string;
}

export interface ExplorerFields {
availableFields: IField[];
queriedFields: IField[];
selectedFields: IField[];
unselectedFields: IField[];
}

export interface ITabQueryResults {
[tabId: string]: any;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import { isEmpty } from 'lodash';
import React, { useContext } from 'react';
import { EuiPanel, EuiResizableContainer, EuiSpacer } from '@elastic/eui';
import { RAW_QUERY, SELECTED_TIMESTAMP } from '../../../../../common/constants/explorer';
import { IField, IQuery, IVisualizationContainerProps } from '../../../../../common/types/explorer';
import {
IField,
IQuery,
IVisualizationContainerProps,
ExplorerFields,
} from '../../../../../common/types/explorer';
import { WorkspacePanel } from './workspace_panel';
import { ConfigPanel } from './config_panel';
import { Sidebar } from '../sidebar';
Expand All @@ -24,7 +29,7 @@ interface IExplorerVisualizationsProps {
curVisId: string;
setCurVisId: (visId: string) => void;
explorerVis: any;
explorerFields: IField[];
explorerFields: ExplorerFields;
explorerData: any;
handleAddField: (field: IField) => void;
handleRemoveField: (field: IField) => void;
Expand Down Expand Up @@ -53,10 +58,10 @@ export const ExplorerVisualizations = ({
const { tabId } = useContext<any>(TabContext);
const { data, vis } = visualizations;
const { data: vizData = {}, metadata: { fields = [] } = {} } = data?.rawVizData;
const fieldOptionList = explorerFields.availableFields.map((field) => {
// const fieldOptionList = fields.map((field) => {
return { ...field, label: field.name };
});
const fieldOptionList = explorerFields.availableFields.map((field) => ({
...field,
label: field.name,
}));

const renderDataConfigContainer = () => {
switch (curVisId) {
Expand Down

0 comments on commit c909d01

Please sign in to comment.