Skip to content
Snippets Groups Projects
Commit 1e88cf5b authored by Allen Gilliland's avatar Allen Gilliland
Browse files

prevent users from entering in empty table/field names.

parent 169cfd1f
Branches
Tags
No related merge requests found
......@@ -43,7 +43,12 @@ export default class Column extends Component {
}
onNameChange(event) {
this.updateProperty("display_name", event.target.value);
if (!_.isEmpty(event.target.value)) {
this.updateProperty("display_name", event.target.value);
} else {
// if the user set this to empty then simply reset it because that's not allowed!
event.target.value = this.props.field.display_name;
}
}
onDescriptionChange(event) {
......
......@@ -7,6 +7,7 @@ import SegmentsList from "./SegmentsList.jsx";
import Input from "metabase/components/Input.jsx";
import ProgressBar from "metabase/components/ProgressBar.jsx";
import _ from "underscore";
import cx from "classnames";
export default class MetadataTable extends Component {
......@@ -37,7 +38,12 @@ export default class MetadataTable extends Component {
}
onNameChange(event) {
this.updateProperty("display_name", event.target.value);
if (!_.isEmpty(event.target.value)) {
this.updateProperty("display_name", event.target.value);
} else {
// if the user set this to empty then simply reset it because that's not allowed!
event.target.value = this.props.tableMetadata.display_name;
}
}
onDescriptionChange(event) {
......
......@@ -128,13 +128,15 @@ function($scope, $route, $routeParams, $location, $q, $timeout, databases, Metab
}
score(table.description);
table.fields.forEach(function(field) {
score(field.description);
score(field.special_type);
if (field.special_type === "fk") {
score(field.target);
}
});
if (table.fields) {
table.fields.forEach(function(field) {
score(field.description);
score(field.special_type);
if (field.special_type === "fk") {
score(field.target);
}
});
}
return (completed / total);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment