Skip to content

Commit

Permalink
Add a variable for missingdatasource
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud committed Jan 25, 2021
1 parent 526c5e4 commit aa350ef
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class DatasourceControl extends React.PureComponent {
render() {
const { showChangeDatasourceModal, showEditDatasourceModal } = this.state;
const { datasource, onChange } = this.props;
const isMissingDatasource = datasource;
const datasourceMenu = (
<Menu onClick={this.handleMenuItemClick}>
{this.props.isEditable && (
Expand All @@ -176,7 +177,7 @@ class DatasourceControl extends React.PureComponent {
<div className="data-container">
<Icon name="dataset-physical" className="dataset-svg" />
{/* Add a tooltip only for long dataset names */}
{datasource.name.length > 20 ? (
{!isMissingDatasource && datasource.name.length > 25 ? (
<Tooltip title={datasource.name}>
<span className="title-select">{datasource.name}</span>
</Tooltip>
Expand Down Expand Up @@ -208,7 +209,7 @@ class DatasourceControl extends React.PureComponent {
</Dropdown>
</div>
{/* missing dataset */}
{datasource.id == null && (
{isMissingDatasource && (
<div className="error-alert">
<ErrorAlert
level="warning"
Expand Down

0 comments on commit aa350ef

Please sign in to comment.