diff --git a/public/app/features/datasources/settings/DataSourceSettings.tsx b/public/app/features/datasources/settings/DataSourceSettings.tsx index 560f636362e..bc20a28790b 100644 --- a/public/app/features/datasources/settings/DataSourceSettings.tsx +++ b/public/app/features/datasources/settings/DataSourceSettings.tsx @@ -76,13 +76,22 @@ export class DataSourceSettings extends PureComponent { return null; } + renderIsReadOnlyMessage() { + return ( +
+ This datasource was added by config and cannot be modified using the UI. Please contact your server admin to + update this datasource. +
+ ); + } + render() { const { dataSource, dataSourceMeta, navModel } = this.props; return (
- {Object.keys(dataSource).length === 0 && Object.keys(dataSourceMeta).length === 0 ? ( + {Object.keys(dataSource).length === 0 ? ( ) : (
@@ -95,14 +104,9 @@ export class DataSourceSettings extends PureComponent { {this.shouldRenderInfoBox() &&
{this.getInfoText()}
} - {this.isReadOnly() ? ( -
- This datasource was added by config and cannot be modified using the UI. Please contact your server - admin to update this datasource. -
- ) : ( - dataSourceMeta.module && - )} + {this.isReadOnly() + ? this.renderIsReadOnlyMessage() + : dataSourceMeta.module && } this.onSubmit(event)}