From 31c4d347f56fa8b16e5330413c6e04f37b43d018 Mon Sep 17 00:00:00 2001 From: ebb-tide Date: Tue, 12 Jun 2018 11:01:11 -0700 Subject: [PATCH] Remove redundant FieldName in favor of FieldOption interface --- ui/src/dashboards/actions/cellEditorOverlay.ts | 11 ++++++++--- ui/src/dashboards/components/Visualization.tsx | 4 ++-- ui/src/types/dashboard.ts | 10 ++-------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ui/src/dashboards/actions/cellEditorOverlay.ts b/ui/src/dashboards/actions/cellEditorOverlay.ts index 564afa75f7..aacb7a4a78 100644 --- a/ui/src/dashboards/actions/cellEditorOverlay.ts +++ b/ui/src/dashboards/actions/cellEditorOverlay.ts @@ -1,7 +1,12 @@ import {Cell} from 'src/types' import {CellType} from 'src/types/dashboard' import {ColorNumber, ColorString} from 'src/types/colors' -import {Axes, DecimalPlaces, FieldName, TableOptions} from 'src/types/dashboard' +import { + Axes, + DecimalPlaces, + FieldOption, + TableOptions, +} from 'src/types/dashboard' interface ShowCellEditorOverlayAction { type: 'SHOW_CELL_EDITOR_OVERLAY' @@ -172,11 +177,11 @@ export const changeDecimalPlaces = ( interface UpdateFieldOptionsAction { type: 'UPDATE_FIELD_OPTIONS' payload: { - fieldOptions: FieldName[] + fieldOptions: FieldOption[] } } export const updateFieldOptions = ( - fieldOptions: FieldName[] + fieldOptions: FieldOption[] ): UpdateFieldOptionsAction => ({ type: 'UPDATE_FIELD_OPTIONS', payload: { diff --git a/ui/src/dashboards/components/Visualization.tsx b/ui/src/dashboards/components/Visualization.tsx index 772f118866..ddbbc13b93 100644 --- a/ui/src/dashboards/components/Visualization.tsx +++ b/ui/src/dashboards/components/Visualization.tsx @@ -13,7 +13,7 @@ import {TimeRange, QueryConfig, Axes, Template, Source} from 'src/types' import { TableOptions, DecimalPlaces, - FieldName, + FieldOption, CellType, } from 'src/types/dashboard' import {ColorString, ColorNumber} from 'src/types/colors' @@ -29,7 +29,7 @@ interface Props { tableOptions: TableOptions timeFormat: string decimalPlaces: DecimalPlaces - fieldOptions: FieldName[] + fieldOptions: FieldOption[] resizerTopHeight: number thresholdsListColors: ColorNumber[] gaugeColors: ColorNumber[] diff --git a/ui/src/types/dashboard.ts b/ui/src/types/dashboard.ts index 5c8ac80a8a..d7588800c6 100644 --- a/ui/src/types/dashboard.ts +++ b/ui/src/types/dashboard.ts @@ -18,15 +18,9 @@ export interface FieldOption { visible: boolean } -export interface FieldName { - internalName: string - displayName: string - visible: boolean -} - export interface TableOptions { verticalTimeAxis: boolean - sortBy: FieldName + sortBy: FieldOption wrapping?: string fixFirstColumn: boolean } @@ -76,7 +70,7 @@ export interface Cell { axes: Axes colors: ColorString[] tableOptions: TableOptions - fieldOptions: FieldName[] + fieldOptions: FieldOption[] timeFormat: string decimalPlaces: DecimalPlaces links: CellLinks