Skip to content

Commit 39396ff

Browse files
authored
Fix: Column name starting with numbers (#1718)
* validating column name * showing error note on fail add column op
1 parent 0ee0ae6 commit 39396ff

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/dashboard/Data/Browser/AddColumnDialog.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
} from 'lib/Constants';
2828

2929
function validColumnName(name) {
30-
return !!name.match(/^[a-zA-Z0-9][_a-zA-Z0-9]*$/);
30+
return !!name.match(/^[a-zA-Z][_a-zA-Z0-9]*$/);
3131
}
3232

3333
export default class AddColumnDialog extends React.Component {

src/dashboard/Data/Browser/Browser.react.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ class Browser extends DashboardView {
280280
required,
281281
defaultValue
282282
};
283-
this.props.schema.dispatch(ActionTypes.ADD_COLUMN, payload).finally(() => {
283+
this.props.schema.dispatch(ActionTypes.ADD_COLUMN, payload).catch((err) => {
284+
this.showNote(err.message, true);
285+
}).finally(() => {
284286
this.setState({ showAddColumnDialog: false });
285287
});
286288
}

0 commit comments

Comments
 (0)