Skip to content
Snippets Groups Projects
Commit 50c46331 authored by Tom Robinson's avatar Tom Robinson
Browse files

Add whitelist/blacklist to ColumnSettings

parent 272d5994
No related branches found
No related tags found
No related merge requests found
......@@ -220,6 +220,7 @@ export default class FieldApp extends Component {
value={(field && field.settings) || {}}
onChange={this.onUpdateFieldSettings}
column={field}
blacklist={new Set(["column_title"])}
/>
</Section>
) : (
......
......@@ -47,7 +47,7 @@ class FormattingWidget extends React.Component {
value={value[type]}
onChange={settings => onChange({ ...value, [type]: settings })}
column={column}
settings={settings}
whitelist={new Set(settings)}
/>
</div>
))}
......
/* @flow */
import React from "react";
import { getSettingDefintionsForColumn } from "metabase/visualizations/lib/settings/column";
......@@ -8,9 +10,24 @@ import {
import ChartSettingsWidget from "metabase/visualizations/components/ChartSettingsWidget";
const ColumnSettings = ({ value, onChange, column, settings = null }) => {
const settingsSet = settings && new Set(settings);
type SettingId = string;
type Settings = { [id: SettingId]: any };
type Props = {
value: Settings,
onChange: (settings: Settings) => void,
column: any,
whitelist?: Set<SettingId>,
blacklist?: Set<SettingId>,
};
const ColumnSettings = ({
value,
onChange,
column,
whitelist,
blacklist,
}: Props) => {
const storedSettings = value || {};
// fake series
......@@ -38,7 +55,11 @@ const ColumnSettings = ({ value, onChange, column, settings = null }) => {
return (
<div>
{widgets
.filter(widget => !settingsSet || settingsSet.has(widget.id))
.filter(
widget =>
(!whitelist || whitelist.has(widget.id)) &&
(!blacklist || !blacklist.has(widget.id)),
)
.map(widget => (
<ChartSettingsWidget
key={widget.id}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment