diff --git a/web/common/FieldInput/index.tsx b/web/common/FieldInput/index.tsx index 77313a346..a38c07cea 100644 --- a/web/common/FieldInput/index.tsx +++ b/web/common/FieldInput/index.tsx @@ -23,8 +23,6 @@ export const FieldInput = memo(function FieldInput(props: FieldInputInterface) { ...otherProps } = props; - console.log(error); - return (
diff --git a/web/scenes/action/Deployment/HostedPage/index.tsx b/web/scenes/action/Deployment/HostedPage/index.tsx index d529fa0bc..416ae5488 100644 --- a/web/scenes/action/Deployment/HostedPage/index.tsx +++ b/web/scenes/action/Deployment/HostedPage/index.tsx @@ -4,9 +4,10 @@ import { actionLogic } from "logics/actionLogic"; import cn from "classnames"; import { Field as ActionField } from "scenes/action/ActionHeader/Field"; import { Field } from "kea-forms"; +import { validateUrl } from "utils"; export function HostedPage(props: { actionId: string }) { - const { actionUrls } = useValues(actionLogic); + const { actionUrls, currentAction } = useValues(actionLogic); return (
@@ -49,7 +50,18 @@ export function HostedPage(props: { actionId: string }) { value={value} onChange={(e) => onChange(e.target.value)} name="return_url" - error={error} + // FIXME: temorary fix form validate, wait for close this https://github.com/keajs/kea-forms/issues/1 + error={ + error + ? error + : value.length <= 0 + ? "Please enter a return URL" + : !validateUrl(value, currentAction?.is_staging) + ? `Please enter a valid URL${ + !currentAction?.is_staging ? " over https://" : "" + }` + : "" + } type="text" /> )}