From 31cf9a4f7d3668efe8fd58e41c18e6d5a90c7e33 Mon Sep 17 00:00:00 2001 From: Nick Funk Date: Wed, 8 Jan 2020 10:49:33 -0700 Subject: [PATCH] [CORL-818] Add validation and placeholder for Slack hook url field (#2782) * Add a placeholder for Slack hook url field CORL-818 * Validate slack hook url's before saving CORL-818 --- .../Configure/sections/Slack/SlackChannel.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/client/admin/routes/Configure/sections/Slack/SlackChannel.tsx b/src/core/client/admin/routes/Configure/sections/Slack/SlackChannel.tsx index 2c1ab7dac..6773c9651 100644 --- a/src/core/client/admin/routes/Configure/sections/Slack/SlackChannel.tsx +++ b/src/core/client/admin/routes/Configure/sections/Slack/SlackChannel.tsx @@ -5,6 +5,7 @@ import { Field } from "react-final-form"; import { parseBool } from "coral-framework/lib/form"; import { ExternalLink } from "coral-framework/lib/i18n/components"; +import { validateURL } from "coral-framework/lib/validation"; import { Box, Button, @@ -17,6 +18,7 @@ import { } from "coral-ui/components/v2"; import Subheader from "../../Subheader"; +import TextFieldWithValidation from "../../TextFieldWithValidation"; import styles from "./SlackChannel.css"; @@ -108,9 +110,9 @@ const SlackChannel: FunctionComponent = ({ )} - - - {({ input }) => ( + + + {({ input, meta }) => ( <> @@ -127,16 +129,17 @@ const SlackChannel: FunctionComponent = ({ Slack channels, follow the instructions here. - )}