From c8cf6629f3ff45c005a1d5b8391bfd9ef611c268 Mon Sep 17 00:00:00 2001 From: Anil_Kumar_Majji <106086523+Anil-kumar-Majji@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:46:14 +0530 Subject: [PATCH] MOSIP-34549: Fixed to show only View Option in Action Menu after deactivation (#610) Signed-off-by: Anil_Kumar_Majji <106086523+Anil-kumar-Majji@users.noreply.github.com> --- .../authenticationServices/ApiKeysList.js | 14 +++++++----- .../authenticationServices/OidcClientsList.js | 22 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/pmp-reactjs-ui/src/pages/authenticationServices/ApiKeysList.js b/pmp-reactjs-ui/src/pages/authenticationServices/ApiKeysList.js index fe2f8a0d5..9d221d220 100644 --- a/pmp-reactjs-ui/src/pages/authenticationServices/ApiKeysList.js +++ b/pmp-reactjs-ui/src/pages/authenticationServices/ApiKeysList.js @@ -239,7 +239,7 @@ function ApiKeysList() { {tableHeaders.map((header, index) => { return ( - +
{t(header.headerNameKey)} {(header.id !== "action") && (header.id !== "apiKeyReqID") && ( @@ -257,8 +257,8 @@ function ApiKeysList() { return ( showViewApiKeyClientDetails(client)}>{client.partnerId} - showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL?"pr-9":"pl-2"} break-all break-normal`}>{client.policyGroupName} - showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL?"pl-8":"px-4"} break-all break-normal`}>{client.policyName} + showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-9" : "pl-2"} break-all break-normal`}>{client.policyGroupName} + showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL ? "pl-8" : "px-4"} break-all break-normal`}>{client.policyName} showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-9" : "pl-9"} break-all break-normal`}> {client.apiKeyLabel} @@ -278,9 +278,11 @@ function ApiKeysList() { {t('oidcClientsList.view')}


-

onClickDeactivate(client)} className={`${isLoginLanguageRTL ? "pr-3" : "pl-3"} py-2 ${client.status === "ACTIVE" ? 'text-crimson-red cursor-pointer hover:bg-gray-100' : 'text-[#D8ADAD]'}`}> - {t('oidcClientsList.deActivate')} -

+ {client.status === "ACTIVE" && + (

onClickDeactivate(client)} className={`${isLoginLanguageRTL ? "pr-3" : "pl-3"} break-all break-normal py-2 text-crimson-red cursor-pointer hover:bg-gray-100`}> + {t('oidcClientsList.deActivate')} +

+ )} {showDeactivatePopup && ( )} diff --git a/pmp-reactjs-ui/src/pages/authenticationServices/OidcClientsList.js b/pmp-reactjs-ui/src/pages/authenticationServices/OidcClientsList.js index 76a81d318..9d424941c 100644 --- a/pmp-reactjs-ui/src/pages/authenticationServices/OidcClientsList.js +++ b/pmp-reactjs-ui/src/pages/authenticationServices/OidcClientsList.js @@ -134,7 +134,7 @@ function OidcClientsList() { }); setDeactivateRequest(request); setShowDeactivatePopup(true); - document.body.style.overflow="hidden"; + document.body.style.overflow = "hidden"; } }; @@ -142,7 +142,7 @@ function OidcClientsList() { if (client.status.toLowerCase() === "active") { setCurrentClient(client); setShowPopup(true); - document.body.style.overflow="hidden" + document.body.style.overflow = "hidden" } }; @@ -289,9 +289,9 @@ function OidcClientsList() { showViewOidcClientDetails(client)}>{client.partnerId} showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-12" : "pl-2"} break-all break-normal break-word`}>{client.policyGroupName} showViewOidcClientDetails(client)} className={`px-4 break-all break-normal break-words`}>{client.policyName} - showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL?"pl-3":"pr-1"} break-all break-normal break-words`}>{client.oidcClientName} + showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pl-3" : "pr-1"} break-all break-normal break-words`}>{client.oidcClientName} showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-3" : "pl-9"}`}>{formatDate(client.crDtimes, 'date')} - showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-5":"pl-10"}`}> + showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-5" : "pl-10"}`}>
{getStatusCode(client.status, t)}
@@ -313,17 +313,21 @@ function OidcClientsList() {

setViewClientId(index)} className={`${isLoginLanguageRTL ? "ml-9" : "mr-9"} font-semibold mb-0.5 cursor-pointer text-[#1447B2]`}>...

{viewClientId === index && (
-

onClickView(client)} className={`${isLoginLanguageRTL ?"pr-3" :"pl-3"} py-2 cursor-pointer text-[#3E3E3E] hover:bg-gray-100`}> +

onClickView(client)} className={`${isLoginLanguageRTL ? "pr-3" : "pl-3"} py-2 cursor-pointer text-[#3E3E3E] hover:bg-gray-100`}> {t('oidcClientsList.view')}


-

showEditOidcClient(client)} className={`${isLoginLanguageRTL ?"pr-3" :"pl-3"} py-2 ${client.status === "ACTIVE" ? 'text-[#3E3E3E] cursor-pointer hover:bg-gray-100' : 'text-[#BEBEBE]'}`}> +

showEditOidcClient(client)} className={`${isLoginLanguageRTL ? "pr-3" : "pl-3"} py-2 ${client.status === "ACTIVE" ? 'text-[#3E3E3E] cursor-pointer hover:bg-gray-100' : 'text-[#BEBEBE]'}`}> {t('oidcClientsList.edit')}


-

showDeactivateOidcClient(client)} className={`${isLoginLanguageRTL ?"pr-3" :"pl-3"} break-all break-normal py-2 ${client.status === "ACTIVE" ? 'text-crimson-red cursor-pointer hover:bg-gray-100' : 'text-[#D8ADAD]'}`}> - {t('oidcClientsList.deActivate')} -

+ {client.status === "ACTIVE" && + ( +

showDeactivateOidcClient(client)} className={`${isLoginLanguageRTL ? "pr-3" : "pl-3"} break-all break-normal py-2 text-crimson-red cursor-pointer hover:bg-gray-100`}> + {t('oidcClientsList.deActivate')} +

+ ) + } {showDeactivatePopup && ( )}