From 102c2b378fd44e7315b70d8781e84099ba47f600 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Thu, 26 Oct 2023 11:22:13 +0530 Subject: [PATCH 1/7] feat: conversion id into uuid Signed-off-by: bhavanakarwade --- src/api/Agent.ts | 2 +- src/api/Schema.ts | 8 ++--- src/api/ecosystem.ts | 6 ++-- src/api/invitations.ts | 8 ++--- src/api/organization.ts | 8 ++--- src/commonComponents/AgentHealth.tsx | 2 +- .../CreateEcosystemOrgModal/index.tsx | 2 +- .../Ecosystem/Endorsement/index.tsx | 2 +- src/components/Ecosystem/interfaces/index.ts | 2 +- .../EcoSystemReceivedInvitations.tsx | 6 ++-- src/components/Issuance/Issuance.tsx | 6 ++-- src/components/Resources/Schema/Create.tsx | 6 ++-- .../Resources/Schema/ViewSchema.tsx | 12 +++---- .../Resources/Schema/interfaces/index.ts | 11 +++--- src/components/Tooltip/index.tsx | 4 --- src/components/User/UserDashBoard.tsx | 4 +-- src/components/User/interfaces/index.ts | 4 +-- src/components/Verification/Verification.tsx | 4 +-- src/components/organization/OrgDropDown.tsx | 2 +- src/components/organization/WalletSpinup.tsx | 4 +-- .../organization/interfaces/index.ts | 34 +++++++++---------- .../organization/interfaces/invitations.ts | 6 ++-- .../organization/interfaces/users.ts | 2 +- .../invitations/ReceivedInvitations.tsx | 4 --- .../invitations/SendInvitationModal.tsx | 6 ++-- .../organization/users/EditUserRolesModal.tsx | 6 ++-- .../OrganisationPublicProfile.tsx | 2 +- src/types/entities.ts | 2 +- 28 files changed, 78 insertions(+), 87 deletions(-) diff --git a/src/api/Agent.ts b/src/api/Agent.ts index 3e23c0d98..f6f5f68e4 100644 --- a/src/api/Agent.ts +++ b/src/api/Agent.ts @@ -3,7 +3,7 @@ import { apiRoutes } from "../config/apiRoutes"; import { getFromLocalStorage } from "./Auth"; import { storageKeys } from "../config/CommonConstant"; -export const getAgentHealth = async (orgId:number) => { +export const getAgentHealth = async (orgId:string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.checkAgentHealth}`, diff --git a/src/api/Schema.ts b/src/api/Schema.ts index a86d4b49a..1372d2f48 100644 --- a/src/api/Schema.ts +++ b/src/api/Schema.ts @@ -49,7 +49,7 @@ export const getAllSchemasByOrgId = async ({ search, itemPerPage, page }: GetAll } } -export const addSchema = async (payload: createSchema, orgId: number) => { +export const addSchema = async (payload: createSchema, orgId: string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.create}`, @@ -72,7 +72,7 @@ export const addSchema = async (payload: createSchema, orgId: number) => { } } -export const getSchemaById = async (schemaId: string, orgId: number) => { +export const getSchemaById = async (schemaId: string, orgId: string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getSchemaById}/${schemaId}`, @@ -94,7 +94,7 @@ export const getSchemaById = async (schemaId: string, orgId: number) => { } } -export const createCredentialDefinition = async (payload: createCredDeffFieldName, orgId:number) => { +export const createCredentialDefinition = async (payload: createCredDeffFieldName, orgId:string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.createCredentialDefinition}`, @@ -118,7 +118,7 @@ export const createCredentialDefinition = async (payload: createCredDeffFieldNam } } -export const getCredDeffById = async (schemaId: string, orgId: number) => { +export const getCredDeffById = async (schemaId: string, orgId: string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getCredDefBySchemaId}/${schemaId}/cred-defs`, diff --git a/src/api/ecosystem.ts b/src/api/ecosystem.ts index bab35e7ca..3b823121b 100644 --- a/src/api/ecosystem.ts +++ b/src/api/ecosystem.ts @@ -10,7 +10,7 @@ interface CreateEcosystemPayload { description: string; logo: string; tags?: string; - userId: number; + userId: string; } export interface GetEndorsementListParameter { @@ -105,7 +105,7 @@ export const getEndorsementList = async ( export const createSchemaRequest = async ( data: object, endorsementId: string, - orgId: number, + orgId: string, ) => { const url = `${apiRoutes.Ecosystem.root}/${endorsementId}/${orgId}${apiRoutes.Ecosystem.endorsements.createSchemaRequest}`; const payload = data; @@ -126,7 +126,7 @@ export const createSchemaRequest = async ( export const createCredDefRequest = async ( data: object, ecosystemId: string, - orgId: number, + orgId: string, ) => { const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.endorsements.createCredDefRequest}`; const payload = data; diff --git a/src/api/invitations.ts b/src/api/invitations.ts index 47bfbd2d5..76d6534cb 100644 --- a/src/api/invitations.ts +++ b/src/api/invitations.ts @@ -43,7 +43,7 @@ export const createInvitations = async (invitationList: Array) => { const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.organizations.invitations}` const payload = { invitations: invitationList, - orgId: Number(orgId) + orgId: orgId } const token = await getFromLocalStorage(storageKeys.TOKEN) @@ -233,7 +233,7 @@ export const getEcosystemInvitations = async (pageNumber: number, pageSize: numb } // Accept/ Reject Invitations -export const acceptRejectEcosystemInvitations = async (invitationId: string, orgId: number, status: string, orgName: string, orgDid: string) => { +export const acceptRejectEcosystemInvitations = async (invitationId: string, orgId: string, status: string, orgName: string, orgDid: string) => { const url = `${apiRoutes.Ecosystem.root}/${orgId}${apiRoutes.Ecosystem.invitations}/${invitationId}` @@ -265,12 +265,12 @@ export const acceptRejectEcosystemInvitations = async (invitationId: string, org } } -export const acceptRejectInvitations = async (invitationId: number, orgId: number, status: string) => { +export const acceptRejectInvitations = async (invitationId: string, orgId: string, status: string) => { const url = `${apiRoutes.users.invitations}/${invitationId}` const payload = { - orgId: Number(orgId), + orgId: orgId, status } const token = await getFromLocalStorage(storageKeys.TOKEN) diff --git a/src/api/organization.ts b/src/api/organization.ts index 236e7450e..818be26e5 100644 --- a/src/api/organization.ts +++ b/src/api/organization.ts @@ -138,7 +138,7 @@ export const getOrgDashboard = async (orgId: string) => { } } -export const spinupDedicatedAgent = async (data: object, orgId:number) => { +export const spinupDedicatedAgent = async (data: object, orgId:string) => { const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.agentDedicatedSpinup}` const payload = data @@ -166,7 +166,7 @@ export const spinupDedicatedAgent = async (data: object, orgId:number) => { } } -export const spinupSharedAgent = async (data: object, orgId:number) => { +export const spinupSharedAgent = async (data: object, orgId:string) => { const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.agentSharedSpinup}` const payload = data @@ -247,7 +247,7 @@ export const getOrganizationUsers = async (pageNumber: number, pageSize: number, } // Edit user roles -export const editOrganizationUserRole = async (userId: number, roles: number[]) => { +export const editOrganizationUserRole = async (userId: string, roles: string[]) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID) @@ -284,7 +284,7 @@ export const createConnection = async (orgName: string) => { label: orgName, multiUseInvitation: true, autoAcceptConnection: true, - orgId: Number(orgId) + orgId: orgId } const payload = data diff --git a/src/commonComponents/AgentHealth.tsx b/src/commonComponents/AgentHealth.tsx index d6372657f..8ada6fd8d 100644 --- a/src/commonComponents/AgentHealth.tsx +++ b/src/commonComponents/AgentHealth.tsx @@ -29,7 +29,7 @@ const AgentHealth = () => { const organizationId = await getFromLocalStorage(storageKeys.ORG_ID); setCheckOrgExist(Number(organizationId)) if (Number(organizationId) !== 0) { - const agentData = await getAgentHealth(Number(organizationId)); + const agentData = await getAgentHealth(organizationId); const { data } = agentData as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { setAgentHealthDetails(data?.data); diff --git a/src/components/CreateEcosystemOrgModal/index.tsx b/src/components/CreateEcosystemOrgModal/index.tsx index 5ebda9078..264b49303 100644 --- a/src/components/CreateEcosystemOrgModal/index.tsx +++ b/src/components/CreateEcosystemOrgModal/index.tsx @@ -169,7 +169,7 @@ const CreateEcosystemOrgModal = (props: IProps) => { description: values.description, logo: logoImage?.imagePreviewUrl as string || "", tags: "", - userId: Number(user_data?.id), + userId: user_data?.id, orgName: orgDetails?.orgName, orgDid: orgDetails?.orgDid } diff --git a/src/components/Ecosystem/Endorsement/index.tsx b/src/components/Ecosystem/Endorsement/index.tsx index 0ad712257..91f58327d 100644 --- a/src/components/Ecosystem/Endorsement/index.tsx +++ b/src/components/Ecosystem/Endorsement/index.tsx @@ -41,7 +41,7 @@ interface IEndorsementList { status: string; type: string; ecosystemOrgs: { - orgId: number; + orgId: string; }; requestPayload: string; responsePayload: string; diff --git a/src/components/Ecosystem/interfaces/index.ts b/src/components/Ecosystem/interfaces/index.ts index bd8f6c334..46dbce67b 100644 --- a/src/components/Ecosystem/interfaces/index.ts +++ b/src/components/Ecosystem/interfaces/index.ts @@ -7,7 +7,7 @@ export interface IEcosystem { } export interface Ecosystem { - id: number + id: string createDateTime: string createdBy: number lastChangedDateTime: string diff --git a/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx b/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx index 85bb62408..e45d23d4c 100644 --- a/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx +++ b/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx @@ -53,7 +53,7 @@ const ReceivedInvitations = () => { const [error, setError] = useState(null); const [organizationsList, setOrganizationsList] = useState | null>(null); const [currentPage, setCurrentPage] = useState(initialPageState); - const [selectedId, setSelectedId] = useState(); + const [selectedId, setSelectedId] = useState(''); const [searchText, setSearchText] = useState(''); const [invitationsData, setInvitationsData] = useState | null>(null); const [getOrgError, setGetOrgError] = useState(null); @@ -147,7 +147,7 @@ const ReceivedInvitations = () => { if (orgDid) { const response = await acceptRejectEcosystemInvitations( invite.id, - Number(selectedId), + selectedId, status, orgName, orgDid @@ -215,7 +215,7 @@ const ReceivedInvitations = () => { const getOrgId = async () => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); if (orgId) { - setSelectedId(Number(orgId)); + setSelectedId(orgId); } }; diff --git a/src/components/Issuance/Issuance.tsx b/src/components/Issuance/Issuance.tsx index ae7f6491f..c3cdc1677 100644 --- a/src/components/Issuance/Issuance.tsx +++ b/src/components/Issuance/Issuance.tsx @@ -36,7 +36,7 @@ interface IssuanceFormPayload { connectionId: string; attributes: Attributes[]; credentialDefinitionId: string; - orgId: number; + orgId: string; } interface DataTypeAttributes { @@ -81,7 +81,7 @@ const IssueCred = () => { const selectedUsers = await getSelectedUsers(); const attributes = await getSchemaDetails(); if (attributes && attributes.length) { - createIssuanceForm(selectedUsers, attributes, credDefId, Number(orgId)); + createIssuanceForm(selectedUsers, attributes, credDefId, orgId); } else { setFailure('Attributes are not available'); } @@ -91,7 +91,7 @@ const IssueCred = () => { selectedUsers: SelectedUsers[], attributes: DataTypeAttributes[], credDefId: string, - orgId: number, + orgId: string, ) => { const attrObj = attributes.map((attr) => ({ name: attr?.attributeName, diff --git a/src/components/Resources/Schema/Create.tsx b/src/components/Resources/Schema/Create.tsx index 23d6830cc..8462ec646 100644 --- a/src/components/Resources/Schema/Create.tsx +++ b/src/components/Resources/Schema/Create.tsx @@ -37,7 +37,7 @@ interface IFormData { const CreateSchema = () => { const [failure, setFailure] = useState(null); - const [orgId, setOrgId] = useState(0); + const [orgId, setOrgId] = useState(''); const [createloader, setCreateLoader] = useState(false); const [showPopup, setShowPopup] = useState(false) const [isEcosystemData, setIsEcosystemData] = useState(); @@ -58,7 +58,7 @@ const CreateSchema = () => { const fetchData = async () => { const organizationId = await getFromLocalStorage( storageKeys.ORG_ID); - setOrgId(Number(organizationId)); + setOrgId(organizationId); }; fetchData(); @@ -81,7 +81,7 @@ const CreateSchema = () => { orgId: orgId, }; - const createSchema = await addSchema(schemaFieldName, orgId); + const createSchema = await addSchema(schemaFieldName, String(orgId)); const { data } = createSchema as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { diff --git a/src/components/Resources/Schema/ViewSchema.tsx b/src/components/Resources/Schema/ViewSchema.tsx index 831ed31f5..d6fb0f782 100644 --- a/src/components/Resources/Schema/ViewSchema.tsx +++ b/src/components/Resources/Schema/ViewSchema.tsx @@ -58,7 +58,7 @@ const ViewSchemas = () => { const [credDefListErr, setCredDefListErr] = useState(null) const [schemaDetailErr, setSchemaDetailErr] = useState(null) const [failure, setFailure] = useState(null) - const [orgId, setOrgId] = useState(0) + const [orgId, setOrgId] = useState('') const [credDefAuto, setCredDefAuto] = useState('') const [isEcosystemData, setIsEcosystemData] = useState(); @@ -66,7 +66,7 @@ const ViewSchemas = () => { const [userRoles, setUserRoles] = useState([]) - const getSchemaDetails = async (SchemaId: string, organizationId: number) => { + const getSchemaDetails = async (SchemaId: string, organizationId: string) => { try { setLoading(true); const SchemaDetails = await getSchemaById(SchemaId, organizationId); @@ -87,7 +87,7 @@ const ViewSchemas = () => { } }; - const getCredentialDefinitionList = async (id: string, orgId: number) => { + const getCredentialDefinitionList = async (id: string, orgId: string) => { try { setCredDeffloader(true); const credentialDefinitions = await getCredDeffById(id, orgId); @@ -112,12 +112,12 @@ const ViewSchemas = () => { useEffect(() => { const fetchData = async () => { const organizationId = await getFromLocalStorage(storageKeys.ORG_ID); - setOrgId(Number(organizationId)); + setOrgId(String(organizationId)); if (window?.location?.search) { const str = window?.location?.search; const schemaId = str.substring(str.indexOf('=') + 1); - await getSchemaDetails(schemaId, Number(organizationId)); - await getCredentialDefinitionList(schemaId, Number(organizationId)); + await getSchemaDetails(schemaId, String(organizationId)); + await getCredentialDefinitionList(schemaId, String(organizationId)); } }; diff --git a/src/components/Resources/Schema/interfaces/index.ts b/src/components/Resources/Schema/interfaces/index.ts index d4dd1d444..26bc66268 100644 --- a/src/components/Resources/Schema/interfaces/index.ts +++ b/src/components/Resources/Schema/interfaces/index.ts @@ -1,4 +1,3 @@ -import { Pagination } from 'flowbite-react'; export interface GetAllSchemaListParameter { itemPerPage: number, page: number, @@ -27,7 +26,7 @@ type DataItem = { schemaLedgerId: string; createdBy: number; publisherDid: string; - orgId: number; + orgId: string; issuerId: string; }; @@ -53,7 +52,7 @@ export type PaginationData = { export interface CredDeffFieldNameType { tag: string; revocable: boolean; - orgId: number; + orgId: string; schemaLedgerId: string; } @@ -61,7 +60,7 @@ export interface FieldName { schemaName: string; schemaVersion: string; attributes: IAttributes[] - orgId: number; + orgId: string; } @@ -69,13 +68,13 @@ export interface createSchema { schemaName: string; schemaVersion: string; attributes: IAttributes[] - orgId: number; + orgId: string; } export interface createCredDeffFieldName { tag: string; revocable: boolean; - orgId: number; + orgId: string; schemaLedgerId: string; } diff --git a/src/components/Tooltip/index.tsx b/src/components/Tooltip/index.tsx index 912a20ba3..40e30c9ec 100644 --- a/src/components/Tooltip/index.tsx +++ b/src/components/Tooltip/index.tsx @@ -1,7 +1,5 @@ import { Tooltip } from 'flowbite-react'; import moment from 'moment'; -import { dateConversion } from '../../utils/DateConversion'; -import type { ChildrenType } from 'react-tooltip'; interface DateProps { date: string @@ -11,11 +9,9 @@ interface DateProps { const DateTooltip = ({date, children}: DateProps) => { - const updatedDate = new Date(date); const formattedDate = date ? moment(updatedDate).format("MMM DD, YYYY, h:mm A z") : ''; - return ( { checkOrgId(); }, []); - const goToOrgDashboard = async (orgId: number, roles: string[]) => { - await setToLocalStorage(storageKeys.ORG_ID, orgId.toString()); + const goToOrgDashboard = async (orgId: string, roles: string[]) => { + await setToLocalStorage(storageKeys.ORG_ID, orgId); window.location.href = pathRoutes.organizations.dashboard; }; diff --git a/src/components/User/interfaces/index.ts b/src/components/User/interfaces/index.ts index f74b10de4..5ea002f5a 100644 --- a/src/components/User/interfaces/index.ts +++ b/src/components/User/interfaces/index.ts @@ -1,7 +1,7 @@ export interface UserActivity { id: number - userId: number - orgId: number + userId: string + orgId: string action: string details: string createDateTime: string diff --git a/src/components/Verification/Verification.tsx b/src/components/Verification/Verification.tsx index 8d0365a04..3ad2d3d62 100644 --- a/src/components/Verification/Verification.tsx +++ b/src/components/Verification/Verification.tsx @@ -32,7 +32,7 @@ interface VerifyCredentialPayload { credDefId?: string ; }>; comment: string; - orgId: number; + orgId: string; } const VerificationCred = () => { @@ -161,7 +161,7 @@ const VerificationCred = () => { connectionId: `${selectedUsers[0].connectionId}`, attributes: attributes, comment: "string", - orgId: Number(orgId) + orgId: orgId }; if (attributes) { const response = await verifyCredential(verifyCredentialPayload); diff --git a/src/components/organization/OrgDropDown.tsx b/src/components/organization/OrgDropDown.tsx index 4169a7abb..52aa56710 100644 --- a/src/components/organization/OrgDropDown.tsx +++ b/src/components/organization/OrgDropDown.tsx @@ -49,7 +49,7 @@ const OrgDropDown = () => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID) if (orgId) { - activeOrg = organizations?.find(org => org.id === Number(orgId)) as Organisation + activeOrg = organizations?.find(org => org.id === String(orgId)) as Organisation setactiveOrg(activeOrg || null) } else { activeOrg = organizations && organizations[0] diff --git a/src/components/organization/WalletSpinup.tsx b/src/components/organization/WalletSpinup.tsx index 8028e0f2e..c759ccb33 100644 --- a/src/components/organization/WalletSpinup.tsx +++ b/src/components/organization/WalletSpinup.tsx @@ -95,7 +95,7 @@ const WalletSpinup = (props: { }; setLoading(true); const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const spinupRes = await spinupDedicatedAgent(payload, parseInt(orgId)); + const spinupRes = await spinupDedicatedAgent(payload, orgId); const { data } = spinupRes as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { @@ -120,7 +120,7 @@ const WalletSpinup = (props: { }; const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const spinupRes = await spinupSharedAgent(payload, parseInt(orgId)); + const spinupRes = await spinupSharedAgent(payload, orgId); const { data } = spinupRes as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { diff --git a/src/components/organization/interfaces/index.ts b/src/components/organization/interfaces/index.ts index 45a533425..7ec60da48 100644 --- a/src/components/organization/interfaces/index.ts +++ b/src/components/organization/interfaces/index.ts @@ -1,14 +1,14 @@ export interface UserOrgRole { - id: number - userId: number - orgRoleId: number - orgId: number + id: string + userId: string + orgRoleId: string + orgId: string orgRole: OrgRole } export interface Organisation { logoFile: string - id: number + id: string createDateTime: string createdBy: number lastChangedDateTime: string @@ -25,7 +25,7 @@ export interface Organisation { } export interface OrgRole { - id: number + id: string name: string description: string createDateTime?: string @@ -36,7 +36,7 @@ export interface OrgRole { } export interface OrgAgent { - id: number + id: string createDateTime: string createdBy: number lastChangedDateTime: string @@ -50,16 +50,16 @@ export interface OrgAgent { agentOptions: any walletName: string tenantId: any - agentsTypeId: number - orgId: number - orgAgentTypeId: number + agentsTypeId: string + orgId: string + orgAgentTypeId: string ledgers: ledgers org_agent_type: org_agent_type agents_type: AgentsType } export interface AgentsType { - id: number + id: string createDateTime: string createdBy: number lastChangedDateTime: string @@ -68,7 +68,7 @@ export interface AgentsType { } export interface org_agent_type{ -id: number +id: string createDateTime: string createdBy: number lastChangedDateTime: string @@ -80,7 +80,7 @@ agent: string export interface ledgers{ createDateTime: string createdBy: number -id: number +id: string isActive: boolean lastChangedBy: number lastChangedDateTime: string @@ -98,9 +98,9 @@ export interface OrgDashboard { } export interface Connection { - id: number - orgId: number - agentId: number + id: string + orgId: string + agentId: string connectionInvitation: string multiUse: boolean createDateTime: string @@ -143,7 +143,7 @@ export interface UserDetails { firstName: string; email: string; publicProfile: boolean; - id: number; + id: string; username: string; } diff --git a/src/components/organization/interfaces/invitations.ts b/src/components/organization/interfaces/invitations.ts index 45da32baf..294e65e73 100644 --- a/src/components/organization/interfaces/invitations.ts +++ b/src/components/organization/interfaces/invitations.ts @@ -2,14 +2,14 @@ import type { OrgRole, Organisation } from "." export interface Invitation { ecosystem: any - id: number + id: string createDateTime: string createdBy: number lastChangedDateTime: string lastChangedBy: number deletedAt: any - userId: number - orgId: number + userId: string + orgId: string status: string orgRoles: OrgRole[] email: string diff --git a/src/components/organization/interfaces/users.ts b/src/components/organization/interfaces/users.ts index 2bf7e4cb2..6e4994656 100644 --- a/src/components/organization/interfaces/users.ts +++ b/src/components/organization/interfaces/users.ts @@ -1,7 +1,7 @@ import type { UserOrgRole } from "." export interface User { - id: number + id: string username: string email: string firstName: string diff --git a/src/components/organization/invitations/ReceivedInvitations.tsx b/src/components/organization/invitations/ReceivedInvitations.tsx index 65ae411ec..958b72a74 100644 --- a/src/components/organization/invitations/ReceivedInvitations.tsx +++ b/src/components/organization/invitations/ReceivedInvitations.tsx @@ -9,9 +9,7 @@ import type { Invitation } from '../interfaces/invitations'; import type { OrgRole } from '../interfaces' import SearchInput from '../../SearchInput'; import SendInvitationModal from './SendInvitationModal'; -import { TextTittlecase } from '../../../utils/TextTransform'; import { apiStatusCodes } from '../../../config/CommonConstant'; -import { getOrganizations } from '../../../api/organization'; import { pathRoutes } from '../../../config/pathRoutes'; import { EmptyListMessage } from '../../EmptyListComponent'; import CustomSpinner from '../../CustomSpinner'; @@ -30,7 +28,6 @@ const ReceivedInvitations = () => { const [error, setError] = useState(null) const [currentPage, setCurrentPage] = useState(initialPageState); - const timestamp = Date.now(); const onPageChange = (page: number) => { setCurrentPage({ @@ -104,7 +101,6 @@ const ReceivedInvitations = () => { } } - return (
diff --git a/src/components/organization/invitations/SendInvitationModal.tsx b/src/components/organization/invitations/SendInvitationModal.tsx index aa1bd45f3..ef91182cd 100644 --- a/src/components/organization/invitations/SendInvitationModal.tsx +++ b/src/components/organization/invitations/SendInvitationModal.tsx @@ -21,11 +21,11 @@ interface Values { interface Invitations { email: string; role: string; - roleId: number; + roleId: string; } interface RoleI { - id: number; + id: string; name: string; } @@ -87,7 +87,7 @@ const SendInvitationModal = (props: { { email: values.email, role: memberRole?.name as string, - roleId: memberRole?.id as number, + roleId: String(memberRole?.id), }, ]); }; diff --git a/src/components/organization/users/EditUserRolesModal.tsx b/src/components/organization/users/EditUserRolesModal.tsx index af813a2ff..544ab0c43 100644 --- a/src/components/organization/users/EditUserRolesModal.tsx +++ b/src/components/organization/users/EditUserRolesModal.tsx @@ -8,7 +8,7 @@ import type { User } from "../interfaces/users"; import { apiStatusCodes } from "../../../config/CommonConstant"; interface RoleI { - id: number + id: string name: string, checked: boolean disabled: boolean @@ -64,7 +64,7 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage: const roleIds = roles?.filter(role => role.checked).map(role => role.id) - const response = await editOrganizationUserRole(props.user.id, roleIds as number[]) + const response = await editOrganizationUserRole(props.user.id, roleIds as string[]) const { data } = response as AxiosResponse @@ -79,7 +79,7 @@ const EditUserRoleModal = (props: { openModal: boolean; user: User; setMessage: } - const onRoleChanged = (event: any, id: number) => { + const onRoleChanged = (event: any, id: string) => { if ( (event?.target?.name === 'issuer' && event?.target?.checked === true) || (event?.target?.name === 'verifier' && event?.target?.checked === true) diff --git a/src/components/publicProfile/OrganisationPublicProfile.tsx b/src/components/publicProfile/OrganisationPublicProfile.tsx index 533deda82..dcc3d1ac0 100644 --- a/src/components/publicProfile/OrganisationPublicProfile.tsx +++ b/src/components/publicProfile/OrganisationPublicProfile.tsx @@ -102,7 +102,7 @@ const OrganisationPublicProfile = () => { logoUrl: string; name: string; description: string; - id: number; + id: string; orgSlug: string; }) => ( Date: Fri, 27 Oct 2023 16:28:37 +0530 Subject: [PATCH 2/7] feat: conversion of id's into uuid Signed-off-by: bhavanakarwade --- src/api/invitations.ts | 2 +- src/components/Ecosystem/interfaces/index.ts | 4 +-- .../EcoSystemReceivedInvitations.tsx | 4 +-- .../EcosystemInvite/SentInvitations.tsx | 2 +- src/components/Profile/interfaces/index.ts | 2 +- .../Resources/Schema/interfaces/index.ts | 2 +- src/components/User/interfaces/index.ts | 4 +-- .../organization/interfaces/index.ts | 29 +++++++++---------- .../organization/interfaces/invitations.ts | 4 +-- 9 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/api/invitations.ts b/src/api/invitations.ts index 76d6534cb..c687945e0 100644 --- a/src/api/invitations.ts +++ b/src/api/invitations.ts @@ -296,7 +296,7 @@ export const acceptRejectInvitations = async (invitationId: string, orgId: strin } } -export const deleteEcosystemInvitations = async (invitationId: number) => { +export const deleteEcosystemInvitations = async (invitationId: string) => { const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID); const orgId = await getFromLocalStorage(storageKeys.ORG_ID) diff --git a/src/components/Ecosystem/interfaces/index.ts b/src/components/Ecosystem/interfaces/index.ts index 46dbce67b..621027521 100644 --- a/src/components/Ecosystem/interfaces/index.ts +++ b/src/components/Ecosystem/interfaces/index.ts @@ -9,9 +9,9 @@ export interface IEcosystem { export interface Ecosystem { id: string createDateTime: string - createdBy: number + createdBy: string lastChangedDateTime: string - lastChangedBy: number + lastChangedBy: string name: string description: string logoUrl: string diff --git a/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx b/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx index e45d23d4c..52e32e317 100644 --- a/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx +++ b/src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx @@ -33,9 +33,9 @@ export interface EcosystemInvitation { ecosystem: [] id: string createDateTime: string - createdBy: number + createdBy: string lastChangedDateTime: string - lastChangedBy: number + lastChangedBy: string deletedAt: any userId: string orgId: string diff --git a/src/components/EcosystemInvite/SentInvitations.tsx b/src/components/EcosystemInvite/SentInvitations.tsx index 8f77d434b..c17bb0875 100644 --- a/src/components/EcosystemInvite/SentInvitations.tsx +++ b/src/components/EcosystemInvite/SentInvitations.tsx @@ -66,7 +66,7 @@ const SentInvitations = () => { setLoading(false); }; - const deletInvitations = async (invitationId: number) => { + const deletInvitations = async (invitationId: string) => { const response = await deleteEcosystemInvitations(invitationId); const { data } = response as AxiosResponse; diff --git a/src/components/Profile/interfaces/index.ts b/src/components/Profile/interfaces/index.ts index 6ed2fa620..249fda505 100644 --- a/src/components/Profile/interfaces/index.ts +++ b/src/components/Profile/interfaces/index.ts @@ -39,7 +39,7 @@ export interface UserEmail { } export interface UserProfile { - id: number + id: string profileImg?: string username?: string email: string diff --git a/src/components/Resources/Schema/interfaces/index.ts b/src/components/Resources/Schema/interfaces/index.ts index 26bc66268..f65ed2149 100644 --- a/src/components/Resources/Schema/interfaces/index.ts +++ b/src/components/Resources/Schema/interfaces/index.ts @@ -24,7 +24,7 @@ type DataItem = { version: string; attributes: string[]; schemaLedgerId: string; - createdBy: number; + createdBy: string; publisherDid: string; orgId: string; issuerId: string; diff --git a/src/components/User/interfaces/index.ts b/src/components/User/interfaces/index.ts index 5ea002f5a..66f6784ec 100644 --- a/src/components/User/interfaces/index.ts +++ b/src/components/User/interfaces/index.ts @@ -5,8 +5,8 @@ export interface UserActivity { action: string details: string createDateTime: string - createdBy: number + createdBy: string lastChangedDateTime: string - lastChangedBy: number + lastChangedBy: string deletedAt: any } diff --git a/src/components/organization/interfaces/index.ts b/src/components/organization/interfaces/index.ts index 7ec60da48..38fe0a864 100644 --- a/src/components/organization/interfaces/index.ts +++ b/src/components/organization/interfaces/index.ts @@ -10,9 +10,9 @@ export interface Organisation { logoFile: string id: string createDateTime: string - createdBy: number + createdBy: string lastChangedDateTime: string - lastChangedBy: number + lastChangedBy: string name: string description: string logoUrl: string @@ -29,18 +29,18 @@ export interface OrgRole { name: string description: string createDateTime?: string - createdBy?: number + createdBy?: string lastChangedDateTime?: string - lastChangedBy?: number + lastChangedBy?: string deletedAt?: any } export interface OrgAgent { id: string createDateTime: string - createdBy: number + createdBy: string lastChangedDateTime: string - lastChangedBy: number + lastChangedBy: string orgDid: string verkey: string agentEndPoint: string @@ -61,28 +61,28 @@ export interface OrgAgent { export interface AgentsType { id: string createDateTime: string - createdBy: number + createdBy: string lastChangedDateTime: string - lastChangedBy: number + lastChangedBy: string agent: string } export interface org_agent_type{ id: string createDateTime: string -createdBy: number +createdBy: string lastChangedDateTime: string -lastChangedBy: number +lastChangedBy: string agent: string } export interface ledgers{ createDateTime: string -createdBy: number +createdBy: string id: string isActive: boolean -lastChangedBy: number +lastChangedBy: string lastChangedDateTime: string name: string networkString: string @@ -104,9 +104,9 @@ export interface Connection { connectionInvitation: string multiUse: boolean createDateTime: string - createdBy: number + createdBy: string lastChangedDateTime: string - lastChangedBy: number + lastChangedBy: string } export interface EcosystemDashboard { @@ -114,7 +114,6 @@ export interface Connection { endorsementsCount: number } - export interface OrgInterface { name: string; website: string; diff --git a/src/components/organization/interfaces/invitations.ts b/src/components/organization/interfaces/invitations.ts index 294e65e73..0d7500b29 100644 --- a/src/components/organization/interfaces/invitations.ts +++ b/src/components/organization/interfaces/invitations.ts @@ -4,9 +4,9 @@ export interface Invitation { ecosystem: any id: string createDateTime: string - createdBy: number + createdBy: string lastChangedDateTime: string - lastChangedBy: number + lastChangedBy: string deletedAt: any userId: string orgId: string From cd97faa60af16b4dc8a6ef140ce962d039556831 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Mon, 6 Nov 2023 20:38:16 +0530 Subject: [PATCH 3/7] resolved conflicts Signed-off-by: bhavanakarwade --- src/components/Resources/Schema/Create.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Resources/Schema/Create.tsx b/src/components/Resources/Schema/Create.tsx index b28c9fa39..37d191a66 100644 --- a/src/components/Resources/Schema/Create.tsx +++ b/src/components/Resources/Schema/Create.tsx @@ -16,6 +16,7 @@ import { ICheckEcosystem, checkEcosystem, getEcosystemId } from '../../../config import { createSchemaRequest } from '../../../api/ecosystem'; import ConfirmModal from '../../../commonComponents/ConfirmPopup'; import EcosystemProfileCard from '../../../commonComponents/EcosystemProfileCard' +import React from 'react'; const options = [ { value: 'string', label: 'String' }, From ef03e697ac5aa25fe506823e9a4e7af93882b987 Mon Sep 17 00:00:00 2001 From: Moulika Kulkarni Date: Wed, 22 Nov 2023 20:59:58 +0530 Subject: [PATCH 4/7] fix:id-to-uuid-conversion Signed-off-by: Moulika Kulkarni --- src/components/Resources/Schema/Create.tsx | 4 ++-- src/components/organization/WalletSpinup.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Resources/Schema/Create.tsx b/src/components/Resources/Schema/Create.tsx index 8d7ace738..3a7adeaa0 100644 --- a/src/components/Resources/Schema/Create.tsx +++ b/src/components/Resources/Schema/Create.tsx @@ -41,7 +41,7 @@ interface IFormData { const CreateSchema = () => { const [failure, setFailure] = useState(null); const [orgId, setOrgId] = useState(''); - const [createloader, setCreateLoader] = useState(false); + const [createLoader, setCreateLoader] = useState(false); const [showPopup, setShowPopup] = useState(false) const [isEcosystemData, setIsEcosystemData] = useState(); @@ -84,7 +84,7 @@ const CreateSchema = () => { orgId, }; - const createSchema = await addSchema(schemaFieldName, String(orgId)); + const createSchema = await addSchema(schemaFieldName, orgId); const { data } = createSchema as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { diff --git a/src/components/organization/WalletSpinup.tsx b/src/components/organization/WalletSpinup.tsx index cf9c50dc3..32b73bd1b 100644 --- a/src/components/organization/WalletSpinup.tsx +++ b/src/components/organization/WalletSpinup.tsx @@ -67,7 +67,7 @@ const fetchNetworks = async () => { try { const { data } = await getLedgers() as AxiosResponse if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { - return data?.data + return data?.data } return [] } catch (err) { @@ -479,7 +479,7 @@ const WalletSpinup = (props: { walletPassword: passwordEncryption(values.password), did: values.did, ledgerId: [ - Number(values.network) + (values.network.toString()) ], clientSocketId: SOCKET.id } @@ -507,14 +507,14 @@ const WalletSpinup = (props: { label: values.label, seed: values.seed || seeds, ledgerId: [ - Number(values.network) + (values.network.toString()) ], did: values.did, clientSocketId: SOCKET.id, }; const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const spinupRes = await spinupSharedAgent(payload, parseInt(orgId)); + const spinupRes = await spinupSharedAgent(payload, orgId); const { data } = spinupRes as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { From 067855c3fdb443a995a46d413a80240518157de4 Mon Sep 17 00:00:00 2001 From: pranalidhanavade Date: Thu, 23 Nov 2023 19:25:11 +0530 Subject: [PATCH 5/7] refactor: bulk issuance socket messages, upload file name Signed-off-by: pranalidhanavade --- src/api/BulkIssuance.ts | 2 +- src/components/Issuance/BulkIssuance.tsx | 1 + src/components/Issuance/History.tsx | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/api/BulkIssuance.ts b/src/api/BulkIssuance.ts index da12a915e..64f18a7dd 100644 --- a/src/api/BulkIssuance.ts +++ b/src/api/BulkIssuance.ts @@ -40,7 +40,7 @@ export const DownloadCsvTemplate = async (credDefId: string) => { } }; -export const uploadCsvFile = async (payload: {file: Uint8Array | Blob}, credefId: string) => { +export const uploadCsvFile = async (payload: {file: Uint8Array | Blob, fileName:string}, credefId: string) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.bulk.uploadCsv}?credDefId=${credefId}`; diff --git a/src/components/Issuance/BulkIssuance.tsx b/src/components/Issuance/BulkIssuance.tsx index 46e0845cd..20f33566b 100644 --- a/src/components/Issuance/BulkIssuance.tsx +++ b/src/components/Issuance/BulkIssuance.tsx @@ -232,6 +232,7 @@ const BulkIssuance = () => { await setToLocalStorage(storageKeys.SOCKET_ID, clientId) const payload = { file: binaryData, + fileName: file?.name || "Not available" }; await wait(500); diff --git a/src/components/Issuance/History.tsx b/src/components/Issuance/History.tsx index 78b1840fb..a9b98ea26 100644 --- a/src/components/Issuance/History.tsx +++ b/src/components/Issuance/History.tsx @@ -73,11 +73,11 @@ const HistoryBulkIssuance = () => { useEffect(() => { SOCKET.emit('bulk-connection'); - SOCKET.on('bulk-issuance-process-completed', () => { - console.log(`bulk-issuance-process-completed`); - toast.success('Issuance process completed.', { + SOCKET.on('bulk-issuance-process-retry-completed', () => { + console.log(`bulk-issuance-process-retry-completed`); + toast.success('Issuance process completed', { position: 'top-right', - autoClose: 5000, + autoClose: 3000, hideProgressBar: false, closeOnClick: true, pauseOnHover: true, @@ -85,10 +85,10 @@ const HistoryBulkIssuance = () => { progress: undefined, theme: 'colored', }); - setSuccess('Bulk issuance process completed.'); + setSuccess('Issuance process completed'); }); - SOCKET.on('error-in-bulk-issuance-process', () => { + SOCKET.on('error-in-bulk-issuance-retry-process', () => { console.log(`error-in-bulk-issuance-retry-process-initiated`); toast.error('Issuance process failed. Please retry', { position: 'top-right', From af77768ab141dd56b24a0aed7e49cdceff142f38 Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Fri, 24 Nov 2023 03:29:03 +0530 Subject: [PATCH 6/7] refactor: status capsule of datatables Signed-off-by: sanjay-k1910 --- src/components/Issuance/History.tsx | 2 +- src/components/Issuance/HistoryDetails.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Issuance/History.tsx b/src/components/Issuance/History.tsx index a9b98ea26..179a67d7c 100644 --- a/src/components/Issuance/History.tsx +++ b/src/components/Issuance/History.tsx @@ -182,7 +182,7 @@ const HistoryBulkIssuance = () => { : status === BulkIssuanceHistory.partially_completed ? 'bg-red-100 text-red-800 dark:bg-gray-700 dark:text-red-400 border border-red-100 dark:border-red-500' : 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-400 border border-gray-100 dark:border-gray-500' - } text-sm font-medium mr-0.5 px-0.5 py-0.5 rounded-md flex justify-center items-center max-w-[180px]`} + } text-sm font-medium mr-0.5 px-0.5 py-0.5 rounded-md flex justify-center items-center w-fit px-2`} > {status === BulkIssuanceHistory.started ? BulkIssuanceHistoryData.started diff --git a/src/components/Issuance/HistoryDetails.tsx b/src/components/Issuance/HistoryDetails.tsx index 8a14b2313..ae44492ab 100644 --- a/src/components/Issuance/HistoryDetails.tsx +++ b/src/components/Issuance/HistoryDetails.tsx @@ -108,15 +108,15 @@ const HistoryDetails = ({ requestId }: IProps) => { }, { data: ( - {history?.isError === false ? BulkIssuanceStatus.successful : BulkIssuanceStatus.failed} - +

), }, { From c33e0447cb08af7db2ccc4ef2f918d4d4c73df48 Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Fri, 24 Nov 2023 04:55:03 +0530 Subject: [PATCH 7/7] refactor: ui changes Signed-off-by: sanjay-k1910 --- src/components/Issuance/BulkIssuance.tsx | 3 +- src/components/Issuance/History.tsx | 35 +++++++++++---------- src/components/User/UserDashBoard.tsx | 2 +- src/components/organization/OrgDropDown.tsx | 4 +-- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/components/Issuance/BulkIssuance.tsx b/src/components/Issuance/BulkIssuance.tsx index 20f33566b..043cab0ef 100644 --- a/src/components/Issuance/BulkIssuance.tsx +++ b/src/components/Issuance/BulkIssuance.tsx @@ -306,6 +306,7 @@ const BulkIssuance = () => { setIsFileUploaded(false); setUploadedFileName(''); setUploadedFile(null); + setUploadMessage(null) }; const handleDrop = (e: { @@ -448,7 +449,7 @@ const BulkIssuance = () => {
-
+