Skip to content

Commit 852a390

Browse files
Merge pull request #445 from credebl/merge-dev-to-prod-nov24
Merge develop to main
2 parents 4006fab + 79c60ab commit 852a390

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+818
-683
lines changed

src/api/Agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { apiRoutes } from "../config/apiRoutes";
33
import { getFromLocalStorage } from "./Auth";
44
import { storageKeys } from "../config/CommonConstant";
55

6-
export const getAgentHealth = async (orgId:number) => {
6+
export const getAgentHealth = async (orgId:string) => {
77
const token = await getFromLocalStorage(storageKeys.TOKEN)
88
const details = {
99
url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.checkAgentHealth}`,

src/api/BulkIssuance.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type download from 'downloadjs';
21
import { apiRoutes } from '../config/apiRoutes';
32
import { storageKeys } from '../config/CommonConstant';
43
import {
@@ -24,9 +23,8 @@ export const getSchemaCredDef = async () => {
2423
}
2524
};
2625

27-
export const DownloadCsvTemplate = async () => {
26+
export const DownloadCsvTemplate = async (credDefId: string) => {
2827
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
29-
const credDefId = await getFromLocalStorage(storageKeys.CRED_DEF_ID);
3028
const url = `${apiRoutes.organizations.root}/${orgId}/${credDefId}${apiRoutes.Issuance.download}`;
3129

3230
const axiosPayload = {
@@ -42,14 +40,8 @@ export const DownloadCsvTemplate = async () => {
4240
}
4341
};
4442

45-
// bulk issuance
46-
47-
// upload file
48-
49-
export const uploadCsvFile = async (payload: any) => {
43+
export const uploadCsvFile = async (payload: {file: Uint8Array | Blob, fileName:string}, credefId: string) => {
5044
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
51-
const credefId = await getFromLocalStorage(storageKeys.CRED_DEF_ID);
52-
5345
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.bulk.uploadCsv}?credDefId=${credefId}`;
5446

5547
const axiosPayload = {
@@ -66,8 +58,6 @@ export const uploadCsvFile = async (payload: any) => {
6658
}
6759
};
6860

69-
//get file data
70-
7161
export const getCsvFileData = async (
7262
requestId: any,
7363
pageNumber: number,
@@ -110,15 +100,13 @@ export const issueBulkCredential = async (requestId: string, clientId: string) =
110100
}
111101
};
112102

113-
export const retryBulkIssuance = async (fileId:string) => {
114-
const socketId= await getFromLocalStorage(storageKeys.SOCKET_ID)
115-
103+
export const retryBulkIssuance = async (fileId:string, clientId:string) => {
116104
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
117105
const url = `${apiRoutes.organizations.root}/${orgId}/${fileId}${apiRoutes.Issuance.bulk.retry}`;
118106

119107
const axiosPayload = {
120108
url,
121-
payload:{clientId:socketId},
109+
payload:{clientId:clientId},
122110
config: await getHeaderConfigs(),
123111
};
124112

src/api/Schema.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const getAllSchemasByOrgId = async ({ search, itemPerPage, page }: GetAll
4949
}
5050
}
5151

52-
export const addSchema = async (payload: createSchema, orgId: number) => {
52+
export const addSchema = async (payload: createSchema, orgId: string) => {
5353
const token = await getFromLocalStorage(storageKeys.TOKEN)
5454
const details = {
5555
url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.create}`,
@@ -72,7 +72,7 @@ export const addSchema = async (payload: createSchema, orgId: number) => {
7272
}
7373
}
7474

75-
export const getSchemaById = async (schemaId: string, orgId: number) => {
75+
export const getSchemaById = async (schemaId: string, orgId: string) => {
7676
const token = await getFromLocalStorage(storageKeys.TOKEN)
7777
const details = {
7878
url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getSchemaById}/${schemaId}`,
@@ -94,7 +94,7 @@ export const getSchemaById = async (schemaId: string, orgId: number) => {
9494
}
9595
}
9696

97-
export const createCredentialDefinition = async (payload: createCredDeffFieldName, orgId:number) => {
97+
export const createCredentialDefinition = async (payload: createCredDeffFieldName, orgId:string) => {
9898
const token = await getFromLocalStorage(storageKeys.TOKEN)
9999
const details = {
100100
url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.createCredentialDefinition}`,
@@ -118,7 +118,7 @@ export const createCredentialDefinition = async (payload: createCredDeffFieldNam
118118
}
119119
}
120120

121-
export const getCredDeffById = async (schemaId: string, orgId: number) => {
121+
export const getCredDeffById = async (schemaId: string, orgId: string) => {
122122
const token = await getFromLocalStorage(storageKeys.TOKEN)
123123
const details = {
124124
url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getCredDefBySchemaId}/${schemaId}/cred-defs`,

src/api/ecosystem.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface CreateEcosystemPayload {
1010
description: string;
1111
logo: string;
1212
tags?: string;
13-
userId: number;
13+
userId: string;
1414
autoEndorsement: boolean;
1515
}
1616

@@ -105,7 +105,7 @@ export const getEndorsementList = async (
105105
export const createSchemaRequest = async (
106106
data: object,
107107
endorsementId: string,
108-
orgId: number,
108+
orgId: string,
109109
) => {
110110
const url = `${apiRoutes.Ecosystem.root}/${endorsementId}/${orgId}${apiRoutes.Ecosystem.endorsements.createSchemaRequest}`;
111111
const payload = data;
@@ -126,7 +126,7 @@ export const createSchemaRequest = async (
126126
export const createCredDefRequest = async (
127127
data: object,
128128
ecosystemId: string,
129-
orgId: number,
129+
orgId: string,
130130
) => {
131131
const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.endorsements.createCredDefRequest}`;
132132
const payload = data;

src/api/invitations.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const createInvitations = async (invitationList: Array<object>) => {
4343
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.organizations.invitations}`
4444
const payload = {
4545
invitations: invitationList,
46-
orgId: Number(orgId)
46+
orgId: orgId
4747
}
4848
const token = await getFromLocalStorage(storageKeys.TOKEN)
4949

@@ -233,7 +233,7 @@ export const getEcosystemInvitations = async (pageNumber: number, pageSize: numb
233233
}
234234

235235
// Accept/ Reject Invitations
236-
export const acceptRejectEcosystemInvitations = async (invitationId: string, orgId: number, status: string, orgName: string, orgDid: string) => {
236+
export const acceptRejectEcosystemInvitations = async (invitationId: string, orgId: string, status: string, orgName: string, orgDid: string) => {
237237

238238
const url = `${apiRoutes.Ecosystem.root}/${orgId}${apiRoutes.Ecosystem.invitations}/${invitationId}`
239239

@@ -265,12 +265,12 @@ export const acceptRejectEcosystemInvitations = async (invitationId: string, org
265265
}
266266
}
267267

268-
export const acceptRejectInvitations = async (invitationId: number, orgId: number, status: string) => {
268+
export const acceptRejectInvitations = async (invitationId: string, orgId: string, status: string) => {
269269

270270
const url = `${apiRoutes.users.invitations}/${invitationId}`
271271

272272
const payload = {
273-
orgId: Number(orgId),
273+
orgId: orgId,
274274
status
275275
}
276276
const token = await getFromLocalStorage(storageKeys.TOKEN)
@@ -296,7 +296,7 @@ export const acceptRejectInvitations = async (invitationId: number, orgId: numbe
296296
}
297297
}
298298

299-
export const deleteEcosystemInvitations = async (invitationId: number) => {
299+
export const deleteEcosystemInvitations = async (invitationId: string) => {
300300

301301
const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID);
302302
const orgId = await getFromLocalStorage(storageKeys.ORG_ID)

src/api/organization.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const getOrgDashboard = async (orgId: string) => {
138138
}
139139
}
140140

141-
export const spinupDedicatedAgent = async (data: object, orgId:number) => {
141+
export const spinupDedicatedAgent = async (data: object, orgId:string) => {
142142

143143
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.agentDedicatedSpinup}`
144144
const payload = data
@@ -166,7 +166,7 @@ export const spinupDedicatedAgent = async (data: object, orgId:number) => {
166166
}
167167
}
168168

169-
export const spinupSharedAgent = async (data: object, orgId:number) => {
169+
export const spinupSharedAgent = async (data: object, orgId:string) => {
170170

171171
const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.agentSharedSpinup}`
172172
const payload = data
@@ -247,7 +247,7 @@ export const getOrganizationUsers = async (pageNumber: number, pageSize: number,
247247
}
248248

249249
// Edit user roles
250-
export const editOrganizationUserRole = async (userId: number, roles: number[]) => {
250+
export const editOrganizationUserRole = async (userId: string, roles: string[]) => {
251251

252252
const orgId = await getFromLocalStorage(storageKeys.ORG_ID)
253253

@@ -284,7 +284,7 @@ export const createConnection = async (orgName: string) => {
284284
label: orgName,
285285
multiUseInvitation: true,
286286
autoAcceptConnection: true,
287-
orgId: Number(orgId)
287+
orgId: orgId
288288
}
289289
const payload = data
290290

src/common/enums.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,25 @@ export enum EcosystemRoles {
5757
export enum PlatformRoles {
5858
platformAdmin = "platform_admin"
5959
}
60+
61+
export enum BulkIssuanceHistory {
62+
started = 'PROCESS_STARTED',
63+
completed = 'PROCESS_COMPLETED',
64+
interrupted= 'PROCESS_INTERRUPTED',
65+
retry= 'PROCESS_REINITIATED',
66+
partially_completed= 'PARTIALLY_COMPLETED'
67+
68+
}
69+
70+
export enum BulkIssuanceHistoryData {
71+
started = 'Process Started',
72+
completed = 'Process Completed',
73+
interrupted= 'Process Interrupted',
74+
retry= 'Process Reinitiated',
75+
partially_completed= "Process Failed"
76+
}
77+
78+
export enum BulkIssuanceStatus {
79+
successful= 'Successful',
80+
failed= 'Failed'
81+
}

src/common/global.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ ul[role="tablist"] li[role="presentation"] button[aria-selected="true"] {
1717
@apply text-primary-700 border-primary-700;
1818
}
1919

20+
button.role-btn span {
21+
@apply overflow-hidden;
22+
border-radius: 8px;
23+
padding-top: 6.5px;
24+
padding-bottom: 6.5px;
25+
}
26+
2027
.word-break-word{
2128
word-break: break-word !important;
2229
}
@@ -103,7 +110,7 @@ ul.timelinestatic {
103110
}
104111

105112
.search-dropdown .select__control .select__placeholder {
106-
@apply absolute flex items-start;
113+
@apply absolute flex items-start ml-2;
107114
}
108115

109116
.search-dropdown .select__control .select__value-container{
@@ -112,8 +119,11 @@ ul.timelinestatic {
112119
}
113120

114121
.select__single-value{
115-
@apply !text-primary-700;
116-
width: calc(100% - 5px);
122+
@apply dark:!text-white !text-primary-700 w-fit;
123+
}
124+
125+
.select__value-container .select__value-container--has-value .select__single-value {
126+
@apply w-fit;
117127
}
118128

119129
.search-dropdown{

src/commonComponents/AgentHealth.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const AgentHealth = () => {
2929
const organizationId = await getFromLocalStorage(storageKeys.ORG_ID);
3030
setCheckOrgExist(Number(organizationId))
3131
if (Number(organizationId) !== 0) {
32-
const agentData = await getAgentHealth(Number(organizationId));
32+
const agentData = await getAgentHealth(organizationId);
3333
const { data } = agentData as AxiosResponse;
3434
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
3535
setAgentHealthDetails(data?.data);

src/components/CreateEcosystemOrgModal/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
storageKeys,
1111
} from '../../config/CommonConstant';
1212
import { calculateSize, dataURItoBlob } from '../../utils/CompressImage';
13-
import { useEffect, useState } from 'react';
13+
import React, { useEffect, useState } from 'react';
1414
import { AlertComponent } from '../AlertComponent';
1515
import type { AxiosResponse } from 'axios';
1616
import { asset } from '../../lib/data.js';
@@ -186,7 +186,7 @@ const CreateEcosystemOrgModal = (props: IProps) => {
186186
description: values.description,
187187
logo: (logoImage?.imagePreviewUrl as string) || '',
188188
tags: '',
189-
userId: Number(user_data?.id),
189+
userId: user_data?.id,
190190
orgName: orgDetails?.orgName,
191191
orgDid: orgDetails?.orgDid,
192192
autoEndorsement: autoEndorse,
@@ -516,4 +516,4 @@ const CreateEcosystemOrgModal = (props: IProps) => {
516516
return <>{renderEcosystemModal()}</>;
517517
};
518518

519-
export default CreateEcosystemOrgModal;
519+
export default CreateEcosystemOrgModal;

src/components/Ecosystem/Endorsement/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface IEndorsementList {
4242
status: string;
4343
type: string;
4444
ecosystemOrgs: {
45-
orgId: number;
45+
orgId: string;
4646
};
4747
requestPayload: string;
4848
responsePayload: string;

src/components/Ecosystem/interfaces/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export interface IEcosystem {
1414
}
1515

1616
export interface Ecosystem {
17-
id: number
17+
id: string
1818
createDateTime: string
19-
createdBy: number
19+
createdBy: string
2020
lastChangedDateTime: string
21+
lastChangedBy: string
2122
autoEndorsement:boolean
22-
lastChangedBy: number
2323
name: string
2424
description: string
2525
logoUrl: string

src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export interface EcosystemInvitation {
4040
ecosystem: { name: string; logoUrl: string; };
4141
id: string
4242
createDateTime: string
43-
createdBy: number
43+
createdBy: string
4444
lastChangedDateTime: string
45-
lastChangedBy: number
45+
lastChangedBy: string
4646
deletedAt: any
4747
userId: string
4848
orgId: string
@@ -60,7 +60,7 @@ const ReceivedInvitations = () => {
6060
const [error, setError] = useState<string | null>(null);
6161
const [organizationsList, setOrganizationsList] = useState<Array<Organisation> | null>(null);
6262
const [currentPage, setCurrentPage] = useState(initialPageState);
63-
const [selectedId, setSelectedId] = useState<number>();
63+
const [selectedId, setSelectedId] = useState<string>('');
6464
const [searchText, setSearchText] = useState('');
6565
const [invitationsData, setInvitationsData] = useState<Array<EcosystemInvitation> | null>(null);
6666
const [getOrgError, setGetOrgError] = useState<string | null>(null);
@@ -154,7 +154,7 @@ const ReceivedInvitations = () => {
154154
if (orgDid) {
155155
const response = await acceptRejectEcosystemInvitations(
156156
invite.id,
157-
Number(selectedId),
157+
selectedId,
158158
status,
159159
orgName,
160160
orgDid
@@ -222,7 +222,7 @@ const ReceivedInvitations = () => {
222222
const getOrgId = async () => {
223223
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
224224
if (orgId) {
225-
setSelectedId(Number(orgId));
225+
setSelectedId(orgId);
226226
}
227227
};
228228

src/components/EcosystemInvite/SentInvitations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const SentInvitations = () => {
6666
setLoading(false);
6767
};
6868

69-
const deletInvitations = async (invitationId: number) => {
69+
const deletInvitations = async (invitationId: string) => {
7070
const response = await deleteEcosystemInvitations(invitationId);
7171
const { data } = response as AxiosResponse;
7272

0 commit comments

Comments
 (0)