Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: conversion of id's into UUID #413

Merged
merged 17 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
102c2b3
feat: conversion id into uuid
bhavanakarwade Oct 26, 2023
3c1af34
feat: conversion of id's into uuid
bhavanakarwade Oct 27, 2023
b99422b
Merge branch 'develop' of https://github.com/credebl/studio into conv…
bhavanakarwade Oct 27, 2023
86551fa
Merge branch 'develop' of https://github.com/credebl/studio into conv…
bhavanakarwade Oct 31, 2023
0b3cde4
Merge branch 'develop' of https://github.com/credebl/studio into conv…
bhavanakarwade Nov 2, 2023
f393f78
resolved conficts
bhavanakarwade Nov 6, 2023
cd97faa
resolved conflicts
bhavanakarwade Nov 6, 2023
9a118c9
Merge branch 'develop' of https://github.com/credebl/studio into conv…
MoulikaKulkarni Nov 22, 2023
ef03e69
fix:id-to-uuid-conversion
MoulikaKulkarni Nov 22, 2023
5dde266
Merge branch 'develop' of https://github.com/credebl/studio into conv…
MoulikaKulkarni Nov 22, 2023
6db78ba
Merge branch 'develop' of https://github.com/credebl/studio into conv…
sanjay-k1910 Nov 23, 2023
3875740
Merge branch 'develop' of https://github.com/credebl/studio into conv…
pranalidhanavade Nov 23, 2023
067855c
refactor: bulk issuance socket messages, upload file name
pranalidhanavade Nov 23, 2023
09388d6
Merge branch 'develop' of https://github.com/credebl/studio into conv…
sanjay-k1910 Nov 23, 2023
7567f9a
Merge branch 'conversion-id-into-uuid' of https://github.com/credebl/…
sanjay-k1910 Nov 23, 2023
af77768
refactor: status capsule of datatables
sanjay-k1910 Nov 23, 2023
c33e044
refactor: ui changes
sanjay-k1910 Nov 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down
2 changes: 1 addition & 1 deletion src/api/BulkIssuance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;

Expand Down
8 changes: 4 additions & 4 deletions src/api/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand All @@ -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}`,
Expand All @@ -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}`,
Expand All @@ -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`,
Expand Down
6 changes: 3 additions & 3 deletions src/api/ecosystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface CreateEcosystemPayload {
description: string;
logo: string;
tags?: string;
userId: number;
userId: string;
autoEndorsement: boolean;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/api/invitations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const createInvitations = async (invitationList: Array<object>) => {
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.organizations.invitations}`
const payload = {
invitations: invitationList,
orgId: Number(orgId)
orgId: orgId
}
const token = await getFromLocalStorage(storageKeys.TOKEN)

