From 4f3d9953431e74a567dbd430ff18c4136e70bb03 Mon Sep 17 00:00:00 2001 From: Shavonn Brown Date: Tue, 31 Mar 2020 11:50:45 -0400 Subject: [PATCH] add tooltip prop and fix folder name (#22901) * add tooltip prop and fix folder name * fix folder name refs --- .../src/components/DataSourceSettings/BasicAuthSettings.tsx | 2 +- .../components/DataSourceSettings/CustomHeadersSettings.tsx | 2 +- .../SecretFormField.story.tsx | 0 .../{SecretFormFied => SecretFormField}/SecretFormField.tsx | 3 +++ packages/grafana-ui/src/components/index.ts | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) rename packages/grafana-ui/src/components/{SecretFormFied => SecretFormField}/SecretFormField.story.tsx (100%) rename packages/grafana-ui/src/components/{SecretFormFied => SecretFormField}/SecretFormField.tsx (97%) diff --git a/packages/grafana-ui/src/components/DataSourceSettings/BasicAuthSettings.tsx b/packages/grafana-ui/src/components/DataSourceSettings/BasicAuthSettings.tsx index 9fcf126fec4..8a4446157ec 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/BasicAuthSettings.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/BasicAuthSettings.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { HttpSettingsProps } from './types'; import { FormField } from '../FormField/FormField'; -import { SecretFormField } from '../SecretFormFied/SecretFormField'; +import { SecretFormField } from '../SecretFormField/SecretFormField'; export const BasicAuthSettings: React.FC = ({ dataSourceConfig, onChange }) => { const password = dataSourceConfig.secureJsonData ? dataSourceConfig.secureJsonData.basicAuthPassword : ''; diff --git a/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.tsx b/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.tsx index 2583f948edc..74a324336d6 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.tsx @@ -4,7 +4,7 @@ import uniqueId from 'lodash/uniqueId'; import { DataSourceSettings } from '@grafana/data'; import { Button } from '../Button'; import { FormField } from '../FormField/FormField'; -import { SecretFormField } from '../SecretFormFied/SecretFormField'; +import { SecretFormField } from '../SecretFormField/SecretFormField'; import { stylesFactory } from '../../themes'; export interface CustomHeader { diff --git a/packages/grafana-ui/src/components/SecretFormFied/SecretFormField.story.tsx b/packages/grafana-ui/src/components/SecretFormField/SecretFormField.story.tsx similarity index 100% rename from packages/grafana-ui/src/components/SecretFormFied/SecretFormField.story.tsx rename to packages/grafana-ui/src/components/SecretFormField/SecretFormField.story.tsx diff --git a/packages/grafana-ui/src/components/SecretFormFied/SecretFormField.tsx b/packages/grafana-ui/src/components/SecretFormField/SecretFormField.tsx similarity index 97% rename from packages/grafana-ui/src/components/SecretFormFied/SecretFormField.tsx rename to packages/grafana-ui/src/components/SecretFormField/SecretFormField.tsx index 0c46aa8e633..88e71d61b19 100644 --- a/packages/grafana-ui/src/components/SecretFormFied/SecretFormField.tsx +++ b/packages/grafana-ui/src/components/SecretFormField/SecretFormField.tsx @@ -10,6 +10,7 @@ interface Props extends Omit, 'onReset'> { isConfigured: boolean; label?: string; + tooltip?: string; labelWidth?: number; inputWidth?: number; // Placeholder of the input field when in non configured state. @@ -40,6 +41,7 @@ export const SecretFormField: FunctionComponent = ({ inputWidth = 12, onReset, isConfigured, + tooltip, placeholder = 'Password', ...inputProps }: Props) => { @@ -47,6 +49,7 @@ export const SecretFormField: FunctionComponent = ({ return (