diff --git a/apps/portal/app/lib/services/lists.ts b/apps/portal/app/lib/services/lists.ts index aebcc3bfc..e0207a71a 100644 --- a/apps/portal/app/lib/services/lists.ts +++ b/apps/portal/app/lib/services/lists.ts @@ -116,12 +116,16 @@ export async function getListIdentities({ request, objectId, creator, + userWithPosition, searchParams, + userAssetsForPresent = null, }: { request: Request objectId: string creator?: string + userWithPosition?: string searchParams: URLSearchParams + userAssetsForPresent?: boolean | null }) { const { page, limit, sortBy, direction } = getStandardPageParams({ searchParams, @@ -141,6 +145,8 @@ export async function getListIdentities({ object: objectId, displayName, creator, + userWithPosition, + userAssetsForPresent, }, }) @@ -157,7 +163,6 @@ export async function getListIdentities({ currentPage: Number(page), limit: Number(limit), totalEntries: listIdentities.total, - totalPages, }, } @@ -167,10 +172,14 @@ export async function getListIdentitiesCount({ request, objectId, creator, + userWithPosition, + userAssetsForPresent = null, }: { request: Request objectId: string creator?: string + userWithPosition?: string + userAssetsForPresent?: boolean | null }) { const listIdentities = await fetchWrapper(request, { method: ClaimsService.searchClaims, @@ -178,8 +187,10 @@ export async function getListIdentitiesCount({ predicate: getSpecialPredicate(CURRENT_ENV).tagPredicate.id, object: objectId, creator, + userWithPosition, page: 1, limit: 1, + userAssetsPresent: userAssetsForPresent, }, }) diff --git a/apps/portal/app/routes/app+/list+/$id+/index.tsx b/apps/portal/app/routes/app+/list+/$id+/index.tsx index 2f71ba0e4..e04fb9d99 100644 --- a/apps/portal/app/routes/app+/list+/$id+/index.tsx +++ b/apps/portal/app/routes/app+/list+/$id+/index.tsx @@ -57,7 +57,6 @@ import { useAtom, useSetAtom } from 'jotai' export async function loader({ request, params }: LoaderFunctionArgs) { const id = params.id - invariant(id, NO_PARAM_ID_ERROR) const wallet = await requireUserWallet(request) @@ -87,7 +86,6 @@ export async function loader({ request, params }: LoaderFunctionArgs) { method: ClaimsService.getClaimById, args: { id }, }) - invariant(claim.object?.id, NO_PARAM_ID_ERROR) const totalGlobalIdentitiesCount = getListIdentitiesCount({ @@ -98,9 +96,18 @@ export async function loader({ request, params }: LoaderFunctionArgs) { const totalUserIdentitiesCount = getListIdentitiesCount({ request, objectId: claim.object.id, - creator: wallet, + userWithPosition: userObject.id, + userAssetsForPresent: true, }) + const totalAdditionalUserIdentitiesCount = paramWallet + ? getListIdentitiesCount({ + request, + objectId: claim.object.id, + userWithPosition: additionalUserObject?.id, + userAssetsForPresent: true, + }) + : 0 return defer({ wallet, userObject, @@ -112,26 +119,22 @@ export async function loader({ request, params }: LoaderFunctionArgs) { userListIdentities: getListIdentities({ request, objectId: claim.object.id, - creator: wallet, searchParams, + userWithPosition: userObject.id, + userAssetsForPresent: true, }), additionalUserListIdentities: paramWallet ? getListIdentities({ request, objectId: claim.object.id, - creator: paramWallet, searchParams, + userWithPosition: additionalUserObject?.id, + userAssetsForPresent: true, }) : null, totalGlobalIdentitiesCount, totalUserIdentitiesCount, - additionalTotalUserIdentitiesCount: paramWallet - ? getListIdentitiesCount({ - request, - objectId: claim.object.id, - creator: paramWallet, - }) - : [], + additionalTotalUserIdentitiesCount: totalAdditionalUserIdentitiesCount, additionalUserObject, }) } diff --git a/apps/portal/app/routes/readonly+/list+/$id+/index.tsx b/apps/portal/app/routes/readonly+/list+/$id+/index.tsx index cdd74d9d2..031cb47dc 100644 --- a/apps/portal/app/routes/readonly+/list+/$id+/index.tsx +++ b/apps/portal/app/routes/readonly+/list+/$id+/index.tsx @@ -43,7 +43,6 @@ import { IdentityListType, VaultDetailsType } from 'app/types' export async function loader({ request, params }: LoaderFunctionArgs) { const id = params.id - invariant(id, NO_PARAM_ID_ERROR) const url = new URL(request.url) @@ -63,7 +62,6 @@ export async function loader({ request, params }: LoaderFunctionArgs) { method: ClaimsService.getClaimById, args: { id }, }) - invariant(claim.object?.id, NO_PARAM_ID_ERROR) const totalGlobalIdentitiesCount = getListIdentitiesCount({ @@ -71,6 +69,15 @@ export async function loader({ request, params }: LoaderFunctionArgs) { objectId: claim.object.id, }) + const totalAdditionalUserIdentitiesCount = paramWallet + ? getListIdentitiesCount({ + request, + objectId: claim.object.id, + userWithPosition: additionalUserObject?.id, + userAssetsForPresent: true, + }) + : 0 + return defer({ globalListIdentities: getListIdentities({ request, @@ -86,18 +93,13 @@ export async function loader({ request, params }: LoaderFunctionArgs) { ? getListIdentities({ request, objectId: claim.object.id, - creator: paramWallet, searchParams, + userWithPosition: additionalUserObject?.id, + userAssetsForPresent: true, }) : null, totalGlobalIdentitiesCount, - additionalTotalUserIdentitiesCount: paramWallet - ? getListIdentitiesCount({ - request, - objectId: claim.object.id, - creator: paramWallet, - }) - : [], + totalAdditionalUserIdentitiesCount, additionalUserObject, }) } diff --git a/packages/api/src/api-client/core/OpenAPI.ts b/packages/api/src/api-client/core/OpenAPI.ts index eae0b3934..4a1e582f3 100644 --- a/packages/api/src/api-client/core/OpenAPI.ts +++ b/packages/api/src/api-client/core/OpenAPI.ts @@ -47,7 +47,7 @@ export const OpenAPI: OpenAPIConfig = { PASSWORD: undefined, TOKEN: undefined, USERNAME: undefined, - VERSION: '0.63.0', + VERSION: '0.67.0', WITH_CREDENTIALS: false, interceptors: { request: new Interceptors(), diff --git a/packages/api/src/api-client/services.gen.ts b/packages/api/src/api-client/services.gen.ts index 5f4981369..e555a4aa7 100644 --- a/packages/api/src/api-client/services.gen.ts +++ b/packages/api/src/api-client/services.gen.ts @@ -506,6 +506,13 @@ export class ClaimsService { * @param data.displayName * @param data.counterVault * @param data.status + * @param data.userWithPosition + * @param data.userAssetsFor + * @param data.userAssetsForPresent + * @param data.userAssetsAgainst + * @param data.userAssetsAgainstPresent + * @param data.userAssets + * @param data.userAssetsPresent * @returns unknown Search claims in paginated list * @throws ApiError */ @@ -530,6 +537,13 @@ export class ClaimsService { displayName: data.displayName, counterVault: data.counterVault, status: data.status, + userWithPosition: data.userWithPosition, + userAssetsFor: data.userAssetsFor, + userAssetsForPresent: data.userAssetsForPresent, + userAssetsAgainst: data.userAssetsAgainst, + userAssetsAgainstPresent: data.userAssetsAgainstPresent, + userAssets: data.userAssets, + userAssetsPresent: data.userAssetsPresent, }, }) } @@ -550,6 +564,13 @@ export class ClaimsService { * @param data.displayName * @param data.counterVault * @param data.status + * @param data.userWithPosition + * @param data.userAssetsFor + * @param data.userAssetsForPresent + * @param data.userAssetsAgainst + * @param data.userAssetsAgainstPresent + * @param data.userAssets + * @param data.userAssetsPresent * @returns unknown Summary of claim values based on query * @throws ApiError */ @@ -574,6 +595,13 @@ export class ClaimsService { displayName: data.displayName, counterVault: data.counterVault, status: data.status, + userWithPosition: data.userWithPosition, + userAssetsFor: data.userAssetsFor, + userAssetsForPresent: data.userAssetsForPresent, + userAssetsAgainst: data.userAssetsAgainst, + userAssetsAgainstPresent: data.userAssetsAgainstPresent, + userAssets: data.userAssets, + userAssetsPresent: data.userAssetsPresent, }, }) } diff --git a/packages/api/src/api-client/types.gen.ts b/packages/api/src/api-client/types.gen.ts index f5280019c..a394d58a9 100644 --- a/packages/api/src/api-client/types.gen.ts +++ b/packages/api/src/api-client/types.gen.ts @@ -928,6 +928,7 @@ export type QuestCondition = | 'create_tag_claim' | 'stake_claim' | 'stake_identity' + | 'unimplemented' /** * This enum represents the conditions that we can handle for quests @@ -941,6 +942,7 @@ export const QuestCondition = { CREATE_TAG_CLAIM: 'create_tag_claim', STAKE_CLAIM: 'stake_claim', STAKE_IDENTITY: 'stake_identity', + UNIMPLEMENTED: 'unimplemented', } as const /** @@ -1789,6 +1791,13 @@ export type SearchClaimsData = { sortBy?: ClaimSortColumn | null status?: Status | null subject?: Identifier | null + userAssets?: number | null + userAssetsAgainst?: number | null + userAssetsAgainstPresent?: boolean | null + userAssetsFor?: number | null + userAssetsForPresent?: boolean | null + userAssetsPresent?: boolean | null + userWithPosition?: string | null vault?: Identifier | null } @@ -1813,6 +1822,13 @@ export type ClaimSummaryData = { sortBy?: ClaimSortColumn | null status?: Status | null subject?: Identifier | null + userAssets?: number | null + userAssetsAgainst?: number | null + userAssetsAgainstPresent?: boolean | null + userAssetsFor?: number | null + userAssetsForPresent?: boolean | null + userAssetsPresent?: boolean | null + userWithPosition?: string | null vault?: Identifier | null } @@ -3695,6 +3711,13 @@ export type $OpenApiTs = { sortBy?: ClaimSortColumn | null status?: Status | null subject?: Identifier | null + userAssets?: number | null + userAssetsAgainst?: number | null + userAssetsAgainstPresent?: boolean | null + userAssetsFor?: number | null + userAssetsForPresent?: boolean | null + userAssetsPresent?: boolean | null + userWithPosition?: string | null vault?: Identifier | null } res: { @@ -3726,6 +3749,13 @@ export type $OpenApiTs = { sortBy?: ClaimSortColumn | null status?: Status | null subject?: Identifier | null + userAssets?: number | null + userAssetsAgainst?: number | null + userAssetsAgainstPresent?: boolean | null + userAssetsFor?: number | null + userAssetsForPresent?: boolean | null + userAssetsPresent?: boolean | null + userWithPosition?: string | null vault?: Identifier | null } res: {