From e86e8c1fe6f96ea84d2f38ee01b3610d21eebe94 Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Fri, 9 Nov 2018 14:44:07 +0100 Subject: SONAR-11321 Improve project page manual fields validate --- .../js/components/controls/ValidationInput.tsx | 12 ++++-- .../controls/__tests__/ValidationInput-test.tsx | 1 + .../__snapshots__/ValidationInput-test.tsx.snap | 50 ++++++++++++++-------- 3 files changed, 43 insertions(+), 20 deletions(-) (limited to 'server/sonar-web/src/main/js/components/controls') diff --git a/server/sonar-web/src/main/js/components/controls/ValidationInput.tsx b/server/sonar-web/src/main/js/components/controls/ValidationInput.tsx index f95fb297879..a0be10383b3 100644 --- a/server/sonar-web/src/main/js/components/controls/ValidationInput.tsx +++ b/server/sonar-web/src/main/js/components/controls/ValidationInput.tsx @@ -18,13 +18,16 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import HelpTooltip from './HelpTooltip'; import AlertErrorIcon from '../icons-components/AlertErrorIcon'; import AlertSuccessIcon from '../icons-components/AlertSuccessIcon'; interface Props { description?: string; children: React.ReactNode; + className?: string; error: string | undefined; + help?: string; id: string; isInvalid: boolean; isValid: boolean; @@ -35,10 +38,13 @@ interface Props { export default function ValidationInput(props: Props) { const hasError = props.isInvalid && props.error !== undefined; return ( -
+
{props.children} diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/ValidationInput-test.tsx b/server/sonar-web/src/main/js/components/controls/__tests__/ValidationInput-test.tsx index 37b3d8e6a41..c5245f0d81b 100644 --- a/server/sonar-web/src/main/js/components/controls/__tests__/ValidationInput-test.tsx +++ b/server/sonar-web/src/main/js/components/controls/__tests__/ValidationInput-test.tsx @@ -27,6 +27,7 @@ it('should render', () => { - - Field label - - - * - + + Field label + + + * + + +
- - Field label - - - * - + + Field label + + + * + +
- - Field label - + + + Field label + +