From 2c1bab784b123c14cf40dfa60b343579436704d0 Mon Sep 17 00:00:00 2001 From: P Aswini Kumar Date: Thu, 6 Jan 2022 02:04:23 +0530 Subject: [PATCH 1/4] EditOutgoingWebhook buttons --- client/views/admin/integrations/edit/EditOutgoingWebhook.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/views/admin/integrations/edit/EditOutgoingWebhook.js b/client/views/admin/integrations/edit/EditOutgoingWebhook.js index 0c8d44ccab2b..954189e538b2 100644 --- a/client/views/admin/integrations/edit/EditOutgoingWebhook.js +++ b/client/views/admin/integrations/edit/EditOutgoingWebhook.js @@ -42,7 +42,7 @@ function EditOutgoingWebhook({ data, onChange, setSaveAction, ...props }) { const t = useTranslation(); const dispatchToastMessage = useToastMessageDispatch(); - const { handlers: formHandlers, values: formValues, reset } = useForm(getInitialValue(data)); + const { handlers: formHandlers, values: formValues, hasUnsavedChanges, reset } = useForm(getInitialValue(data)); const setModal = useSetModal(); const saveIntegration = useMethod('updateOutgoingIntegration'); @@ -101,10 +101,10 @@ function EditOutgoingWebhook({ data, onChange, setSaveAction, ...props }) { - - From 89c9b3ba15aa39eb2c2b62ec9f5688f94ba88193 Mon Sep 17 00:00:00 2001 From: P Aswini Kumar Date: Thu, 6 Jan 2022 02:07:33 +0530 Subject: [PATCH 2/4] EditIncomingWebhook buttons --- client/views/admin/integrations/edit/EditIncomingWebhook.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/views/admin/integrations/edit/EditIncomingWebhook.js b/client/views/admin/integrations/edit/EditIncomingWebhook.js index 8e5f7cbbca3b..a7be8f0ab5d8 100644 --- a/client/views/admin/integrations/edit/EditIncomingWebhook.js +++ b/client/views/admin/integrations/edit/EditIncomingWebhook.js @@ -30,7 +30,7 @@ function EditIncomingWebhook({ data, onChange, ...props }) { const t = useTranslation(); const dispatchToastMessage = useToastMessageDispatch(); - const { values: formValues, handlers: formHandlers, reset } = useForm(getInitialValue(data)); + const { values: formValues, handlers: formHandlers, hasUnsavedChanges, reset } = useForm(getInitialValue(data)); const setModal = useSetModal(); const deleteQuery = useMemo(() => ({ type: 'webhook-incoming', integrationId: data._id }), [data._id]); @@ -81,10 +81,10 @@ function EditIncomingWebhook({ data, onChange, ...props }) { - - From 42d61b72436f62d56313bb3a625745570bc4ef41 Mon Sep 17 00:00:00 2001 From: P Aswini Kumar Date: Thu, 6 Jan 2022 02:11:52 +0530 Subject: [PATCH 3/4] NewIncomingWebhook buttons --- client/views/admin/integrations/new/NewIncomingWebhook.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/views/admin/integrations/new/NewIncomingWebhook.js b/client/views/admin/integrations/new/NewIncomingWebhook.js index 6cac82cc34d5..8596602d5610 100644 --- a/client/views/admin/integrations/new/NewIncomingWebhook.js +++ b/client/views/admin/integrations/new/NewIncomingWebhook.js @@ -24,7 +24,7 @@ export default function NewIncomingWebhook(props) { const router = useRoute('admin-integrations'); - const { values: formValues, handlers: formHandlers, reset } = useForm(initialState); + const { values: formValues, handlers: formHandlers, hasUnsavedChanges, reset } = useForm(initialState); const params = useMemo(() => ({ ...formValues, type: 'webhook-incoming' }), [formValues]); const saveAction = useEndpointAction('POST', 'integrations.create', params, t('Integration_added')); @@ -42,10 +42,10 @@ export default function NewIncomingWebhook(props) { - - From 9035c21a3cdc7d885455417c04de7c50160c1727 Mon Sep 17 00:00:00 2001 From: P Aswini Kumar Date: Thu, 6 Jan 2022 02:16:54 +0530 Subject: [PATCH 4/4] NewOutgoingWebhook buttons --- .../integrations/new/NewOutgoingWebhook.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/client/views/admin/integrations/new/NewOutgoingWebhook.js b/client/views/admin/integrations/new/NewOutgoingWebhook.js index 5a84b9afc82d..ecf6177d8b48 100644 --- a/client/views/admin/integrations/new/NewOutgoingWebhook.js +++ b/client/views/admin/integrations/new/NewOutgoingWebhook.js @@ -1,4 +1,4 @@ -import { Field, Button } from '@rocket.chat/fuselage'; +import { Field, Box, Margins, Button } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import React, { useMemo, useCallback } from 'react'; @@ -36,7 +36,7 @@ export default function NewOutgoingWebhook({ data = defaultData, onChange, setSa const t = useTranslation(); const router = useRoute('admin-integrations'); - const { values: formValues, handlers: formHandlers } = useForm({ ...data, token: useUniqueId() }); + const { values: formValues, handlers: formHandlers, hasUnsavedChanges, reset } = useForm({ ...data, token: useUniqueId() }); const { urls, triggerWords } = formValues; @@ -61,9 +61,16 @@ export default function NewOutgoingWebhook({ data = defaultData, onChange, setSa () => ( - + + + + + + ),