-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOSIP-36145: Integration of ROOT and Intermediate CA Certificates
Signed-off-by: Swetha K <[email protected]>
- Loading branch information
Swetha K
committed
Dec 12, 2024
1 parent
2fd0017
commit e869ef5
Showing
16 changed files
with
358 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
pmp-revamp-ui/src/pages/admin/certificates/CertificateTab.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { onPressEnterKey } from '../../../utils/AppUtils'; | ||
|
||
function CertificateTab({ activeRootCA, rootCertificatesPath, activeIntermediateCA, intermediateCertificatesPath }) { | ||
|
||
const { t } = useTranslation(); | ||
const navigate = useNavigate(); | ||
|
||
const changeToRootCA = () => { | ||
navigate(rootCertificatesPath) | ||
}; | ||
|
||
const changeToIntermediateCA = () => { | ||
navigate(intermediateCertificatesPath) | ||
}; | ||
|
||
return ( | ||
<div className='flex text-xs bg-[#FCFCFC] font-bold space-x-16 items-start rounded-lg px-[1.5%] pt-[2%] mt-3'> | ||
<div className={`flex-col justify-center text-center`}> | ||
<h6 id='root_of_trust_certificates_tab' onClick={changeToRootCA} | ||
className={`${activeRootCA ? "text-[#1447b2]" : "text-[#031640]"} mb-[12%] cursor-pointer text-sm`} | ||
tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, changeToRootCA)}> | ||
{t('certificatesList.rootCA')} | ||
</h6> | ||
<div className={`h-1 w-24 ${activeRootCA ? "bg-tory-blue" : "bg-transparent"} rounded-t-md`}></div> | ||
</div> | ||
<div className={`flex-col justify-center text-center`}> | ||
<h6 id='intermediate_root_of_trust_certificates_tab' onClick={changeToIntermediateCA} | ||
className={`${activeIntermediateCA ? "text-[#1447b2]" : "text-[#031640]"} mb-[7%] cursor-pointer text-sm`} | ||
tabIndex="0" onKeyPress={(e) => onPressEnterKey(e, changeToIntermediateCA)}> | ||
{t('certificatesList.intermediateCA')} | ||
</h6> | ||
<div className={`h-1 w-32 ${activeIntermediateCA ? "bg-tory-blue" : "bg-transparent"} rounded-t-md`}></div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default CertificateTab; |
128 changes: 128 additions & 0 deletions
128
pmp-revamp-ui/src/pages/admin/certificates/CertificatesFilter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
|
||
import { useState, useEffect } from 'react'; | ||
import DropdownComponent from '../../common/fields/DropdownComponent.js'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { createDropdownData, isLangRTL } from '../../../utils/AppUtils.js'; | ||
import TextInputComponent from '../../common/fields/TextInputComponent.js'; | ||
import { getUserProfile } from '../../../services/UserProfileService.js'; | ||
|
||
function CertificatesFilter({ onApplyFilter }) { | ||
const { t } = useTranslation(); | ||
const isLoginLanguageRTL = isLangRTL(getUserProfile().langCode); | ||
const [partnerDomainData, setPartnerDomainData] = useState([]); | ||
const [partnerDomainDropdownData, setPartnerDomainDropdownData] = useState([ | ||
{ partnerDomain: 'FTM' }, | ||
{ partnerDomain: 'DEVICE' }, | ||
{ partnerDomain: 'AUTH' } | ||
]); | ||
const [statusData, setStatusData] = useState([]); | ||
const [statusDropdownData, setStatusDropdownData] = useState([ | ||
{ status: 'active' }, | ||
{ status: 'deactivated' } | ||
]); | ||
const [filters, setFilters] = useState({ | ||
certificateId: "", | ||
partnerDomain: "", | ||
issuedTo: "", | ||
issuedBy: "", | ||
status: "", | ||
}); | ||
|
||
useEffect(() => { | ||
const fetchData = async () => { | ||
setPartnerDomainData( | ||
createDropdownData("partnerDomain", "", true, partnerDomainDropdownData, t, t("certificatesList.selectPartnerDomain")) | ||
); | ||
setStatusData( | ||
createDropdownData("status", "", true, statusDropdownData, t, t("partnerList.selectStatus")) | ||
); | ||
}; | ||
fetchData(); | ||
}, [t]); | ||
|
||
const onFilterChangeEvent = (fieldName, selectedFilter) => { | ||
setFilters((prevFilters) => ({ | ||
...prevFilters, | ||
[fieldName]: selectedFilter | ||
})); | ||
}; | ||
|
||
const areFiltersEmpty = () => { | ||
return Object.values(filters).every(value => value === ""); | ||
}; | ||
|
||
const styles = { | ||
dropdownButton: "min-w-64", | ||
}; | ||
|
||
const styleSet = { | ||
inputField: "min-w-64", | ||
inputLabel: "mb-2", | ||
outerDiv: "ml-4" | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className="flex w-full p-2 justify-start bg-[#F7F7F7] flex-wrap"> | ||
<TextInputComponent | ||
fieldName="certificateId" | ||
onTextChange={onFilterChangeEvent} | ||
fieldNameKey="certificatesList.certificateId" | ||
placeHolderKey="certificatesList.searchCertificateId" | ||
styleSet={styleSet} | ||
id="cert_id_filter" | ||
/> | ||
<DropdownComponent | ||
fieldName="partnerDomain" | ||
dropdownDataList={partnerDomainData} | ||
onDropDownChangeEvent={onFilterChangeEvent} | ||
fieldNameKey="certificatesList.partnerDomain" | ||
placeHolderKey="certificatesList.selectPartnerDomain" | ||
styleSet={styles} | ||
isPlaceHolderPresent={true} | ||
id="cert_partner_domain_filter" | ||
/> | ||
<TextInputComponent | ||
fieldName='issuedTo' | ||
onTextChange={onFilterChangeEvent} | ||
fieldNameKey='certificatesList.issuedTo' | ||
placeHolderKey='certificatesList.searchIssuedTo' | ||
styleSet={styleSet} | ||
id='cert_issued_to_filter' | ||
/> | ||
<TextInputComponent | ||
fieldName='issuedBy' | ||
onTextChange={onFilterChangeEvent} | ||
fieldNameKey='certificatesList.issuedBy' | ||
placeHolderKey='certificatesList.searchIssuedBy' | ||
styleSet={styleSet} | ||
id='cert_issued_by_domain_filter' | ||
/> | ||
<DropdownComponent | ||
fieldName='status' | ||
dropdownDataList={statusData} | ||
onDropDownChangeEvent={onFilterChangeEvent} | ||
fieldNameKey='certificatesList.status' | ||
placeHolderKey='certificatesList.selectStatus' | ||
styleSet={styles} | ||
isPlaceHolderPresent={true} | ||
id='cert_status_filter' | ||
/> | ||
<div className={`mt-6 mr-6 ${isLoginLanguageRTL ? "mr-auto" : "ml-auto"}`}> | ||
<button | ||
id="apply_filter__btn" | ||
onClick={() => onApplyFilter(filters)} | ||
type="button" | ||
disabled={areFiltersEmpty()} | ||
className={`h-10 text-sm font-semibold px-7 text-white rounded-md ml-6 | ||
${areFiltersEmpty() ? 'bg-[#A5A5A5] cursor-auto' : 'bg-tory-blue'}`} | ||
> | ||
{t("partnerList.applyFilter")} | ||
</button> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default CertificatesFilter; |
Oops, something went wrong.