Expand Down Expand Up @@ -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}`

Expand Down Expand Up @@ -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)
Expand All @@ -296,7 +296,7 @@ export const acceptRejectInvitations = async (invitationId: number, orgId: numbe
}
}

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)
Expand Down
8 changes: 4 additions & 4 deletions src/api/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -284,7 +284,7 @@ export const createConnection = async (orgName: string) => {
label: orgName,
multiUseInvitation: true,
autoAcceptConnection: true,
orgId: Number(orgId)
orgId: orgId
}
const payload = data

Expand Down
2 changes: 1 addition & 1 deletion src/commonComponents/AgentHealth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/components/CreateEcosystemOrgModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
storageKeys,
} from '../../config/CommonConstant';
import { calculateSize, dataURItoBlob } from '../../utils/CompressImage';
import { useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { AlertComponent } from '../AlertComponent';
import type { AxiosResponse } from 'axios';
import { asset } from '../../lib/data.js';
Expand Down Expand Up @@ -186,7 +186,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,
autoEndorsement: autoEndorse,
Expand Down Expand Up @@ -516,4 +516,4 @@ const CreateEcosystemOrgModal = (props: IProps) => {
return <>{renderEcosystemModal()}</>;
};

export default CreateEcosystemOrgModal;
export default CreateEcosystemOrgModal;
2 changes: 1 addition & 1 deletion src/components/Ecosystem/Endorsement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface IEndorsementList {
status: string;
type: string;
ecosystemOrgs: {
orgId: number;
orgId: string;
};
requestPayload: string;
responsePayload: string;
Expand Down
6 changes: 3 additions & 3 deletions src/components/Ecosystem/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export interface IEcosystem {
}

export interface Ecosystem {
id: number
id: string
createDateTime: string
createdBy: number
createdBy: string
lastChangedDateTime: string
lastChangedBy: string
autoEndorsement:boolean
lastChangedBy: number
name: string
description: string
logoUrl: string
Expand Down
10 changes: 5 additions & 5 deletions src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export interface EcosystemInvitation {
ecosystem: { name: string; logoUrl: string; };
id: string
createDateTime: string
createdBy: number
createdBy: string
lastChangedDateTime: string
lastChangedBy: number
lastChangedBy: string
deletedAt: any
userId: string
orgId: string
Expand All @@ -60,7 +60,7 @@ const ReceivedInvitations = () => {
const [error, setError] = useState<string | null>(null);
const [organizationsList, setOrganizationsList] = useState<Array<Organisation> | null>(null);
const [currentPage, setCurrentPage] = useState(initialPageState);
const [selectedId, setSelectedId] = useState<number>();
const [selectedId, setSelectedId] = useState<string>('');
const [searchText, setSearchText] = useState('');
const [invitationsData, setInvitationsData] = useState<Array<EcosystemInvitation> | null>(null);
const [getOrgError, setGetOrgError] = useState<string | null>(null);
Expand Down Expand Up @@ -154,7 +154,7 @@ const ReceivedInvitations = () => {
if (orgDid) {
const response = await acceptRejectEcosystemInvitations(
invite.id,
Number(selectedId),
selectedId,
status,
orgName,
orgDid
Expand Down Expand Up @@ -222,7 +222,7 @@ const ReceivedInvitations = () => {
const getOrgId = async () => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
if (orgId) {
setSelectedId(Number(orgId));
setSelectedId(orgId);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/EcosystemInvite/SentInvitations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion src/components/Issuance/BulkIssuance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ const BulkIssuance = () => {
await setToLocalStorage(storageKeys.SOCKET_ID, clientId)
const payload = {
file: binaryData,
fileName: file?.name || "Not available"
};

await wait(500);
Expand Down Expand Up @@ -305,6 +306,7 @@ const BulkIssuance = () => {
setIsFileUploaded(false);
setUploadedFileName('');
setUploadedFile(null);
setUploadMessage(null)
};

const handleDrop = (e: {
Expand Down Expand Up @@ -447,7 +449,7 @@ const BulkIssuance = () => {
<div className="flex flex-col justify-between min-h-100/21rem">
<Card>
<div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
<div className="flex flex-col justify-between">
<div className="search-dropdown text-primary-700 drak:text-primary-700">
<Select
Expand Down
47 changes: 24 additions & 23 deletions src/components/Issuance/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@ 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,
draggable: true,
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',
Expand Down Expand Up @@ -171,28 +171,27 @@ const HistoryBulkIssuance = () => {
{
data: (
<p
className={`${
status === BulkIssuanceHistory.started
? 'bg-primary-100 text-primary-800 dark:bg-gray-700 dark:text-primary-400 border border-primary-100 dark:border-primary-500'
: status === BulkIssuanceHistory.completed ||
status === BulkIssuanceHistory.retry
className={`${status === BulkIssuanceHistory.started
? 'bg-primary-100 text-primary-800 dark:bg-gray-700 dark:text-primary-400 border border-primary-100 dark:border-primary-500'
: status === BulkIssuanceHistory.completed ||
status === BulkIssuanceHistory.retry
? 'bg-green-100 text-green-800 dark:bg-gray-700 dark:text-green-400 border border-green-100 dark:border-green-500'
: status === BulkIssuanceHistory.interrupted
? 'bg-orange-100 text-orange-800 dark:bg-gray-700 dark:text-orange-400 border border-orange-100 dark:border-orange-400'
: 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]`}
? 'bg-orange-100 text-orange-800 dark:bg-gray-700 dark:text-orange-400 border border-orange-100 dark:border-orange-400'
: 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 w-fit px-2`}
>
{status === BulkIssuanceHistory.started
? BulkIssuanceHistoryData.started
: status === BulkIssuanceHistory.completed
? BulkIssuanceHistoryData.completed
: status === BulkIssuanceHistory.interrupted
? BulkIssuanceHistoryData.interrupted
: status === BulkIssuanceHistory.partially_completed
? BulkIssuanceHistoryData.partially_completed
: BulkIssuanceHistoryData.retry}
? BulkIssuanceHistoryData.completed
: status === BulkIssuanceHistory.interrupted
? BulkIssuanceHistoryData.interrupted
: status === BulkIssuanceHistory.partially_completed
? BulkIssuanceHistoryData.partially_completed
: BulkIssuanceHistoryData.retry}
</p>
),
},
Expand Down Expand Up @@ -271,7 +270,9 @@ const HistoryBulkIssuance = () => {
total: totalPages,
});
} else {
setFailure(response as string);
if (response?.toString()?.toLowerCase() !== "history not found") {
setFailure(response as string);
}
}
setLoading(false);
};
Expand Down
6 changes: 3 additions & 3 deletions src/components/Issuance/HistoryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ const HistoryDetails = ({ requestId }: IProps) => {
},
{
data: (
<span
<p
className={`${
history?.isError === false
? 'bg-green-100 text-green-800 dark:bg-gray-700 dark:text-green-400 border border-green-100 dark:border-green-500'
: 'bg-red-100 text-red-800 border border-red-100 dark:border-red-400 dark:bg-gray-700 dark:text-red-400'
} text-md font-medium sm:mr-0 md:mr-2 min-[320]:px-3 sm:px-3 lg:px-3 py-0.5 rounded-md flex justify-center min-[320]:w-full md:w-1/3`}
} text-md font-medium sm:mr-0 md:mr-2 px-2 min-[320]:px-3 sm:px-3 lg:px-3 py-0.5 rounded-md flex justify-center w-fit`}
>
{history?.isError === false ? BulkIssuanceStatus.successful : BulkIssuanceStatus.failed}
</span>
</p>
),
},
{
Expand Down
Loading