diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5985ce5fb03c0..82c23fd591fdd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1043,7 +1043,6 @@ The filter-box configuration references column names (via the `column` key) and | `color_picker` | _object_ | The **Fixed Color** widget | | `donut` | _boolean_ | The **Donut** widget | | `global_opacity` | _number_ | The **Opacity** widget | -| `header_font_size` | _number_ | The **Big Number Font Size** widget (or similar) | | `label_colors` | _object_ | The **Color Scheme** widget | | `labels_outside` | _boolean_ | The **Put labels outside** widget | | `line_interpolation` | _string_ | The **Line Style** widget | @@ -1056,7 +1055,6 @@ The filter-box configuration references column names (via the `column` key) and | `show_brush` | _string_ | The **Show Range Filter** widget | | `show_legend` | _boolean_ | The **Legend** widget | | `show_markers` | _string_ | The **Show Markers** widget | -| `subheader_font_size` | _number_ | The **Subheader Font Size** widget | ### X Axis diff --git a/superset-frontend/src/explore/controlPanels/BigNumber.jsx b/superset-frontend/src/explore/controlPanels/BigNumber.jsx index aa6c831b999f9..09fd010a78a32 100644 --- a/superset-frontend/src/explore/controlPanels/BigNumber.jsx +++ b/superset-frontend/src/explore/controlPanels/BigNumber.jsx @@ -18,6 +18,7 @@ */ import { t } from '@superset-ui/translation'; import React from 'react'; +import { HeaderFontSize, SubheaderFontSize } from './Shared_BigNumber'; export default { controlPanelSections: [ @@ -84,8 +85,8 @@ export default { expanded: true, controlSetRows: [ ['color_picker', null], - ['header_font_size'], - ['subheader_font_size'], + [HeaderFontSize], + [SubheaderFontSize], ], }, { @@ -101,9 +102,6 @@ export default { y_axis_format: { label: t('Number format'), }, - header_font_size: { - label: t('Big Number Font Size'), - }, }, sectionOverrides: { druidTimeSeries: { diff --git a/superset-frontend/src/explore/controlPanels/BigNumberTotal.js b/superset-frontend/src/explore/controlPanels/BigNumberTotal.js index 04e6217f6237b..3a5dc75ffe3c9 100644 --- a/superset-frontend/src/explore/controlPanels/BigNumberTotal.js +++ b/superset-frontend/src/explore/controlPanels/BigNumberTotal.js @@ -17,6 +17,7 @@ * under the License. */ import { t } from '@superset-ui/translation'; +import { HeaderFontSize, SubheaderFontSize } from './Shared_BigNumber'; export default { controlPanelSections: [ @@ -47,15 +48,12 @@ export default { { label: t('Chart Options'), expanded: true, - controlSetRows: [['header_font_size'], ['subheader_font_size']], + controlSetRows: [[HeaderFontSize], [SubheaderFontSize]], }, ], controlOverrides: { y_axis_format: { label: t('Number format'), }, - header_font_size: { - label: t('Big Number Font Size'), - }, }, }; diff --git a/superset-frontend/src/explore/controlPanels/Shared_BigNumber.js b/superset-frontend/src/explore/controlPanels/Shared_BigNumber.js new file mode 100644 index 0000000000000..aec4343876177 --- /dev/null +++ b/superset-frontend/src/explore/controlPanels/Shared_BigNumber.js @@ -0,0 +1,89 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// These are control configurations that are shared ONLY within the BigNumber viz plugin repo. +import { t } from '@superset-ui/translation'; + +export const HeaderFontSize = { + name: 'header_font_size', + config: { + type: 'SelectControl', + label: t('Big Number Font Size'), + renderTrigger: true, + clearable: false, + default: 0.4, + // Values represent the percentage of space a header should take + options: [ + { + label: t('Tiny'), + value: 0.2, + }, + { + label: t('Small'), + value: 0.3, + }, + { + label: t('Normal'), + value: 0.4, + }, + { + label: t('Large'), + value: 0.5, + }, + { + label: t('Huge'), + value: 0.6, + }, + ], + }, +}; + +export const SubheaderFontSize = { + name: 'subheader_font_size', + config: { + type: 'SelectControl', + label: t('Subheader Font Size'), + renderTrigger: true, + clearable: false, + default: 0.15, + // Values represent the percentage of space a subheader should take + options: [ + { + label: t('Tiny'), + value: 0.125, + }, + { + label: t('Small'), + value: 0.15, + }, + { + label: t('Normal'), + value: 0.2, + }, + { + label: t('Large'), + value: 0.3, + }, + { + label: t('Huge'), + value: 0.4, + }, + ], + }, +}; diff --git a/superset-frontend/src/explore/controls.jsx b/superset-frontend/src/explore/controls.jsx index 8cfc1acd1c498..3c2648247342c 100644 --- a/superset-frontend/src/explore/controls.jsx +++ b/superset-frontend/src/explore/controls.jsx @@ -1128,68 +1128,6 @@ export const controls = { ), }, - header_font_size: { - type: 'SelectControl', - label: t('Header Font Size'), - renderTrigger: true, - clearable: false, - default: 0.4, - // Values represent the percentage of space a header should take - options: [ - { - label: t('Tiny'), - value: 0.2, - }, - { - label: t('Small'), - value: 0.3, - }, - { - label: t('Normal'), - value: 0.4, - }, - { - label: t('Large'), - value: 0.5, - }, - { - label: t('Huge'), - value: 0.6, - }, - ], - }, - - subheader_font_size: { - type: 'SelectControl', - label: t('Subheader Font Size'), - renderTrigger: true, - clearable: false, - default: 0.15, - // Values represent the percentage of space a subheader should take - options: [ - { - label: t('Tiny'), - value: 0.125, - }, - { - label: t('Small'), - value: 0.15, - }, - { - label: t('Normal'), - value: 0.2, - }, - { - label: t('Large'), - value: 0.3, - }, - { - label: t('Huge'), - value: 0.4, - }, - ], - }, - instant_filtering: { type: 'CheckboxControl', label: t('Instant Filtering'),