This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 0754f29 [Dashboard] Hide slice titles when they're empty (#8018)
0754f29 is described below
commit 0754f294e9d6195f9f233606cedf7fb5ec489271
Author: Erik Ritter <[email protected]>
AuthorDate: Mon Aug 12 21:55:46 2019 -0700
[Dashboard] Hide slice titles when they're empty (#8018)
---
superset/assets/src/components/EditableTitle.jsx | 12 +++++++-----
superset/assets/src/dashboard/components/SliceHeader.jsx | 1 +
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/superset/assets/src/components/EditableTitle.jsx
b/superset/assets/src/components/EditableTitle.jsx
index 428f995..80e91fd 100644
--- a/superset/assets/src/components/EditableTitle.jsx
+++ b/superset/assets/src/components/EditableTitle.jsx
@@ -84,6 +84,8 @@ export default class EditableTitle extends
React.PureComponent {
}
handleBlur() {
+ const title = this.state.title.trim();
+
if (!this.props.canEdit) {
return;
}
@@ -92,7 +94,7 @@ export default class EditableTitle extends
React.PureComponent {
isEditing: false,
});
- if (!this.state.title.length) {
+ if (!title.length) {
this.setState({
title: this.state.lastTitle,
});
@@ -100,14 +102,14 @@ export default class EditableTitle extends
React.PureComponent {
return;
}
- if (this.state.lastTitle !== this.state.title) {
+ if (this.state.lastTitle !== title) {
this.setState({
- lastTitle: this.state.title,
+ lastTitle: title,
});
}
- if (this.props.title !== this.state.title) {
- this.props.onSaveTitle(this.state.title);
+ if (this.props.title !== title) {
+ this.props.onSaveTitle(title);
}
}
diff --git a/superset/assets/src/dashboard/components/SliceHeader.jsx
b/superset/assets/src/dashboard/components/SliceHeader.jsx
index 723ae3e..100a070 100644
--- a/superset/assets/src/dashboard/components/SliceHeader.jsx
+++ b/superset/assets/src/dashboard/components/SliceHeader.jsx
@@ -109,6 +109,7 @@ class SliceHeader extends React.PureComponent {
: '')
}
canEdit={editMode}
+ emptyText=""
onSaveTitle={updateSliceName}
showTooltip={false}
/>