From e60195a6ad97e1900bfe556b5704536d06bffa09 Mon Sep 17 00:00:00 2001 From: Miki Date: Thu, 11 Jul 2024 08:47:18 -0700 Subject: [PATCH 1/5] Use EuiCompressedFormRow Signed-off-by: Miki --- public/components/gantt_chart_editor.tsx | 18 +++---- public/components/options_editor.tsx | 62 ++++++++++++------------ 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/public/components/gantt_chart_editor.tsx b/public/components/gantt_chart_editor.tsx index d06da8b..a0490af 100644 --- a/public/components/gantt_chart_editor.tsx +++ b/public/components/gantt_chart_editor.tsx @@ -5,7 +5,7 @@ import { EuiFieldNumber, - EuiFormRow, + EuiCompressedFormRow, EuiPanel, EuiSpacer, EuiSuperSelect, @@ -30,7 +30,7 @@ export function GanttChartEditor({ aggs, stateParams, setValue }: VisOptionsProp

Metrics

- @@ -40,8 +40,8 @@ export function GanttChartEditor({ aggs, stateParams, setValue }: VisOptionsProp valueOfSelected={stateParams.labelField || 'select'} onChange={(value) => setValue('labelField', value)} /> - - + @@ -51,8 +51,8 @@ export function GanttChartEditor({ aggs, stateParams, setValue }: VisOptionsProp valueOfSelected={stateParams.startTimeField} onChange={(value) => setValue('startTimeField', value)} /> - - + @@ -62,7 +62,7 @@ export function GanttChartEditor({ aggs, stateParams, setValue }: VisOptionsProp valueOfSelected={stateParams.durationField} onChange={(value) => setValue('durationField', value)} /> - + @@ -72,7 +72,7 @@ export function GanttChartEditor({ aggs, stateParams, setValue }: VisOptionsProp

Results

- @@ -81,7 +81,7 @@ export function GanttChartEditor({ aggs, stateParams, setValue }: VisOptionsProp value={stateParams.size} onChange={(e) => setValue('size', parseInt(e.target.value, 10))} /> - + ); diff --git a/public/components/options_editor.tsx b/public/components/options_editor.tsx index cbbd547..bd28390 100644 --- a/public/components/options_editor.tsx +++ b/public/components/options_editor.tsx @@ -6,7 +6,7 @@ import { EuiColorPicker, EuiFieldText, - EuiFormRow, + EuiCompressedFormRow, EuiPanel, EuiSelect, EuiSpacer, @@ -36,17 +36,17 @@ export function OptionsEditor({ aggs, stateParams, setValue }: VisOptionsProps - + setValue('showLegend', e.target.checked)} /> - + {stateParams.showLegend && ( - + - + )} ); @@ -70,22 +70,22 @@ export function OptionsEditor({ aggs, stateParams, setValue }: VisOptionsProps - + setValue('yAxisShowGrid', e.target.checked)} /> - - + + setValue('xAxisShowGrid', e.target.checked)} /> - + ); }; @@ -98,9 +98,9 @@ export function OptionsEditor({ aggs, stateParams, setValue }: VisOptionsProps - + setValue('colors', e)} /> - + ); }; @@ -138,41 +138,41 @@ export function OptionsEditor({ aggs, stateParams, setValue }: VisOptionsProps - + setValue('yAxisPosition', e.target.value as PlotlyAxisPosition)} /> - + - + setValue('yAxisShowLine', e.target.checked)} /> - - + + setValue('yAxisShowTitle', e.target.checked)} /> - + {stateParams.yAxisShowTitle ? ( - + setValue('yAxisTitle', e.target.value)} /> - + ) : null} ); @@ -186,57 +186,57 @@ export function OptionsEditor({ aggs, stateParams, setValue }: VisOptionsProps - + setValue('xAxisPosition', e.target.value as PlotlyAxisPosition)} /> - - + + setValue('xAxisType', e.target.value as PlotlyAxisType)} /> - - + + setValue('timeFormat', e.target.value)} /> - + - + setValue('xAxisShowLine', e.target.checked)} /> - - + + setValue('xAxisShowTitle', e.target.checked)} /> - + {stateParams.xAxisShowTitle ? ( - + setValue('xAxisTitle', e.target.value)} /> - + ) : null} ); From 77e7a99fc231ea31a0338723c9cb1d36e4d7a140 Mon Sep 17 00:00:00 2001 From: Miki Date: Thu, 11 Jul 2024 10:48:59 -0700 Subject: [PATCH 2/5] Use EuiCompressedField* Signed-off-by: Miki --- public/components/gantt_chart_editor.tsx | 4 ++-- public/components/options_editor.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/components/gantt_chart_editor.tsx b/public/components/gantt_chart_editor.tsx index a0490af..b488383 100644 --- a/public/components/gantt_chart_editor.tsx +++ b/public/components/gantt_chart_editor.tsx @@ -4,7 +4,7 @@ */ import { - EuiFieldNumber, + EuiCompressedFieldNumber, EuiCompressedFormRow, EuiPanel, EuiSpacer, @@ -76,7 +76,7 @@ export function GanttChartEditor({ aggs, stateParams, setValue }: VisOptionsProp label="View number of results" helpText="Results ordered by descending start time." > - setValue('size', parseInt(e.target.value, 10))} diff --git a/public/components/options_editor.tsx b/public/components/options_editor.tsx index bd28390..056e73e 100644 --- a/public/components/options_editor.tsx +++ b/public/components/options_editor.tsx @@ -5,7 +5,7 @@ import { EuiColorPicker, - EuiFieldText, + EuiCompressedFieldText, EuiCompressedFormRow, EuiPanel, EuiSelect, @@ -166,7 +166,7 @@ export function OptionsEditor({ aggs, stateParams, setValue }: VisOptionsProps - - Date: Thu, 11 Jul 2024 13:25:07 -0700 Subject: [PATCH 3/5] Use EuiCompressedSelect and EuiCompressedSuperSelect Signed-off-by: Miki --- public/components/gantt_chart_editor.tsx | 8 ++++---- public/components/options_editor.tsx | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/public/components/gantt_chart_editor.tsx b/public/components/gantt_chart_editor.tsx index b488383..7d2ccce 100644 --- a/public/components/gantt_chart_editor.tsx +++ b/public/components/gantt_chart_editor.tsx @@ -8,7 +8,7 @@ import { EuiCompressedFormRow, EuiPanel, EuiSpacer, - EuiSuperSelect, + EuiCompressedSuperSelect, EuiTitle, } from '@elastic/eui'; import React from 'react'; @@ -34,7 +34,7 @@ export function GanttChartEditor({ aggs, stateParams, setValue }: VisOptionsProp label="Event" helpText="Gantt chart allows you to compare schedules of the selected field." > - - - - - - - - Date: Thu, 11 Jul 2024 14:24:00 -0700 Subject: [PATCH 4/5] Use EuiCompressedSwitch Signed-off-by: Miki --- public/components/options_editor.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/public/components/options_editor.tsx b/public/components/options_editor.tsx index f5a1c5e..c2c213b 100644 --- a/public/components/options_editor.tsx +++ b/public/components/options_editor.tsx @@ -10,7 +10,7 @@ import { EuiPanel, EuiCompressedSelect, EuiSpacer, - EuiSwitch, + EuiCompressedSwitch, EuiTitle, } from '@elastic/eui'; import React from 'react'; @@ -37,7 +37,7 @@ export function OptionsEditor({ aggs, stateParams, setValue }: VisOptionsProps - - - - - - - Date: Fri, 2 Aug 2024 11:33:15 -0700 Subject: [PATCH 5/5] Update snapshots Signed-off-by: Miki --- .../gantt_chart_editor.test.tsx.snap | 24 +-- .../options_editor.test.tsx.snap | 164 +++--------------- 2 files changed, 35 insertions(+), 153 deletions(-) diff --git a/public/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap b/public/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap index ae2cf1d..93c111d 100644 --- a/public/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap +++ b/public/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap @@ -13,7 +13,7 @@ exports[` spec renders the component 1`] = ` class="euiSpacer euiSpacer--s" />
spec renders the component 1`] = ` value="spanID" />
spec renders the component 1`] = ` aria-describedby="random_html_id-help-0" aria-haspopup="true" aria-labelledby="random_html_id random_html_id" - class="euiSuperSelectControl" + class="euiSuperSelectControl euiSuperSelectControl--compressed" data-test-subj="gantt-chart-editor-label-field" type="button" /> @@ -69,7 +69,7 @@ exports[` spec renders the component 1`] = ` > spec renders the component 1`] = `
spec renders the component 1`] = ` value="startTime" />
spec renders the component 1`] = ` aria-describedby="random_html_id-help-0" aria-haspopup="true" aria-labelledby="random_html_id random_html_id" - class="euiSuperSelectControl" + class="euiSuperSelectControl euiSuperSelectControl--compressed" data-test-subj="gantt-chart-editor-start-time-field" type="button" /> @@ -153,7 +153,7 @@ exports[` spec renders the component 1`] = ` > spec renders the component 1`] = `
spec renders the component 1`] = ` value="duration" />
spec renders the component 1`] = ` aria-describedby="random_html_id-help-0" aria-haspopup="true" aria-labelledby="random_html_id random_html_id" - class="euiSuperSelectControl" + class="euiSuperSelectControl euiSuperSelectControl--compressed" data-test-subj="gantt-chart-editor-duration-field" type="button" /> @@ -237,7 +237,7 @@ exports[` spec renders the component 1`] = ` > spec renders the component 1`] = ` class="euiSpacer euiSpacer--s" />
spec renders the component 1`] = ` class="euiFormRow__fieldWrapper" >
spec renders the component with different options 1`] class="euiSpacer euiSpacer--s" />
spec renders the component with different options 1`] class="euiFormRow__fieldWrapper" >