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/config/pathRoutes.ts b/src/config/pathRoutes.ts index c8415ff82..00ac9a09e 100644 --- a/src/config/pathRoutes.ts +++ b/src/config/pathRoutes.ts @@ -49,14 +49,14 @@ export const pathRoutes = { }, verification: { requestProof: '/organizations/verification/verify-credentials', - email: '/organizations/verification/verify-credentials/email/schemas', + email: '/organizations/verification/verify-credentials/schema', schema: '/organizations/verification/verify-credentials/schemas', credDef: '/organizations/verification/verify-credentials/schemas/cred-defs', - w3cAttributes: '/organizations/verification/verify-credentials/email/schemas/attributes', - attributes: '/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes', - emailVerification: '/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes/verification-email', - w3cEmailVerification: '/organizations/verification/verify-credentials/email/schemas/attributes/verification-email', - emailCredDef: '/organizations/verification/verify-credentials/email/schemas/cred-defs', + w3cAttributes: '/organizations/verification/verify-credentials/schema/attributes', + attributes: '/organizations/verification/verify-credentials/schema/cred-defs/attributes', + emailVerification: '/organizations/verification/verify-credentials/schema/cred-defs/attributes/verification-email', + w3cEmailVerification: '/organizations/verification/verify-credentials/schema/attributes/verification-email', + emailCredDef: '/organizations/verification/verify-credentials/schema/cred-defs', connections: '/organizations/verification/verify-credentials/schemas/cred-defs/connections', W3CConnections: '/organizations/verification/verify-credentials/schemas/connections', diff --git a/src/pages/organizations/verification/verify-credentials/email/index.astro b/src/pages/organizations/verification/verify-credentials/email/index.astro deleted file mode 100644 index 49f7c7bc9..000000000 --- a/src/pages/organizations/verification/verify-credentials/email/index.astro +++ /dev/null @@ -1,14 +0,0 @@ ---- -import LayoutSidebar from '../../../../../app/LayoutSidebar.astro'; -import { pathRoutes } from '../../../../../config/pathRoutes'; -import { checkUserSession } from '../../../../../utils/check-session'; - -const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname}); -const route: string = pathRoutes.auth.sinIn -if (!response.authorized) { - return Astro.redirect(response.redirect); -} ---- - - - diff --git a/src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes/verification-email/index.astro b/src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes/verification-email/index.astro deleted file mode 100644 index cd4f921c5..000000000 --- a/src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes/verification-email/index.astro +++ /dev/null @@ -1,15 +0,0 @@ ---- -import LayoutSidebar from "../../../../../../../../../app/LayoutSidebar.astro"; -import EmailVerification from "../../../../../../../../../components/Verification/EmailVerification"; -import { checkUserSession } from "../../../../../../../../../utils/check-session"; - - -const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname}); -if (!response.authorized) { - return Astro.redirect(response.redirect); -} ---- - - - - diff --git a/src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes/index.astro b/src/pages/organizations/verification/verify-credentials/schema/attributes/index.astro similarity index 52% rename from src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes/index.astro rename to src/pages/organizations/verification/verify-credentials/schema/attributes/index.astro index 5503c6b90..e4ace7ba9 100644 --- a/src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/attributes/index.astro +++ b/src/pages/organizations/verification/verify-credentials/schema/attributes/index.astro @@ -1,7 +1,7 @@ --- -import LayoutSidebar from "../../../../../../../../app/LayoutSidebar.astro"; -import EmailAttributesSelection from "../../../../../../../../components/Verification/EmailAttributesSelection"; -import { checkUserSession } from "../../../../../../../../utils/check-session"; +import LayoutSidebar from "../../../../../../app/LayoutSidebar.astro"; +import EmailAttributesSelection from "../../../../../../components/Verification/EmailAttributesSelection"; +import { checkUserSession } from "../../../../../../utils/check-session"; const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname}); if (!response.authorized) { diff --git a/src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/index.astro b/src/pages/organizations/verification/verify-credentials/schema/attributes/verification-email/index.astro similarity index 61% rename from src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/index.astro rename to src/pages/organizations/verification/verify-credentials/schema/attributes/verification-email/index.astro index 9d224c9e5..cb6477470 100644 --- a/src/pages/organizations/verification/verify-credentials/email/schemas/cred-defs/index.astro +++ b/src/pages/organizations/verification/verify-credentials/schema/attributes/verification-email/index.astro @@ -1,17 +1,14 @@ --- import LayoutSidebar from "../../../../../../../app/LayoutSidebar.astro"; -import EmailCredDefSelection from "../../../../../../../components/Verification/EmailCredDefSelection"; -import { pathRoutes } from "../../../../../../../config/pathRoutes"; +import EmailVerification from "../../../../../../../components/Verification/EmailVerification"; import { checkUserSession } from "../../../../../../../utils/check-session"; - const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname}); -const route: string = pathRoutes.auth.sinIn if (!response.authorized) { return Astro.redirect(response.redirect); } --- - + diff --git a/src/pages/organizations/verification/verify-credentials/email/schemas/attributes/index.astro b/src/pages/organizations/verification/verify-credentials/schema/cred-defs/attributes/index.astro similarity index 100% rename from src/pages/organizations/verification/verify-credentials/email/schemas/attributes/index.astro rename to src/pages/organizations/verification/verify-credentials/schema/cred-defs/attributes/index.astro diff --git a/src/pages/organizations/verification/verify-credentials/email/schemas/attributes/verification-email/index.astro b/src/pages/organizations/verification/verify-credentials/schema/cred-defs/attributes/verification-email/index.astro similarity index 99% rename from src/pages/organizations/verification/verify-credentials/email/schemas/attributes/verification-email/index.astro rename to src/pages/organizations/verification/verify-credentials/schema/cred-defs/attributes/verification-email/index.astro index aa8a0c183..f8d0da783 100644 --- a/src/pages/organizations/verification/verify-credentials/email/schemas/attributes/verification-email/index.astro +++ b/src/pages/organizations/verification/verify-credentials/schema/cred-defs/attributes/verification-email/index.astro @@ -3,6 +3,7 @@ import LayoutSidebar from "../../../../../../../../app/LayoutSidebar.astro"; import EmailVerification from "../../../../../../../../components/Verification/EmailVerification"; import { checkUserSession } from "../../../../../../../../utils/check-session"; + const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname}); if (!response.authorized) { return Astro.redirect(response.redirect); diff --git a/src/pages/organizations/verification/verify-credentials/email/schemas/index.astro b/src/pages/organizations/verification/verify-credentials/schema/cred-defs/index.astro similarity index 78% rename from src/pages/organizations/verification/verify-credentials/email/schemas/index.astro rename to src/pages/organizations/verification/verify-credentials/schema/cred-defs/index.astro index 4f1d3bb1d..fb14349be 100644 --- a/src/pages/organizations/verification/verify-credentials/email/schemas/index.astro +++ b/src/pages/organizations/verification/verify-credentials/schema/cred-defs/index.astro @@ -1,9 +1,10 @@ --- import LayoutSidebar from "../../../../../../app/LayoutSidebar.astro"; -import EmailSchemaSelection from "../../../../../../components/Verification/EmailSchemaSelection"; +import EmailCredDefSelection from "../../../../../../components/Verification/EmailCredDefSelection"; import { pathRoutes } from "../../../../../../config/pathRoutes"; import { checkUserSession } from "../../../../../../utils/check-session"; + const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname}); const route: string = pathRoutes.auth.sinIn if (!response.authorized) { @@ -12,5 +13,5 @@ if (!response.authorized) { --- - + diff --git a/src/pages/organizations/verification/verify-credentials/schema/index.astro b/src/pages/organizations/verification/verify-credentials/schema/index.astro new file mode 100644 index 000000000..1a56455dc --- /dev/null +++ b/src/pages/organizations/verification/verify-credentials/schema/index.astro @@ -0,0 +1,16 @@ +--- +import LayoutSidebar from "../../../../../app/LayoutSidebar.astro"; +import EmailSchemaSelection from "../../../../../components/Verification/EmailSchemaSelection"; +import { pathRoutes } from "../../../../../config/pathRoutes"; +import { checkUserSession } from "../../../../../utils/check-session"; + +const response = await checkUserSession({cookies: Astro.cookies, currentPath: Astro.url.pathname}); +const route: string = pathRoutes.auth.sinIn +if (!response.authorized) { + return Astro.redirect(response.redirect); +} +--- + + + +