Skip to content
Snippets Groups Projects
Commit 2ffb8d16 authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

Merge pull request #2968 from metabase/fix-sort-widget

Fix sort widget crash
parents 960a35f3 a3ff9186
No related branches found
No related tags found
No related merge requests found
......@@ -27,16 +27,20 @@ export default class FieldName extends Component {
let fieldTarget = Query.getFieldTarget(field, tableMetadata);
let parts = [];
// fk path
for (let [index, fkField] of Object.entries(fieldTarget.path)) {
parts.push(<span key={"fkName"+index}>{stripId(fkField.display_name)}</span>);
parts.push(<span key={"fkIcon"+index} className="px1"><Icon name="connections" width="10" height="10" /></span>);
}
// target field itself
parts.push(<span key="field">{fieldTarget.field.display_name}</span>);
// datetime-field unit
if (fieldTarget.unit != null) {
parts.push(<span key="unit">{": " + formatBucketing(fieldTarget.unit)}</span>);
if (fieldTarget) {
// fk path
for (let [index, fkField] of Object.entries(fieldTarget.path)) {
parts.push(<span key={"fkName"+index}>{stripId(fkField.display_name)}</span>);
parts.push(<span key={"fkIcon"+index} className="px1"><Icon name="connections" width="10" height="10" /></span>);
}
// target field itself
parts.push(<span key="field">{fieldTarget.field.display_name}</span>);
// datetime-field unit
if (fieldTarget.unit != null) {
parts.push(<span key="unit">{": " + formatBucketing(fieldTarget.unit)}</span>);
}
} else {
parts.push(<span key="field">field</span>);
}
return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment