diff --git a/src/api/verification.ts b/src/api/verification.ts index 05c2b4816..4d77fed61 100644 --- a/src/api/verification.ts +++ b/src/api/verification.ts @@ -1,4 +1,4 @@ -import type { IssueCredential, RequestType } from '../common/enums'; +import { APIVersion, type IssueCredential, type RequestType } from '../common/enums'; import { apiRoutes } from '../config/apiRoutes'; import { storageKeys } from '../config/CommonConstant'; import { getHeaderConfigs } from '../config/GetHeaderConfigs'; @@ -23,6 +23,24 @@ export const verifyCredential = async (payload: object, requestType:RequestType) } }; + +export const verifyCredentialV2 = async (payload: object, requestType:RequestType) => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const url = `${APIVersion.version_v2}${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.verifyCredential}?requestType=${requestType}`; + const axiosPayload = { + url, + payload, + config: await getHeaderConfigs(), + }; + + try { + return await axiosPost(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + export const createOobProofRequest = async (payload: object, requestType: RequestType) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.oobProofRequest}?requestType=${requestType}`; diff --git a/src/common/enums.ts b/src/common/enums.ts index adb652b17..fa59a664a 100644 --- a/src/common/enums.ts +++ b/src/common/enums.ts @@ -156,4 +156,8 @@ export enum Environment { PROD = 'PROD', DEV = 'DEV', QA = 'QA' +} + +export enum APIVersion { + version_v2 = '/v2' } \ No newline at end of file diff --git a/src/commonComponents/datatable/interface.ts b/src/commonComponents/datatable/interface.ts index 86ae114bf..7cd5870e6 100644 --- a/src/commonComponents/datatable/interface.ts +++ b/src/commonComponents/datatable/interface.ts @@ -6,7 +6,7 @@ export interface TableHeader { width?: string; } -export interface TableData { +export interface ITableData { clickId?: string | null; data: Data[]; } @@ -20,7 +20,7 @@ export interface Data { export interface IDataTable { header: TableHeader[]; - data: TableData[]; + data: ITableData[]; loading: boolean; onInputChange: (e: ChangeEvent) => void; refresh: () => void; diff --git a/src/components/Issuance/Connections.tsx b/src/components/Issuance/Connections.tsx index 66604f93c..107e4daba 100644 --- a/src/components/Issuance/Connections.tsx +++ b/src/components/Issuance/Connections.tsx @@ -170,4 +170,4 @@ useEffect(() => { ); }; -export default Connections; +export default Connections; \ No newline at end of file diff --git a/src/components/Verification/ConnectionList.tsx b/src/components/Verification/ConnectionList.tsx index e40c1cb22..8fe68811d 100644 --- a/src/components/Verification/ConnectionList.tsx +++ b/src/components/Verification/ConnectionList.tsx @@ -6,13 +6,14 @@ import { getConnectionsByOrg, } from '../../api/connection'; import type { IConnectionListAPIParameter } from '../../api/connection'; -import type { TableData } from '../../commonComponents/datatable/interface'; -import { apiStatusCodes } from '../../config/CommonConstant'; +import type { ITableData } from '../../commonComponents/datatable/interface'; +import { apiStatusCodes, storageKeys } from '../../config/CommonConstant'; import { AlertComponent } from '../AlertComponent'; import { dateConversion } from '../../utils/DateConversion'; import DateTooltip from '../Tooltip'; import type { IConnectionList } from './interface'; import SortDataTable from '../../commonComponents/datatable/SortDataTable'; +import { getFromLocalStorage, removeFromLocalStorage, setToLocalStorage } from '../../api/Auth'; const initialPageState = { itemPerPage: 10, @@ -23,12 +24,21 @@ const initialPageState = { allSearch: '', }; +type LocalOrgs = { + connectionId: string; + theirLabel: string; + createDateTime: string; +}; + const ConnectionList = (props: { - selectConnection: (connections: TableData[]) => void; + selectConnection: (connections: IConnectionList[]) => void; }) => { - const [connectionList, setConnectionList] = useState([]); + const [connectionList, setConnectionList] = useState([]); + const [connectionsTableData, setConnectionsTableData] = useState([]); + const [localOrgs, setLocalOrgs] = useState([]); + const [selectedConnectionList, setSelectedConnectionList] = useState< - TableData[] + ITableData[] >([]); const [loading, setLoading] = useState(false); const [listAPIParameter, setListAPIParameter] = @@ -42,17 +52,17 @@ const ConnectionList = (props: { }); useEffect(() => { - let getData: NodeJS.Timeout; + let getConnectionsData: NodeJS.Timeout; if (listAPIParameter?.search?.length >= 1) { - getData = setTimeout(() => { + getConnectionsData = setTimeout(() => { getConnectionsVerification(listAPIParameter); }, 1000); - return () => clearTimeout(getData); + return () => clearTimeout(getConnectionsData); } else { getConnectionsVerification(listAPIParameter); } - return () => clearTimeout(getData); + return () => clearTimeout(getConnectionsData); }, [listAPIParameter]); const searchInputChange = (e: ChangeEvent) => { @@ -63,6 +73,154 @@ const ConnectionList = (props: { }); }; + const renderCheckbox = ( + ele: IConnectionList, + isChecked: boolean, + connections: IConnectionList[], + ) => { + return ( +
+ ) => { + const inputElement = event.target as HTMLInputElement; + + const updateConnectionList = connections.map((item) => { + if (item.connectionId === ele.connectionId) { + selectOrganization(item, inputElement.checked); + return { + ...item, + checked: inputElement.checked, + }; + } + return item; + }); + setConnectionList(updateConnectionList); + }} + className="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded-lg dark:ring-offset-gray-800 dark:bg-gray-700 dark:border-gray-600 cursor-pointer" + /> +
+ ); + }; + +const extractConnectionFields = (item: IConnectionList) => { + const connectionId = item?.connectionId || 'Not available'; + const theirLabel = item?.theirLabel || 'Not available'; + const createDateTime = item?.createDateTime || 'Not available'; + return { connectionId, theirLabel, createDateTime }; + }; + + const isConnectionChecked = (connectionId: string) => + localOrgs.map((item) => item.connectionId).includes(connectionId); + + + const selectOrganization = async (item: IConnectionList, checked: boolean) => { + try { + const { connectionId, theirLabel, createDateTime } = extractConnectionFields(item); + const index = localOrgs?.findIndex((ele) => ele.connectionId === connectionId) ?? -1; + + if (index === -1) { + setLocalOrgs((prev: LocalOrgs[]) => [ + ...prev, + { connectionId, theirLabel, createDateTime }, + ]); + } else if (!checked) { + const updateLocalOrgs = [...localOrgs]; + updateLocalOrgs.splice(index, 1); + setLocalOrgs(updateLocalOrgs); + } + } catch (error) { + console.error('SELECTED ORGANIZATION:::', error); + } + }; + + + const generateTable = async (connections: IConnectionList[]) => { + try { + const connectionsData = + connections?.length > 0 && + connections.map((ele: IConnectionList) => { + const { connectionId, theirLabel, createDateTime } = extractConnectionFields(ele); + const isChecked = isConnectionChecked(connectionId); + + return { + data: [ + { data: renderCheckbox(ele, isChecked, connections) }, + { data: theirLabel }, + { data: connectionId }, + { + data: ( + + {dateConversion(createDateTime)} + + ), + }, + ], + }; + }); + + setConnectionsTableData(connectionsData); + } catch (err) { + console.error('Error generating table:', err); + } + }; + + useEffect(() => { + props.selectConnection(localOrgs); + }, [localOrgs]); + + + useEffect(() => { + generateTable(connectionList); + }, [connectionList, localOrgs]); + + const updateLocalOrgs = async () => { + const res = await getFromLocalStorage(storageKeys.SELECTED_CONNECTIONS); + const selectedOrg = res ? JSON.parse(res) : []; + setLocalOrgs(selectedOrg); + }; + + useEffect(() => { + const clearStorageAndRefresh = async () => { + refreshPage(); + await removeFromLocalStorage(storageKeys.SELECTED_CONNECTIONS); + await removeFromLocalStorage(storageKeys.SELECTED_USER); + }; + + clearStorageAndRefresh(); + }, []); + + useEffect(() => { + (async () => { + await setToLocalStorage( + storageKeys.SELECTED_CONNECTIONS, + JSON.stringify(localOrgs), + ); + })(); + }, [localOrgs]); + + + useEffect(() => { + let getConnectionsData: NodeJS.Timeout; + updateLocalOrgs(); + if (listAPIParameter?.search?.length >= 1) { + getConnectionsData = setTimeout(() => { + getConnectionsVerification(listAPIParameter); + }, 1000); + return () => clearTimeout(getConnectionsData); + } else { + getConnectionsVerification(listAPIParameter); + } + return () => clearTimeout(getConnectionsData); + }, [listAPIParameter]); + + useEffect(() => { + updateLocalOrgs(); + }, []); + const getConnectionsVerification = async ( apiParameter: IConnectionListAPIParameter, ) => { @@ -79,61 +237,8 @@ const ConnectionList = (props: { nextPage: nextPage, lastPage: lastPage, }); - const connections = data?.data?.data?.map( - (ele: IConnectionList) => { - const userName = ele?.theirLabel - ? ele?.theirLabel - : 'Not available'; - const connectionId = ele?.connectionId - ? ele?.connectionId - : 'Not available'; - const createdOn = ele?.createDateTime - ? ele?.createDateTime - : 'Not available'; - return { - data: [ - { - data: ( -
- , - ) => { - const inputElement = event.target as HTMLInputElement; - selectConnection( - userName, - connectionId, - inputElement.checked, - ); - }} - value="" - className="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded-lg dark:ring-offset-gray-800 dark:bg-gray-700 dark:border-gray-600 cursor-pointer" - /> -
- ), - }, - { data: userName }, - { data: connectionId }, - { - data: ( - - {' '} - {dateConversion(createdOn)}{' '} - - ), - }, - ], - }; - }, - ); - - setConnectionList(connections); + const connectionsDataByOrgId = data?.data?.data + setConnectionList(connectionsDataByOrgId); setError(null); } else { setConnectionList([]); @@ -153,33 +258,6 @@ const ConnectionList = (props: { { columnName: 'Created on' }, ]; - const selectConnection = ( - user: string, - connectionId: string, - checked: boolean, - ) => { - if (checked) { - setSelectedConnectionList([ - { - data: [ - { - data: user, - }, - { - data: connectionId, - }, - ], - }, - ]); - } else { - setSelectedConnectionList((prevList) => - prevList.filter( - (connection) => connection?.data[1]?.data !== connectionId, - ), - ); - } - }; - const searchSortByValue = (value: any) => { setListAPIParameter({ ...listAPIParameter, @@ -199,10 +277,10 @@ const ConnectionList = (props: { props.selectConnection(selectedConnectionList); }, [selectedConnectionList]); + return (
{ @@ -243,6 +321,7 @@ const ConnectionList = (props: { message={'No Connections'} discription={"You don't have any connections yet"} > +
); }; diff --git a/src/components/Verification/Connections.tsx b/src/components/Verification/Connections.tsx index caba0be32..67afe93f7 100644 --- a/src/components/Verification/Connections.tsx +++ b/src/components/Verification/Connections.tsx @@ -1,48 +1,263 @@ -import { Button } from "flowbite-react"; +import { Alert, Button } from "flowbite-react"; import { useEffect, useState } from "react"; -import { getFromLocalStorage, setToLocalStorage } from "../../api/Auth"; +import { getFromLocalStorage, removeFromLocalStorage, setToLocalStorage } from "../../api/Auth"; import DataTable from "../../commonComponents/datatable"; import type { TableData } from "../../commonComponents/datatable/interface"; -import { storageKeys } from "../../config/CommonConstant"; +import { apiStatusCodes, storageKeys } from "../../config/CommonConstant"; import { pathRoutes } from "../../config/pathRoutes"; import BreadCrumbs from "../BreadCrumbs"; import ConnectionList from "./ConnectionList"; import EmailList from "./EmailList"; import BackButton from '../../commonComponents/backbutton' -import { DidMethod } from "../../common/enums"; +import { DidMethod, RequestType } from "../../common/enums"; +import React from "react"; +import type { IConnectionList } from "./interface"; +import DateTooltip from "../Tooltip"; +import { dateConversion } from "../../utils/DateConversion"; +import { verifyCredential, verifyCredentialV2 } from '../../api/verification'; +import type { AxiosResponse } from "axios"; +import { v4 as uuidv4 } from 'uuid'; +import { getOrganizationById } from "../../api/organization"; const Connections = () => { const [isW3cDid, setIsW3cDid] = useState(false); const [selectedConnectionList, setSelectedConnectionList] = useState([]) + const [proofReqSuccess, setProofReqSuccess] = useState(null); + const [errMsg, setErrMsg] = useState(null); + const [requestLoader, setRequestLoader] = useState(false); + + + const selectedConnectionHeader = [ { columnName: 'User' }, { columnName: 'Connection ID' }, + { columnName: 'Created on' } ] - const selectConnection = (connections: TableData[]) => { - setSelectedConnectionList(connections) - } - const fetchOrgData = async () => { - const orgDid = await getFromLocalStorage(storageKeys.ORG_DID); + const selectConnection = (connections: IConnectionList[]) => { - if (orgDid.includes(DidMethod.POLYGON) || orgDid.includes(DidMethod.KEY) || orgDid.includes(DidMethod.WEB)) { - setIsW3cDid(true); - } else { - setIsW3cDid(false); + try { + const connectionsData = connections?.length > 0 && connections?.map((ele: IConnectionList) => { + const createdOn = ele?.createDateTime + ? ele?.createDateTime + : 'Not available'; + const connectionId = ele.connectionId + ? ele.connectionId + : 'Not available'; + const userName = ele?.theirLabel ? ele.theirLabel : 'Not available'; + + return { + data: [ + { data: userName }, + { data: connectionId }, + { + data: ( + + {' '} + {dateConversion(createdOn)}{' '} + + ), + }, + ], + }; + }) + setSelectedConnectionList(connectionsData); + } catch (error) { + console.log("ERROR IN TABLE GENERATION::", error); } - }; - useEffect(() => { - fetchOrgData(); - }, []); - - const continueToVerify = async () => { - const selectedConnections = selectedConnectionList.map(ele =>{ - return {userName: ele.data[0].data, connectionId:ele.data[1].data} - }) - await setToLocalStorage(storageKeys.SELECTED_USER, selectedConnections) - window.location.href = isW3cDid ? `${pathRoutes.organizations.verification.W3CVerification}` : `${pathRoutes.organizations.verification.verify}` + }; + + const fetchOrganizationDetails = async () => { + try{ + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + if (!orgId) return; + const response = await getOrganizationById(orgId); + const { data } = response as AxiosResponse; + if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { + const did = data?.data?.org_agents?.[0]?.orgDid; + + if (did?.includes(DidMethod.POLYGON)) { + setIsW3cDid(true); + + } + if (did?.includes(DidMethod.KEY) || did?.includes(DidMethod.WEB)) { + setIsW3cDid(true); + + + } + if (did?.includes(DidMethod.INDY)) { + setIsW3cDid(false); + + } + } + } catch(error){ + console.error('Error in getSchemaAndUsers:', error); + } + + }; + useEffect(() => { + fetchOrganizationDetails(); + return () => { + setRequestLoader(false); + }; + }, []); + + const handleSubmit = async () => { + setRequestLoader(true); + try { + + const selectedConnections = selectedConnectionList.map((ele) => ({ + userName: ele.data[0].data, + connectionId: ele.data[1].data, + })); + + await setToLocalStorage(storageKeys.SELECTED_USER, selectedConnections); + + const [attributeData, userData, orgId, attributes] = await Promise.all([ + getFromLocalStorage(storageKeys.ATTRIBUTE_DATA), + getFromLocalStorage(storageKeys.SELECTED_USER), + getFromLocalStorage(storageKeys.ORG_ID), + getFromLocalStorage(storageKeys.SCHEMA_ATTRIBUTES), + ]); + + const attr= JSON.parse(attributeData) + + const checkedAttributes = attr + .filter((attribute: any) => attribute.isChecked) + .map((attribute: any) => { + const basePayload = { + attributeName: attribute.attributeName, + credDefId: attribute.credDefId, + schemaId: attribute.schemaId, + }; + + if (attribute.dataType === "number" && attribute.selectedOption !== "Select") { + return { + ...basePayload, + condition: attribute.selectedOption, + value: attribute.value, + }; + } + if (attribute.dataType === "string") { + return basePayload; + } + + return basePayload; + }) + .filter((attr: any) => attr !== null); + + const checkedW3CAttributes = attr + .filter((w3cSchemaAttributes: any) => w3cSchemaAttributes.isChecked) + .map((attribute: any) => { + return { + attributeName: attribute.attributeName, + schemaId: attribute.schemaId, + schemaName:attribute.schemaName + + }; + }); + let verifyCredentialPayload; + + if (!isW3cDid) { + const parsedUserData = JSON.parse(userData); + const connectionIds = parsedUserData.map((connection: { connectionId: string | string[]; }) => connection.connectionId); + + verifyCredentialPayload = { + + connectionId: connectionIds.length === 1 ? connectionIds[0] : connectionIds, + orgId, + proofFormats: { + indy: { + attributes: checkedAttributes, + }, + }, + comment: "string" + }; + } + + + if (isW3cDid) { + const parsedUserData = JSON.parse(userData); + const connectionIds = parsedUserData.map((connection: { connectionId: string | string[] }) => connection.connectionId); + + const schemas = checkedW3CAttributes.map((attr: { schemaId: any; schemaName: any }) => ({ + schemaId: attr.schemaId, + schemaName: attr.schemaName, + })); + + const groupedAttributes = checkedW3CAttributes.reduce((acc: any, curr: any) => { + const schemaName = curr.schemaName; + if (!acc[schemaName]) { + acc[schemaName] = []; + } + acc[schemaName].push(curr); + return acc; + }, {}); + + + verifyCredentialPayload = { + + connectionId: connectionIds.length === 1 ? connectionIds[0] : connectionIds, + comment: 'proof request', + presentationDefinition: { + id: uuidv4(), + input_descriptors: Object.keys(groupedAttributes).map((schemaName) => { + const attributesForSchema = groupedAttributes[schemaName]; + + const attributePathsForSchema = attributesForSchema.map( + (attr: { attributeName: string }) => `$.credentialSubject['${attr.attributeName}']` + ); + + return { + id: uuidv4(), + name: schemaName, + schema: [ + { + uri: schemas.find((schema: { schemaName: string }) => schema.schemaName === schemaName)?.schemaId, + }, + ], + constraints: { + fields: [ + { + path: attributePathsForSchema, + }, + ], + }, + purpose: 'Verify proof', + }; + }), + }, + + } } + + if (attributes && verifyCredentialPayload ) { + const requestType = isW3cDid ? RequestType.PRESENTATION_EXCHANGE : RequestType.INDY; + let response; + if (typeof verifyCredentialPayload.connectionId === 'string') { + response = await verifyCredential(verifyCredentialPayload, requestType); + } else if (Array.isArray(verifyCredentialPayload.connectionId)) { + response = await verifyCredentialV2(verifyCredentialPayload, requestType); + } + + const { data } = response as AxiosResponse; + if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { + await removeFromLocalStorage(storageKeys.ATTRIBUTE_DATA); + setProofReqSuccess(data?.message); + window.location.href = pathRoutes.organizations.credentials; + } else { + setErrMsg(response as string); + setRequestLoader(false); + } + } + } catch (error) { + setErrMsg('An error occurred. Please try again.'); + setRequestLoader(false); + } + + }; + return (
@@ -61,6 +276,19 @@ const Connections = () => {
+ {(proofReqSuccess || errMsg) && ( +
+ { + setProofReqSuccess(null); + setErrMsg(null); + }} + > + {proofReqSuccess || errMsg} + +
+ )}
@@ -72,19 +300,34 @@ const Connections = () => {
- + + + {selectedConnectionList.length ?
: ''} diff --git a/src/components/Verification/EmailAttributesSelection.tsx b/src/components/Verification/EmailAttributesSelection.tsx index 070397062..044d1a8be 100644 --- a/src/components/Verification/EmailAttributesSelection.tsx +++ b/src/components/Verification/EmailAttributesSelection.tsx @@ -15,6 +15,7 @@ import CustomCheckbox from '../../commonComponents/CustomCheckbox'; import { getOrganizationById } from '../../api/organization'; import type { AxiosResponse } from 'axios'; import { DidMethod } from '../../common/enums'; +import React from 'react'; const EmailAttributesSelection = () => { const [attributeList, setAttributeList] = useState([]); @@ -26,6 +27,20 @@ const EmailAttributesSelection = () => { null, ); const [w3cSchema, setW3cSchema] = useState(false); + const [isConnectionProof, setIsConnectionProof] = useState(false); + + const ConnectionVerification = async () => { + const conn = await getFromLocalStorage(storageKeys.VERIFICATION_ROUTE_TYPE) + if(conn === 'Connection'){ + setIsConnectionProof(true) + }else{ + setIsConnectionProof(false) + } + } + useEffect(() => { + ConnectionVerification(); + }, []); + const handleAttributeChange = async ( attributeName: string, @@ -73,6 +88,7 @@ const EmailAttributesSelection = () => { const getOrgDetails = async () => { setLoading(true); + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); const response = await getOrganizationById(orgId); const { data } = response as AxiosResponse; @@ -94,20 +110,25 @@ const EmailAttributesSelection = () => { }, []); - const handleSubmit = () => { - setErrMsg(null); - - if (w3cSchema) { + const handleSubmit = () => { + setErrMsg(null); + + if(isConnectionProof){ + redirectToConnections(); + return; + } + + if (w3cSchema ) { + redirectToAppropriatePage(); + return; + } + + if (hasInvalidNumberAttributes()) { + return; + } + redirectToAppropriatePage(); - return; - } - - if (hasInvalidNumberAttributes()) { - return; - } - - redirectToAppropriatePage(); - }; + }; const hasInvalidNumberAttributes = (): boolean => { const numberAttributes = attributeData?.filter( @@ -143,6 +164,12 @@ const EmailAttributesSelection = () => { ? `${pathRoutes.organizations.verification.w3cEmailVerification}` : `${pathRoutes.organizations.verification.emailVerification}`; }; + + const redirectToConnections = () => { + window.location.href = w3cSchema + ? `${pathRoutes.organizations.verification.W3CConnections}` + : `${pathRoutes.organizations.verification.connections}`; + } const loadAttributesData = async () => { diff --git a/src/components/Verification/EmailSchemaSelection.tsx b/src/components/Verification/EmailSchemaSelection.tsx index 4b78a4404..fb9569a19 100644 --- a/src/components/Verification/EmailSchemaSelection.tsx +++ b/src/components/Verification/EmailSchemaSelection.tsx @@ -1,9 +1,9 @@ +import React from "react"; import VerificationSchemasList from "./VerificationSchemasList"; -const EmailSchemaSelection = () => { - +const EmailSchemaSelection = ({ routeType }: { routeType: string }) => { return ( - + ) } diff --git a/src/components/Verification/VerificationSchemasList.tsx b/src/components/Verification/VerificationSchemasList.tsx index 35a3d25cc..276814e5c 100644 --- a/src/components/Verification/VerificationSchemasList.tsx +++ b/src/components/Verification/VerificationSchemasList.tsx @@ -20,8 +20,8 @@ import { EmptyListMessage } from '../EmptyListComponent'; import SchemaCard from '../../commonComponents/SchemaCard'; import type { IAttributesDetails, ISchema, ISchemaData } from './interface'; -const VerificationSchemasList = () => { - const [schemasList, setSchemasList] = useState([]); +const VerificationSchemasList = ({ routeType }: { routeType: string }) => { +const [schemasList, setSchemasList] = useState([]); const [schemasDetailsErr, setSchemasDetailsErr] = useState(''); const [loading, setLoading] = useState(true); const [allSchemasFlag, setAllSchemasFlag] = useState(false); @@ -89,6 +89,13 @@ const VerificationSchemasList = () => { setLoading(false); } }; + const handleFlag = async () => { + try { + await setToLocalStorage(storageKeys.VERIFICATION_ROUTE_TYPE, routeType); + } catch (error) { + console.error('Error updating localStorage:', error); + } + }; useEffect(() => { getSchemaListDetails(); @@ -236,6 +243,7 @@ const VerificationSchemasList = () => { }; useEffect(() => { + handleFlag(); fetchOrganizationDetails(); (async () => { try { diff --git a/src/components/Verification/interface.ts b/src/components/Verification/interface.ts index 93561594d..174c6852f 100644 --- a/src/components/Verification/interface.ts +++ b/src/components/Verification/interface.ts @@ -50,13 +50,13 @@ export interface IProofRrquestDetails { view: boolean; userRoles?: string[]; } - export interface IConnectionList { theirLabel: string; connectionId: string; createDateTime: string; -} + checked?: boolean; +} export interface SchemaDetail { schemaName: string; version: string; diff --git a/src/config/CommonConstant.ts b/src/config/CommonConstant.ts index e9758fb31..dc861e960 100644 --- a/src/config/CommonConstant.ts +++ b/src/config/CommonConstant.ts @@ -54,6 +54,9 @@ export const storageKeys = { ALL_SCHEMAS:'allSchemaFlag', ECOSYSTEM_ID: "ecosystem_id", ECOSYSTEM_ROLE: "ecosystem_role", + VERIFICATION_ROUTE_TYPE:"routeType" + + } export const emailCredDefHeaders = [ diff --git a/src/pages/organizations/verification/verify-credentials/schema/index.astro b/src/pages/organizations/verification/verify-credentials/schema/index.astro index 9d5161547..da261d122 100644 --- a/src/pages/organizations/verification/verify-credentials/schema/index.astro +++ b/src/pages/organizations/verification/verify-credentials/schema/index.astro @@ -12,5 +12,5 @@ if (!response.authorized) { --- - + \ No newline at end of file diff --git a/src/pages/organizations/verification/verify-credentials/schemas/index.astro b/src/pages/organizations/verification/verify-credentials/schemas/index.astro index efe0df627..9bfde5f4f 100644 --- a/src/pages/organizations/verification/verify-credentials/schemas/index.astro +++ b/src/pages/organizations/verification/verify-credentials/schemas/index.astro @@ -1,6 +1,6 @@ --- import LayoutSidebar from "../../../../../app/LayoutSidebar.astro"; -import SchemaSelection from "../../../../../components/Verification/SchemaSelection"; +import EmailSchemaSelection from "../../../../../components/Verification/EmailSchemaSelection"; import { pathRoutes } from "../../../../../config/pathRoutes"; import { checkUserSession } from "../../../../../utils/check-session"; @@ -13,5 +13,6 @@ if (!response.authorized) { --- - + + \ No newline at end of file