Skip to content

Commit

Permalink
feat(explore): improve UI in the control panel (apache#19748)
Browse files Browse the repository at this point in the history
* feat(explore): improve section header of control panel

* fix checkbox control color and radio button color
  • Loading branch information
stephenLYZ authored and philipher29 committed Jun 9, 2022
1 parent ff4b7a6 commit 4537353
Show file tree
Hide file tree
Showing 30 changed files with 99 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const advancedAnalyticsControls: ControlPanelSectionConfig = {
'of query results',
),
controlSetRows: [
[<h1 className="section-header">{t('Rolling window')}</h1>],
[<div className="section-header">{t('Rolling window')}</div>],
[
{
name: 'rolling_type',
Expand Down Expand Up @@ -85,7 +85,7 @@ export const advancedAnalyticsControls: ControlPanelSectionConfig = {
},
},
],
[<h1 className="section-header">{t('Time comparison')}</h1>],
[<div className="section-header">{t('Time comparison')}</div>],
[
{
name: 'time_compare',
Expand Down Expand Up @@ -136,7 +136,7 @@ export const advancedAnalyticsControls: ControlPanelSectionConfig = {
},
},
],
[<h1 className="section-header">{t('Resample')}</h1>],
[<div className="section-header">{t('Resample')}</div>],
[
{
name: 'resample_rule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const titleControls: ControlPanelSectionConfig = {
tabOverride: 'customize',
expanded: true,
controlSetRows: [
[<h1 className="section-header">{t('X Axis')}</h1>],
[<div className="section-header">{t('X Axis')}</div>],
[
{
name: 'x_axis_title',
Expand Down Expand Up @@ -56,7 +56,7 @@ export const titleControls: ControlPanelSectionConfig = {
},
},
],
[<h1 className="section-header">{t('Y Axis')}</h1>],
[<div className="section-header">{t('Y Axis')}</div>],
[
{
name: 'y_axis_title',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ export default function RadioButtonControl({
'.control-label + .btn-group': {
marginTop: 1,
},
'.btn-group .btn-default': {
color: theme.colors.grayscale.dark1,
},
'.btn-group .btn.active': {
background: theme.colors.secondary.light5,
background: theme.colors.grayscale.light4,
fontWeight: theme.typography.weights.bold,
boxShadow: 'none',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const config: ControlPanelConfig = {
),
controlSetRows: [
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Rolling Window')}</h1>],
[<div className="section-header">{t('Rolling Window')}</div>],
[
{
name: 'rolling_type',
Expand Down Expand Up @@ -292,7 +292,7 @@ const config: ControlPanelConfig = {
},
],
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Time Comparison')}</h1>],
[<div className="section-header">{t('Time Comparison')}</div>],
[
{
name: 'time_compare',
Expand Down Expand Up @@ -341,10 +341,7 @@ const config: ControlPanelConfig = {
},
},
],
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Python Functions')}</h1>],
// eslint-disable-next-line react/jsx-key
[<h2 className="section-header">pandas.resample</h2>],
[<div className="section-header">{t('Resample')}</div>],
[
{
name: 'resample_rule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const config: ControlPanelConfig = {
),
controlSetRows: [
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Rolling Window')}</h1>],
[<div className="section-header">{t('Rolling Window')}</div>],
[
{
name: 'rolling_type',
Expand Down Expand Up @@ -175,7 +175,7 @@ const config: ControlPanelConfig = {
},
],
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Time Comparison')}</h1>],
[<div className="section-header">{t('Time Comparison')}</div>],
[
{
name: 'time_compare',
Expand Down Expand Up @@ -224,10 +224,7 @@ const config: ControlPanelConfig = {
},
},
],
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Python Functions')}</h1>],
// eslint-disable-next-line react/jsx-key
[<h2 className="section-header">pandas.resample</h2>],
[<div className="section-header">{t('Resample')}</div>],
[
{
name: 'resample_rule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export const timeSeriesSection: ControlPanelSectionConfig[] = [
'of query results',
),
controlSetRows: [
[<h1 className="section-header">{t('Rolling Window')}</h1>],
[<div className="section-header">{t('Rolling Window')}</div>],
[
{
name: 'rolling_type',
Expand Down Expand Up @@ -423,7 +423,7 @@ export const timeSeriesSection: ControlPanelSectionConfig[] = [
},
},
],
[<h1 className="section-header">{t('Time Comparison')}</h1>],
[<div className="section-header">{t('Time Comparison')}</div>],
[
{
name: 'time_compare',
Expand Down Expand Up @@ -474,8 +474,7 @@ export const timeSeriesSection: ControlPanelSectionConfig[] = [
},
},
],
[<h1 className="section-header">{t('Python Functions')}</h1>],
[<h2 className="section-header">pandas.resample</h2>],
[<div className="section-header">{t('Resample')}</div>],
[
{
name: 'resample_rule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
controlSetRows: [['metric'], ['adhoc_filters']],
},
{
label: t('Options'),
label: t('Display settings'),
expanded: true,
tabOverride: 'data',
controlSetRows: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const config: ControlPanelConfig = {
expanded: false,
controlSetRows: [
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Rolling Window')}</h1>],
[<div className="section-header">{t('Rolling Window')}</div>],
[
{
name: 'rolling_type',
Expand Down Expand Up @@ -217,8 +217,7 @@ const config: ControlPanelConfig = {
},
},
],
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Resample')}</h1>],
[<div className="section-header">{t('Resample')}</div>],
[
{
name: 'resample_rule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const config: ControlPanelConfig = {
['color_scheme'],
...funnelLegendSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Labels')}</h1>],
[<div className="section-header">{t('Labels')}</div>],
[
{
name: 'label_type',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const config: ControlPanelConfig = {
label: t('Chart Options'),
expanded: true,
controlSetRows: [
[<h1 className="section-header">{t('General')}</h1>],
[<div className="section-header">{t('General')}</div>],
[
{
name: 'min_val',
Expand Down Expand Up @@ -197,7 +197,7 @@ const config: ControlPanelConfig = {
},
},
],
[<h1 className="section-header">{t('Axis')}</h1>],
[<div className="section-header">{t('Axis')}</div>],
[
{
name: 'show_axis_tick',
Expand Down Expand Up @@ -236,7 +236,7 @@ const config: ControlPanelConfig = {
},
},
],
[<h1 className="section-header">{t('Progress')}</h1>],
[<div className="section-header">{t('Progress')}</div>],
[
{
name: 'show_progress',
Expand Down Expand Up @@ -277,7 +277,7 @@ const config: ControlPanelConfig = {
},
},
],
[<h1 className="section-header">{t('Intervals')}</h1>],
[<div className="section-header">{t('Intervals')}</div>],
[
{
name: 'intervals',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const controlPanel: ControlPanelConfig = {
controlSetRows: [
['color_scheme'],
...legendSection,
[<h1 className="section-header">{t('Layout')}</h1>],
[<div className="section-header">{t('Layout')}</div>],
[
{
name: 'layout',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function createCustomizeSection(
controlSuffix: string,
): ControlSetRow[] {
return [
[<h1 className="section-header">{label}</h1>],
[<div className="section-header">{label}</div>],
[
{
name: `seriesType${controlSuffix}`,
Expand Down Expand Up @@ -296,7 +296,7 @@ const config: ControlPanelConfig = {
},
],
...legendSection,
[<h1 className="section-header">{t('X Axis')}</h1>],
[<div className="section-header">{t('X Axis')}</div>],
['x_axis_time_format'],
[
{
Expand All @@ -320,7 +320,7 @@ const config: ControlPanelConfig = {
],
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Y Axis')}</h1>],
[<div className="section-header">{t('Y Axis')}</div>],
[
{
name: 'minorSplitLine',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const config: ControlPanelConfig = {
],
...legendSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Labels')}</h1>],
[<div className="section-header">{t('Labels')}</div>],
[
{
name: 'label_type',
Expand Down Expand Up @@ -196,7 +196,7 @@ const config: ControlPanelConfig = {
},
],
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Pie shape')}</h1>],
[<div className="section-header">{t('Pie shape')}</div>],
[
{
name: 'outerRadius',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const config: ControlPanelConfig = {
controlSetRows: [
['color_scheme'],
...legendSection,
[<h1 className="section-header">{t('Labels')}</h1>],
[<div className="section-header">{t('Labels')}</div>],
[
{
name: 'show_labels',
Expand Down Expand Up @@ -158,7 +158,7 @@ const config: ControlPanelConfig = {
},
},
],
[<h1 className="section-header">{t('Radar')}</h1>],
[<div className="section-header">{t('Radar')}</div>],
[
{
name: 'column_config',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const config: ControlPanelConfig = {
},
],
...legendSection,
[<h1 className="section-header">{t('X Axis')}</h1>],
[<div className="section-header">{t('X Axis')}</div>],
[
{
name: 'x_axis_time_format',
Expand Down Expand Up @@ -213,7 +213,7 @@ const config: ControlPanelConfig = {
],
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Y Axis')}</h1>],
[<div className="section-header">{t('Y Axis')}</div>],
['y_axis_format'],
[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const config: ControlPanelConfig = {
},
],
...legendSection,
[<h1 className="section-header">{t('X Axis')}</h1>],
[<div className="section-header">{t('X Axis')}</div>],
[
{
name: 'x_axis_time_format',
Expand Down Expand Up @@ -175,7 +175,7 @@ const config: ControlPanelConfig = {
// eslint-disable-next-line react/jsx-key
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Y Axis')}</h1>],
[<div className="section-header">{t('Y Axis')}</div>],

['y_axis_format'],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const config: ControlPanelConfig = {
},
],
...legendSection,
[<h1 className="section-header">{t('X Axis')}</h1>],
[<div className="section-header">{t('X Axis')}</div>],

[
{
Expand Down Expand Up @@ -156,7 +156,7 @@ const config: ControlPanelConfig = {
// eslint-disable-next-line react/jsx-key
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Y Axis')}</h1>],
[<div className="section-header">{t('Y Axis')}</div>],
['y_axis_format'],
[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const config: ControlPanelConfig = {
},
],
...legendSection,
[<h1 className="section-header">{t('X Axis')}</h1>],
[<div className="section-header">{t('X Axis')}</div>],
[
{
name: 'x_axis_time_format',
Expand Down Expand Up @@ -172,7 +172,7 @@ const config: ControlPanelConfig = {
// eslint-disable-next-line react/jsx-key
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Y Axis')}</h1>],
[<div className="section-header">{t('Y Axis')}</div>],

['y_axis_format'],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const config: ControlPanelConfig = {
},
],
...legendSection,
[<h1 className="section-header">{t('X Axis')}</h1>],
[<div className="section-header">{t('X Axis')}</div>],
[
{
name: 'x_axis_time_format',
Expand Down Expand Up @@ -229,7 +229,7 @@ const config: ControlPanelConfig = {
],
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Y Axis')}</h1>],
[<div className="section-header">{t('Y Axis')}</div>],
['y_axis_format'],
[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const config: ControlPanelConfig = {
},
],
...legendSection,
[<h1 className="section-header">{t('X Axis')}</h1>],
[<div className="section-header">{t('X Axis')}</div>],
[
{
name: 'x_axis_time_format',
Expand Down Expand Up @@ -232,7 +232,7 @@ const config: ControlPanelConfig = {
],
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<h1 className="section-header">{t('Y Axis')}</h1>],
[<div className="section-header">{t('Y Axis')}</div>],
['y_axis_format'],
[
{
Expand Down
Loading

0 comments on commit 4537353

Please sign in to comment.