diff --git a/src/components/Resources/Schema/SchemasList.tsx b/src/components/Resources/Schema/SchemasList.tsx index 0c3760db6..bc1f9cfb6 100644 --- a/src/components/Resources/Schema/SchemasList.tsx +++ b/src/components/Resources/Schema/SchemasList.tsx @@ -23,7 +23,7 @@ import { checkEcosystem } from '../../../config/ecosystem'; import type { ICheckEcosystem } from '../../../config/ecosystem'; import { Create, SchemaEndorsement } from '../../Issuance/Constant'; -import { DidMethod, SchemaType } from '../../../common/enums'; +import { DidMethod, SchemaType, SchemaTypes } from '../../../common/enums'; const SchemaList = (props: { schemaSelectionCallback: ( @@ -57,6 +57,8 @@ const SchemaList = (props: { const [totalItem, setTotalItem] = useState(0); const [isEcosystemData, setIsEcosystemData] = useState(); const [searchValue, setSearchValue] = useState(''); + const [schemaType, setSchemaType] = useState(''); + const [w3cSchema,setW3CSchema]= useState(false); const [isNoLedger,setisNoLedger]= useState(false); @@ -70,7 +72,7 @@ const SchemaList = (props: { setLoading(true); let schemaList; if (allSchemaFlag) { - schemaList = await getAllSchemas(schemaListAPIParameter, SchemaType.INDY); + schemaList = await getAllSchemas(schemaListAPIParameter, schemaType); } else { schemaList = await getAllSchemasByOrgId( schemaListAPIParameter, @@ -229,9 +231,11 @@ const SchemaList = (props: { } if (did.includes(DidMethod.POLYGON) || did.includes(DidMethod.KEY) || did.includes(DidMethod.WEB)) { setW3CSchema(true); + setSchemaType(SchemaTypes.schema_W3C) } if (did.includes(DidMethod.INDY)) { setW3CSchema(false); + setSchemaType(SchemaTypes.schema_INDY) } if (did.includes(DidMethod.KEY) || did.includes(DidMethod.WEB)) { setisNoLedger(true); diff --git a/src/components/Verification/AttributesListData.tsx b/src/components/Verification/AttributesListData.tsx index 845682abe..9eac679dd 100644 --- a/src/components/Verification/AttributesListData.tsx +++ b/src/components/Verification/AttributesListData.tsx @@ -1,54 +1,46 @@ import { Card } from 'flowbite-react'; +import CopyDid from '../../commonComponents/CopyDid'; interface AttributesListProps { - attributeDataList: { entity: string; properties: any[] }[] + attributeDataList: { [key: string]: any }[] } - const AttributesListData = ({attributeDataList}: AttributesListProps): JSX.Element => { - return ( - <> - -
-
-
- Attributes -
-
-
-
- {' '} - Values -
-
+const AttributesListData = ({ attributeDataList }: AttributesListProps): JSX.Element => { - { - attributeDataList?.map((item, index) => ( -
-
-
- {item?.entity} -
-
- : -
-
- {item?.properties.join(', ')} + return ( + <> + {attributeDataList?.map((item, index) => ( + +
+
+ {`Credential ${index + 1}`} +
+ + + {Object.entries(item).map(([key, value], idx) => ( +
+
+ {key} +
+
+ : +
+
+ {key === 'schemaId' || key === 'credDefId' ? ( +
+
-
+ ) : ( + {value} + )}
- )) - } - +
+ ))}
+ ))} + + ); +} - - ) - } - - export default AttributesListData; \ No newline at end of file +export default AttributesListData; diff --git a/src/components/Verification/EmailAttributesSelection.tsx b/src/components/Verification/EmailAttributesSelection.tsx index 905c70936..fd52e48dd 100644 --- a/src/components/Verification/EmailAttributesSelection.tsx +++ b/src/components/Verification/EmailAttributesSelection.tsx @@ -29,18 +29,19 @@ const EmailAttributesSelection = () => { const handleAttributeChange = async ( attributeName: string, - schemaId: string | undefined, changeType: 'checkbox' | 'input' | 'select', value: string | boolean, + schemaId?: string | undefined, + credDefId?: string | undefined ) => { const updatedAttributes = attributeData?.map(attribute => { - if (attribute.attributeName === attributeName && attribute.schemaId === schemaId) { + if (attribute.attributeName === attributeName && attribute.schemaId === schemaId && attribute.credDefId === credDefId) { switch (changeType) { case 'checkbox': return { ...attribute, isChecked: value as boolean, - value: attribute?.value || '', + value: (value as boolean) ? attribute.value : '', selectedOption: attribute?.condition || 'Select', inputError: '', selectError: '', @@ -255,7 +256,7 @@ const EmailAttributesSelection = () => { showCheckbox={true} isVerificationUsingEmail={true} onChange={(checked: boolean) => { - handleAttributeChange(attribute?.attributeName, attribute?.schemaId, 'checkbox', checked); + handleAttributeChange(attribute?.attributeName, 'checkbox', checked, attribute?.schemaId, attribute?.credDefId); }} />
@@ -270,7 +271,7 @@ const EmailAttributesSelection = () => { disabled={!attribute?.isChecked} value={attribute?.selectedOption} onChange={(e) => - handleAttributeChange(attribute?.attributeName, attribute?.schemaId, 'select', e.target.value) + handleAttributeChange(attribute?.attributeName, 'select', e.target.value, attribute?.schemaId, attribute?.credDefId) } className={`${!attribute?.isChecked ? 'opacity-50 cursor-not-allowed' @@ -302,7 +303,7 @@ const EmailAttributesSelection = () => { type="number" value={attribute?.value} onChange={(e) => - handleAttributeChange(attribute?.attributeName, attribute?.schemaId, 'input', e.target.value) + handleAttributeChange(attribute?.attributeName, 'input', e.target.value, attribute?.schemaId, attribute?.credDefId) } disabled={!attribute?.isChecked} className={`${!attribute?.isChecked diff --git a/src/components/Verification/ProofRequestPopup.tsx b/src/components/Verification/ProofRequestPopup.tsx index 8fbdb3aef..edcc9242b 100644 --- a/src/components/Verification/ProofRequestPopup.tsx +++ b/src/components/Verification/ProofRequestPopup.tsx @@ -94,10 +94,9 @@ const ProofRequest = (props: IProofRrquestDetails) => { ) : (
- - + + +
)} @@ -204,11 +203,9 @@ const ProofRequest = (props: IProofRrquestDetails) => { ) : (
- + + -
)} diff --git a/src/components/Verification/VerificationDashboard.tsx b/src/components/Verification/VerificationDashboard.tsx index 16888675a..8334c8081 100644 --- a/src/components/Verification/VerificationDashboard.tsx +++ b/src/components/Verification/VerificationDashboard.tsx @@ -25,7 +25,7 @@ const VerificationDashboard = () => { ); }; diff --git a/src/components/organization/walletCommonComponents/DedicatedAgent.tsx b/src/components/organization/walletCommonComponents/DedicatedAgent.tsx index 60817dcfe..f1c0b7369 100644 --- a/src/components/organization/walletCommonComponents/DedicatedAgent.tsx +++ b/src/components/organization/walletCommonComponents/DedicatedAgent.tsx @@ -19,6 +19,7 @@ import SetDomainValueInput from './SetDomainValueInput'; import SetPrivateKeyValueInput from './SetPrivateKeyValue'; import { getOrganizationById, setAgentConfigDetails } from '../../../api/organization'; import type { IDedicatedAgentConfig} from '../interfaces'; +import React from 'react'; const RequiredAsterisk = () => * @@ -36,6 +37,7 @@ const DedicatedAgentForm = ({ const [selectedLedger, setSelectedLedger] = useState(''); const [selectedDid, setSelectedDid] = useState(''); const [selectedMethod, setSelectedMethod]=useState('') + const [isSelectedNetwork, setIsSelectedNetwork]=useState('') const [privateKeyValue, setPrivateKeyValue] = useState(''); const [domainValue, setDomainValue] = useState(''); const [isLoading, setIsLoading] = useState(false); @@ -118,6 +120,7 @@ const DedicatedAgentForm = ({ const handleLedgerChanges = (e: ChangeEvent) => { setSelectedLedger(e.target.value); setSelectedMethod(''); + setIsSelectedNetwork(''); setSelectedDid(''); }; const handleMethodChanges = (e: ChangeEvent) => { @@ -248,6 +251,7 @@ const networkRenderOptions = (formikHandlers: { handleChange: (e: React.ChangeEv onChange={(e) => { formikHandlers.handleChange(e); handleNetworkChanges(e); + setIsSelectedNetwork(networks[network]) }} className="mr-2" /> @@ -258,7 +262,19 @@ const networkRenderOptions = (formikHandlers: { handleChange: (e: React.ChangeEv )); }; +const isSubmitButtonDisabled = () => { + if (!selectedLedger) { + return true; + } + else if ((selectedLedger === Ledgers.POLYGON && !privateKeyValue) || (selectedLedger === Ledgers.INDY && (!selectedMethod || !isSelectedNetwork))) { + return true; + } + else if ((selectedLedger === Ledgers.NO_LEDGER && !selectedMethod) ||(selectedLedger === Ledgers.NO_LEDGER && selectedMethod === DidMethod.WEB && !domainValue)) { + return true; + } + return false; +}; return ( <> @@ -565,6 +581,7 @@ const networkRenderOptions = (formikHandlers: { handleChange: (e: React.ChangeEv