mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix(explore): Fix column number calculation (#14665)
* Fixes columns calc * Fix type
This commit is contained in:
parent
852842028a
commit
7a050c59e4
@ -101,7 +101,7 @@ export const defaultTheme: (
|
|||||||
controlHeight: 34,
|
controlHeight: 34,
|
||||||
lineHeight: 19,
|
lineHeight: 19,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
minWidth: '7.5em', // just enough to display 'No options'
|
minWidth: '6.5em',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -16,17 +16,19 @@
|
|||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import { ExpandedControlItem } from '@superset-ui/chart-controls';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const NUM_COLUMNS = 12;
|
const NUM_COLUMNS = 12;
|
||||||
|
|
||||||
export default function ControlRow({
|
type Control = React.ReactElement | null;
|
||||||
controls,
|
|
||||||
}: {
|
export default function ControlRow({ controls }: { controls: Control[] }) {
|
||||||
controls: ExpandedControlItem[];
|
// ColorMapControl renders null and should not be counted
|
||||||
}) {
|
// in the columns number
|
||||||
const colSize = NUM_COLUMNS / controls.length;
|
const countableControls = controls.filter(
|
||||||
|
control => !['ColorMapControl'].includes(control?.props.type),
|
||||||
|
);
|
||||||
|
const colSize = NUM_COLUMNS / countableControls.length;
|
||||||
return (
|
return (
|
||||||
<div className="row space-1">
|
<div className="row space-1">
|
||||||
{controls.map((control, i) => (
|
{controls.map((control, i) => (
|
||||||
|
Loading…
Reference in New Issue
Block a user