From dc03cb063def31573c2cb9169df999424e846136 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Thu, 7 Dec 2023 23:23:15 +0100 Subject: [PATCH] more standards rewrite --- .../tenant/standards/ListAppliedStandards.jsx | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/views/tenant/standards/ListAppliedStandards.jsx b/src/views/tenant/standards/ListAppliedStandards.jsx index 2210ab9f89b0..78e26adfbb0d 100644 --- a/src/views/tenant/standards/ListAppliedStandards.jsx +++ b/src/views/tenant/standards/ListAppliedStandards.jsx @@ -39,8 +39,8 @@ import GDAPRoles from 'src/data/GDAPRoles' const RefreshAction = () => { const [execStandards, execStandardsResults] = useLazyGenericGetRequestQuery() - - const showModal = () => + const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName) + const showModal = (selectedTenant) => ModalService.confirm({ body: (
@@ -48,7 +48,8 @@ const RefreshAction = () => { Please note: this runs every three hours automatically.
), - onConfirm: () => execStandards({ path: 'api/Standards_OrchestrationStarter' }), + onConfirm: () => + execStandards({ path: `api/ExecStandardsRun?Tenantfilter=${selectedTenant}` }), }) return ( @@ -57,14 +58,24 @@ const RefreshAction = () => { 'Already running. Please wait for the current instance to finish' && (
{execStandardsResults.data?.Results}
)} - - {execStandardsResults.isLoading && } - {execStandardsResults.error && ( - - )} - {execStandardsResults.isSuccess && } - Run Standards Now - +

+ showModal('AllTenants')} size="sm" className="m-1"> + {execStandardsResults.isLoading && } + {execStandardsResults.error && ( + + )} + {execStandardsResults.isSuccess && } + Run Standards Now (All Tenants) + + showModal(tenantDomain)} size="sm" className="m-1"> + {execStandardsResults.isLoading && } + {execStandardsResults.error && ( + + )} + {execStandardsResults.isSuccess && } + Run Standards Now (Selected Tenant) + +

) }