diff --git a/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx b/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx index cf4a0a26981..614e42c7c02 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx @@ -73,11 +73,13 @@ export const DataSourceHttpSettings = (props: HttpSettingsProps) => { azureAuthSettings, renderSigV4Editor, secureSocksDSProxyEnabled, - connectionElements, + urlLabel, + urlDocs, } = props; - let urlTooltip; + const [isAccessHelpVisible, setIsAccessHelpVisible] = useState(false); const theme = useTheme2(); + let urlTooltip; const onSettingsChange = useCallback( (change: Partial>) => { @@ -94,7 +96,7 @@ export const DataSourceHttpSettings = (props: HttpSettingsProps) => { urlTooltip = ( <> Your access method is Browser, this means the URL needs to be accessible from the browser. - {connectionElements?.tooltip} + {urlDocs} ); break; @@ -103,12 +105,12 @@ export const DataSourceHttpSettings = (props: HttpSettingsProps) => { <> Your access method is Server, this means the URL needs to be accessible from the grafana backend/server. - {connectionElements?.tooltip} + {urlDocs} ); break; default: - urlTooltip = <>Specify a complete HTTP URL (for example http://your_server:8080) {connectionElements?.tooltip}; + urlTooltip = <>Specify a complete HTTP URL (for example http://your_server:8080) {urlDocs}; } const accessSelect = ( @@ -146,24 +148,20 @@ export const DataSourceHttpSettings = (props: HttpSettingsProps) => { const azureAuthEnabled: boolean = (azureAuthSettings?.azureAuthSupported && azureAuthSettings.getAzureAuthEnabled(dataSourceConfig)) || false; - const connectionLabel = connectionElements?.label ? connectionElements?.label : 'URL'; - return (
<>

HTTP

- {defaultUrl && ( -
- -
- )} +
+ +
{showAccessOptions && ( <> diff --git a/packages/grafana-ui/src/components/DataSourceSettings/types.ts b/packages/grafana-ui/src/components/DataSourceSettings/types.ts index 81d20df8f2a..12339b67b7d 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/types.ts +++ b/packages/grafana-ui/src/components/DataSourceSettings/types.ts @@ -30,7 +30,11 @@ export interface HttpSettingsBaseProps { azureAuthSettings={azureAuthSettings} renderSigV4Editor={} secureSocksDSProxyEnabled={config.secureSocksDSProxyEnabled} - connectionElements={{ - label: 'Prometheus server URL', - tooltip: docsTip(), - }} + urlLabel="Prometheus server URL" + urlDocs={docsTip()} /> <>