From 0fef79926fc5ebb7d279e71061baa6ebf1f9c42a Mon Sep 17 00:00:00 2001 From: Martavis Parker <47053705+martavis@users.noreply.github.com> Date: Tue, 15 Mar 2022 23:38:19 -0700 Subject: [PATCH] Host expiry setting to validate on change (#4604) * cleaned up old conflicting tooltip styles * fixed hsot expiry validation; validate on change --- .../admin/AppConfigForm/AppConfigForm.tsx | 152 ++++++++---------- .../forms/admin/AppConfigForm/_styles.scss | 46 ------ .../ManageAutomationsModal.tsx | 30 ++-- .../ManageAutomationsModal/_styles.scss | 36 ----- .../ManageAutomationsModal.tsx | 30 ++-- .../ManageAutomationsModal/_styles.scss | 36 ----- 6 files changed, 98 insertions(+), 232 deletions(-) diff --git a/frontend/components/forms/admin/AppConfigForm/AppConfigForm.tsx b/frontend/components/forms/admin/AppConfigForm/AppConfigForm.tsx index d6d914f838..e0dceb01ba 100644 --- a/frontend/components/forms/admin/AppConfigForm/AppConfigForm.tsx +++ b/frontend/components/forms/admin/AppConfigForm/AppConfigForm.tsx @@ -219,7 +219,7 @@ const AppConfigFormFunctional = ({ } if (enableHostExpiry) { - if (!hostExpiryWindow) { + if (!hostExpiryWindow || hostExpiryWindow <= 0) { errors.host_expiry_window = "Host expiry window must be a positive number"; } @@ -235,7 +235,7 @@ const AppConfigFormFunctional = ({ setFormErrors(errors); }; - // Validates forms when certain checkboxes and dropdowns are selected + // Validates forms when certain information is changed useEffect(() => { validateForm(); }, [ @@ -245,6 +245,7 @@ const AppConfigFormFunctional = ({ enableHostStatusWebhook, enableHostExpiry, agentOptions, + hostExpiryWindow, ]); // TOGGLE MODALS @@ -832,86 +833,73 @@ const AppConfigFormFunctional = ({
Add a policy to turn on automations.
)} -