From e6efeeb2339d5524628ebff3cbafb87906129f45 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 29 Mar 2024 01:23:39 -0400 Subject: [PATCH 1/2] Update MailTest.jsx --- src/views/email-exchange/tools/MailTest.jsx | 38 +++++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/views/email-exchange/tools/MailTest.jsx b/src/views/email-exchange/tools/MailTest.jsx index bc98185de466..9c31a1eb8155 100644 --- a/src/views/email-exchange/tools/MailTest.jsx +++ b/src/views/email-exchange/tools/MailTest.jsx @@ -1,3 +1,4 @@ +import { CButton, CSpinner } from '@coreui/react' import React from 'react' import { CippCallout, CippPageList } from 'src/components/layout' import { cellBooleanFormatter, cellDateFormatter } from 'src/components/tables' @@ -5,11 +6,15 @@ import { cellGenericFormatter } from 'src/components/tables/CellGenericFormat' import { useGenericGetRequestQuery } from 'src/store/api/app' const MailTest = () => { - const { data: config, isSuccess } = useGenericGetRequestQuery({ + const configQuery = useGenericGetRequestQuery({ path: '/api/ExecMailTest', params: { Action: 'CheckConfig' }, }) + function handleConfigRetry() { + configQuery.refetch() + } + const columns = [ { name: 'Received', @@ -73,14 +78,33 @@ const MailTest = () => { ] return (
- {isSuccess && ( - - {config?.HasMailRead && - 'Mail Test Email: ' + config?.MailAddresses.filter((x) => x?.IsPrimary)[0]?.Address} - {config?.HasMailRead == false && 'Permission Check: ' + config?.Message} + {configQuery.isSuccess && ( + + {configQuery.data?.HasMailRead && ( + <> + Mail test email: + x?.IsPrimary)[0]?.Address + } + > + {configQuery.data?.MailAddresses.filter((x) => x?.IsPrimary)[0]?.Address} + + + )} + {configQuery.data?.HasMailRead == false && ( + <> + Permission Check: {configQuery.data?.Message}{' '} + handleConfigRetry()}> + Retry + + + )} )} - {isSuccess && config?.HasMailRead === true && ( + {configQuery.isLoading && } + {configQuery.isSuccess && configQuery.data?.HasMailRead === true && ( Date: Fri, 29 Mar 2024 08:38:35 -0400 Subject: [PATCH 2/2] Update MailTest.jsx --- src/views/email-exchange/tools/MailTest.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/email-exchange/tools/MailTest.jsx b/src/views/email-exchange/tools/MailTest.jsx index 9c31a1eb8155..d433e658dba3 100644 --- a/src/views/email-exchange/tools/MailTest.jsx +++ b/src/views/email-exchange/tools/MailTest.jsx @@ -1,4 +1,5 @@ import { CButton, CSpinner } from '@coreui/react' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import React from 'react' import { CippCallout, CippPageList } from 'src/components/layout' import { cellBooleanFormatter, cellDateFormatter } from 'src/components/tables' @@ -96,8 +97,8 @@ const MailTest = () => { {configQuery.data?.HasMailRead == false && ( <> Permission Check: {configQuery.data?.Message}{' '} - handleConfigRetry()}> - Retry + handleConfigRetry()}> + {configQuery.isLoading ? : } Retry )}