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

Rename field -> column in viz settings

parent 926baebe
Branches
Tags
No related merge requests found
......@@ -359,13 +359,13 @@ const SETTINGS = {
!Query.isBareRowsAggregation(card.dataset_query.query)
)
},
"table.fields": {
"table.columns": {
title: "Fields to include",
widget: ChartSettingOrderedFields,
getHidden: (series, vizSettings) => vizSettings["table.pivot"],
isValid: ([{ card, data }]) =>
card.visualization_settings["table.fields"] &&
columnsAreValid(card.visualization_settings["table.fields"].map(x => x.name), data),
card.visualization_settings["table.columns"] &&
columnsAreValid(card.visualization_settings["table.columns"].map(x => x.name), data),
getDefault: ([{ data: { cols }}]) => cols.map(col => ({
name: col.name,
enabled: true
......@@ -399,7 +399,7 @@ const SETTINGS = {
}
}
},
"map.latitude_field": {
"map.latitude_column": {
title: "Latitude field",
widget: ChartSettingSelect,
getDefault: ([{ card, data: { cols }}]) =>
......@@ -409,7 +409,7 @@ const SETTINGS = {
}),
getHidden: (series, vizSettings) => vizSettings["map.type"] !== "pin"
},
"map.longitude_field": {
"map.longitude_column": {
title: "Longitude field",
widget: ChartSettingSelect,
getDefault: ([{ card, data: { cols }}]) =>
......
......@@ -57,8 +57,8 @@ export default class PinMap extends Component {
getLatLongIndexes() {
const { settings, series: [{ data: { cols }}] } = this.props;
return {
latitudeIndex: _.findIndex(cols, (col) => col.name === settings["map.latitude_field"]),
longitudeIndex: _.findIndex(cols, (col) => col.name === settings["map.longitude_field"])
latitudeIndex: _.findIndex(cols, (col) => col.name === settings["map.latitude_column"]),
longitudeIndex: _.findIndex(cols, (col) => col.name === settings["map.longitude_column"])
};
}
......
......@@ -47,7 +47,7 @@ export default class Bar extends Component {
});
} else {
const { cols, rows, columns } = data;
const colIndexes = settings["table.fields"]
const colIndexes = settings["table.columns"]
.filter(f => f.enabled)
.map(f => _.findIndex(cols, (c) => c.name === f.name))
.filter(i => i >= 0 && i < cols.length);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment