Skip to content

Commit

Permalink
MOSIP-34549: Fixed to show only View Option in Action Menu after deac…
Browse files Browse the repository at this point in the history
…tivation (#610)

Signed-off-by: Anil_Kumar_Majji <[email protected]>
  • Loading branch information
Anil-kumar-Majji authored Jul 18, 2024
1 parent 12a8a62 commit c8cf662
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
14 changes: 8 additions & 6 deletions pmp-reactjs-ui/src/pages/authenticationServices/ApiKeysList.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function ApiKeysList() {
<tr>
{tableHeaders.map((header, index) => {
return (
<th key={index} className={`py-4 text-xs text-[#6F6E6E] lg:w-[14%] ${header.id === "policyName" && 'pl-4'} ${header.id === "apiKeyLabel" && (isLoginLanguageRTL?"pr-9":"pl-9")} ${header.id === "crDtimes" && (isLoginLanguageRTL?"pr-7":"pl-7")} ${header.id === "status" && (isLoginLanguageRTL ? "pr-12" : "pl-12")} ${header.id === "action" && (isLoginLanguageRTL ? "pr-12" : "pl-12")} `}>
<th key={index} className={`py-4 text-xs text-[#6F6E6E] lg:w-[14%] ${header.id === "policyName" && 'pl-4'} ${header.id === "apiKeyLabel" && (isLoginLanguageRTL ? "pr-9" : "pl-9")} ${header.id === "crDtimes" && (isLoginLanguageRTL ? "pr-7" : "pl-7")} ${header.id === "status" && (isLoginLanguageRTL ? "pr-12" : "pl-12")} ${header.id === "action" && (isLoginLanguageRTL ? "pr-12" : "pl-12")} `}>
<div className="flex gap-x-1 items-center font-semibold">
{t(header.headerNameKey)}
{(header.id !== "action") && (header.id !== "apiKeyReqID") && (
Expand All @@ -257,8 +257,8 @@ function ApiKeysList() {
return (
<tr key={index} className={`border-t border-[#E5EBFA] text-[0.8rem] text-[#191919] font-semibold ${client.status === "INACTIVE" ? "text-[#969696]" : "text-[#191919] cursor-pointer"}`}>
<td onClick={() => showViewApiKeyClientDetails(client)}>{client.partnerId}</td>
<td onClick={() => showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL?"pr-9":"pl-2"} break-all break-normal`}>{client.policyGroupName}</td>
<td onClick={() => showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL?"pl-8":"px-4"} break-all break-normal`}>{client.policyName}</td>
<td onClick={() => showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-9" : "pl-2"} break-all break-normal`}>{client.policyGroupName}</td>
<td onClick={() => showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL ? "pl-8" : "px-4"} break-all break-normal`}>{client.policyName}</td>
<td onClick={() => showViewApiKeyClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-9" : "pl-9"} break-all break-normal`}>
{client.apiKeyLabel}
</td>
Expand All @@ -278,9 +278,11 @@ function ApiKeysList() {
{t('oidcClientsList.view')}
</p>
<hr className="h-px bg-gray-100 border-0 mx-1" />
<p onClick={() => 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')}
</p>
{client.status === "ACTIVE" &&
(<p onClick={() => 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')}
</p>
)}
{showDeactivatePopup && (
<DeactivatePopup closePopUp={setShowDeactivatePopup} clientData={client} request={deactivateRequest} headerMsg='deactivateApiKey.apiKeyName' descriptionMsg='deactivateApiKey.description' clientName={client.apiKeyLabel}></DeactivatePopup>
)}
Expand Down
22 changes: 13 additions & 9 deletions pmp-reactjs-ui/src/pages/authenticationServices/OidcClientsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ function OidcClientsList() {
});
setDeactivateRequest(request);
setShowDeactivatePopup(true);
document.body.style.overflow="hidden";
document.body.style.overflow = "hidden";
}
};

const showCopyPopUp = (client) => {
if (client.status.toLowerCase() === "active") {
setCurrentClient(client);
setShowPopup(true);
document.body.style.overflow="hidden"
document.body.style.overflow = "hidden"
}
};

Expand Down Expand Up @@ -289,9 +289,9 @@ function OidcClientsList() {
<td onClick={() => showViewOidcClientDetails(client)}>{client.partnerId}</td>
<td onClick={() => showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-12" : "pl-2"} break-all break-normal break-word`}>{client.policyGroupName}</td>
<td onClick={() => showViewOidcClientDetails(client)} className={`px-4 break-all break-normal break-words`}>{client.policyName}</td>
<td onClick={() => showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL?"pl-3":"pr-1"} break-all break-normal break-words`}>{client.oidcClientName}</td>
<td onClick={() => showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pl-3" : "pr-1"} break-all break-normal break-words`}>{client.oidcClientName}</td>
<td onClick={() => showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-3" : "pl-9"}`}>{formatDate(client.crDtimes, 'date')}</td>
<td onClick={() => showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-5":"pl-10"}`}>
<td onClick={() => showViewOidcClientDetails(client)} className={`${isLoginLanguageRTL ? "pr-5" : "pl-10"}`}>
<div className={`${bgOfStatus(client.status)} flex w-fit py-1.5 px-2 my-3 text-xs font-semibold rounded-md`}>
{getStatusCode(client.status, t)}
</div>
Expand All @@ -313,17 +313,21 @@ function OidcClientsList() {
<p onClick={() => setViewClientId(index)} className={`${isLoginLanguageRTL ? "ml-9" : "mr-9"} font-semibold mb-0.5 cursor-pointer text-[#1447B2]`}>...</p>
{viewClientId === index && (
<div ref={submenuRef} className={`absolute w-[7%] bg-white text-xs font-semibold rounded-lg shadow-md border ${isLoginLanguageRTL ? "mr-16 left-20 max-[1100px]:left-20 max-[780px]:w-fit max-[800px]:left-10 max-[400px]:left-8 text-right" : "right-20 text-left"}`}>
<p onClick={() => onClickView(client)} className={`${isLoginLanguageRTL ?"pr-3" :"pl-3"} py-2 cursor-pointer text-[#3E3E3E] hover:bg-gray-100`}>
<p onClick={() => onClickView(client)} className={`${isLoginLanguageRTL ? "pr-3" : "pl-3"} py-2 cursor-pointer text-[#3E3E3E] hover:bg-gray-100`}>
{t('oidcClientsList.view')}
</p>
<hr className="h-px bg-gray-100 border-0 mx-1" />
<p onClick={() => showEditOidcClient(client)} className={`${isLoginLanguageRTL ?"pr-3" :"pl-3"} py-2 ${client.status === "ACTIVE" ? 'text-[#3E3E3E] cursor-pointer hover:bg-gray-100' : 'text-[#BEBEBE]'}`}>
<p onClick={() => 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')}
</p>
<hr className="h-px bg-gray-100 border-0 mx-1" />
<p onClick={() => 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')}
</p>
{client.status === "ACTIVE" &&
(
<p onClick={() => 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')}
</p>
)
}
{showDeactivatePopup && (
<DeactivatePopup closePopUp={setShowDeactivatePopup} clientData={client} request={deactivateRequest} headerMsg='deactivateOidcClient.oidcClientName' descriptionMsg='deactivateOidcClient.description' clientName={client.oidcClientName}></DeactivatePopup>
)}
Expand Down

0 comments on commit c8cf662

Please sign in to comment.