Skip to content

Commit

Permalink
MOSIP-36036: Sonar bugs, security hotspots, duplications for UI code
Browse files Browse the repository at this point in the history
Signed-off-by: Anil_Kumar_Majji <106086523+Anil-kumar-Majji@users.noreply.github.com>
  • Loading branch information
Anil-kumar-Majji committed Jan 8, 2025
1 parent 7274409 commit 7f649f8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,12 @@ function ViewAdminOidcClientDetails() {
<div role='button' id="oidc_client_details_copy_id" className={`${oidcClientDetails.status === "ACTIVE" ? 'bg-[#F0F5FF] border-[#BED3FF] cursor-pointer hover:shadow-md' : 'bg-gray-200 border-gray-400'} border h-[4%] w-[15%] max-[450px]:w-[40%] max-[800px]:w-[25%] ${isLoginLanguageRTL ? "pr-[3%] pl-[1.5%]" : "pl-[3%] pr-[1%]"} py-[0.5%] rounded-md text-right`}
tabIndex={oidcClientDetails.status === "ACTIVE" && "0"} onKeyDown={(e) => onPressEnterKey(e, () => copyClientId(selectedClientData, selectedClientData.clientId, setCopied))}>
<p className="text-sm font-semibold text-[#333333]">{t('viewOidcClientDetails.oidcClientId')}</p>
<div className="flex space-x-1 items-center">
<div id="oidc_client_details_copy_id_button" onClick={() => copyClientId(selectedClientData, selectedClientData.clientId, setCopied)} className="flex space-x-1 items-center">
<p className={`text-md font-bold ${selectedClientData.status === "ACTIVE" ? 'text-[#1447B2]' : 'text-gray-400'} truncate`}>
{selectedClientData.clientId}
</p>
{selectedClientData.status === "ACTIVE" ? (
<button id="oidc_client_details_copy_id_button" onClick={() => copyClientId(selectedClientData, selectedClientData.clientId, setCopied)}>
<img src={content_copy_icon} alt="" />
</button>
<img src={content_copy_icon} alt="" />
) : (
<img src={disabled_copy_icon} alt="" />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ function DeviceProviderServiceTab({ activeSbi, sbiListPath, activeDevice, device
return (
<div className='flex text-xs bg-[#FCFCFC] font-bold space-x-16 items-start rounded-lg px-[1.5%] pt-[2%]'>
<div className={`flex-col items-center`}>
<button id='sbi_tab' onClick={changeToSbi} className={`${activeSbi ? "text-[#1447b2]" : "text-[#031640]"} mb-[0.6rem] cursor-pointer text-sm`}>
<div role='button' id='sbi_tab' onClick={changeToSbi} className={`${activeSbi ? "text-[#1447b2]" : "text-[#031640]"} mb-[0.6rem] cursor-pointer text-sm text-center`}
tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, changeToSbi)}>
<h6> {t('deviceProviderServices.sbiDetails')} </h6>
</button>
</div>

<div className={`h-1 w-20 ${activeSbi ? "bg-tory-blue" : "bg-transparent"} rounded-t-md`}></div>
</div>
<div className={`flex-col justify-center`}>
<button id='devices_tab' onClick={changeToDevice} className={`${activeDevice ? "text-[#1447b2]" : "text-[#031640]"} mb-[12%] cursor-pointer text-sm text-center`}>
<div role='button' id='devices_tab' onClick={changeToDevice} className={`${activeDevice ? "text-[#1447b2]" : "text-[#031640]"} mb-[12%] cursor-pointer text-sm text-center`}
tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, changeToDevice)}>
<h6> {t('deviceProviderServices.deviceDetails')} </h6>
</button>
</div>

<div className={`h-1 w-20 ${activeDevice ? "bg-tory-blue" : "bg-transparent"} rounded-t-md`}></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ function ViewOidcClientDetails() {
<div role='button' id="oidc_client_details_copy_id" className={`${oidcClientDetails.status === "ACTIVE" ? 'bg-[#F0F5FF] border-[#BED3FF] cursor-pointer hover:shadow-md' : 'bg-gray-200 border-gray-400'} border h-[4%] w-[15%] max-[450px]:w-[40%] max-[800px]:w-[25%] ${isLoginLanguageRTL ? "pr-[3%] pl-[1.5%]" : "pl-[3%] pr-[1%]"} py-[0.5%] rounded-md text-right`}
tabIndex="0" onKeyDown={(e) => onPressEnterKey(e, () => copyClientId(oidcClientDetails, oidcClientDetails.clientId, setCopied))}>
<p className="text-sm font-semibold text-[#333333]">{t('viewOidcClientDetails.oidcClientId')}</p>
<div className="flex space-x-1 items-center">
<div role="button" id="oidc_client_details_copy_id_icon" onClick={() => copyClientId(oidcClientDetails, oidcClientDetails.clientId, setCopied)} className="flex space-x-1 items-center">
<p className={`text-md font-bold ${oidcClientDetails.status === "ACTIVE" ? 'text-[#1447B2]' : 'text-gray-400'} truncate`}>
{oidcClientDetails.clientId}
</p>
{oidcClientDetails.status === "ACTIVE" ? (
<button id="oidc_client_details_copy_id_icon" onClick={() => copyClientId(oidcClientDetails, oidcClientDetails.clientId, setCopied)} >
<img src={content_copy_icon} alt="" />
</button>
<img src={content_copy_icon} alt="" />
) : (
<img src={disabled_copy_icon} alt="" />
)}
Expand Down
2 changes: 1 addition & 1 deletion pmp-revamp-ui/src/svg/content_copy_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7f649f8

Please sign in to comment.