mirror of
https://github.com/apache/superset.git
synced 2026-05-11 19:05:24 +00:00
fix(explore): Fix column number calculation (#14665)
* Fixes columns calc * Fix type
This commit is contained in:
@@ -16,17 +16,19 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { ExpandedControlItem } from '@superset-ui/chart-controls';
|
||||
import React from 'react';
|
||||
|
||||
const NUM_COLUMNS = 12;
|
||||
|
||||
export default function ControlRow({
|
||||
controls,
|
||||
}: {
|
||||
controls: ExpandedControlItem[];
|
||||
}) {
|
||||
const colSize = NUM_COLUMNS / controls.length;
|
||||
type Control = React.ReactElement | null;
|
||||
|
||||
export default function ControlRow({ controls }: { controls: Control[] }) {
|
||||
// ColorMapControl renders null and should not be counted
|
||||
// in the columns number
|
||||
const countableControls = controls.filter(
|
||||
control => !['ColorMapControl'].includes(control?.props.type),
|
||||
);
|
||||
const colSize = NUM_COLUMNS / countableControls.length;
|
||||
return (
|
||||
<div className="row space-1">
|
||||
{controls.map((control, i) => (
|
||||
|
||||
Reference in New Issue
Block a user