Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ const ConnectionList = (props: {

const refreshPage = (): void => {
setLocalOrgs([])
getConnections(listAPIParameterIssuance)
}

useEffect(() => {
Expand Down Expand Up @@ -185,21 +184,29 @@ const ConnectionList = (props: {
pageSize={listAPIParameterIssuance.itemPerPage}
pageCount={Math.ceil(totalItem / listAPIParameterIssuance.itemPerPage)}
onPageChange={(index) =>
setListAPIParameterIssuance((prev) => ({ ...prev, page: index + 1 }))
setListAPIParameterIssuance((prev) => {
const newPage = index + 1
if (prev.page === newPage) {
return prev
}
return { ...prev, page: newPage }
})
}
onPageSizeChange={(size) =>
setListAPIParameterIssuance((prev) => ({
...prev,
itemPerPage: size,
page: 1,
}))
setListAPIParameterIssuance((prev) => {
if (prev.itemPerPage === size && prev.page === 1) {
return prev
}
return { ...prev, itemPerPage: size, page: 1 }
})
}
onSearchTerm={(term) =>
setListAPIParameterIssuance((prev) => ({
...prev,
search: term,
page: 1,
}))
setListAPIParameterIssuance((prev) => {
if (prev.search === term && prev.page === 1) {
return prev
}
return { ...prev, search: term, page: 1 }
})
}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { AxiosResponse } from 'axios'
import { ConnectionApiSortFields } from '@/features/connections/types/connections-interface'
import { DataTable } from '../../../../components/ui/generic-table-component/data-table'
import { DidMethod } from '@/features/common/enum'
import { EmptyListMessage } from '@/components/EmptyListComponent'
import { Features } from '@/common/enums'
import { IssuedCredential } from '../type/Issuance'
import PageContainer from '@/components/layout/page-container'
Expand Down Expand Up @@ -313,41 +312,31 @@ const Credentials = (): JSX.Element => {
/>
)}

{!walletCreated && !loading ? (
<div className="flex items-center justify-center">
<EmptyListMessage
message={'No Wallet Details Found'}
description={'The owner is required to create a wallet'}
buttonContent={''}
/>
</div>
) : (
<div className="-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-y-0 lg:space-x-12">
<DataTable
isLoading={loading}
placeHolder="Filter by Connection Id and Schema Name"
data={issuedCredList}
columns={column}
index={'credentialExchangeId'}
pageIndex={pagination.pageIndex}
pageSize={pagination.pageSize}
pageCount={pagination.pageCount}
onPageChange={(index) =>
setPagination((prev) => ({ ...prev, pageIndex: index }))
}
onPageSizeChange={(size) => {
setPagination((prev) => ({
...prev,
pageSize: size,
pageIndex: 0,
}))
}}
onSearchTerm={(term) =>
setPagination((prev) => ({ ...prev, searchTerm: term }))
}
/>
</div>
)}
<div className="-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-y-0 lg:space-x-12">
<DataTable
isLoading={loading}
placeHolder="Filter by Connection Id and Schema Name"
data={issuedCredList}
columns={column}
index={'credentialExchangeId'}
pageIndex={pagination.pageIndex}
pageSize={pagination.pageSize}
pageCount={pagination.pageCount}
onPageChange={(index) =>
setPagination((prev) => ({ ...prev, pageIndex: index }))
}
onPageSizeChange={(size) => {
setPagination((prev) => ({
...prev,
pageSize: size,
pageIndex: 0,
}))
}}
onSearchTerm={(term) =>
setPagination((prev) => ({ ...prev, searchTerm: term }))
}
/>
</div>
</PageContainer>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { AxiosResponse } from 'axios'
import { Button } from '@/components/ui/button'
import { ConnectionApiSortFields } from '@/features/connections/types/connections-interface'
import { DataTable } from '../../../components/ui/generic-table-component/data-table'
import { EmptyListMessage } from '@/components/EmptyListComponent'
import { Features } from '@/common/enums'
import PageContainer from '@/components/layout/page-container'
import ProofRequest from './ProofRequestPopup'
Expand Down Expand Up @@ -81,6 +80,7 @@ const VerificationCredentialList = (): JSX.Element => {

const fetchOrganizationDetails = async (): Promise<void> => {
if (!orgId) {
setLoading(false)
return
}
setLoading(true)
Expand Down Expand Up @@ -130,6 +130,7 @@ const VerificationCredentialList = (): JSX.Element => {

try {
if (!orgId) {
setLoading(false)
return
}
const response = await getVerificationList(orgId, {
Expand Down Expand Up @@ -459,40 +460,31 @@ const VerificationCredentialList = (): JSX.Element => {
</div>
)}

{!isWalletCreated && !loading ? (
<div className="flex items-center justify-center">
<EmptyListMessage
message={'No Wallet Details Found'}
description={'The owner is required to create a wallet'}
/>
</div>
) : (
<div className="-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-y-0 lg:space-x-12">
<DataTable
isLoading={loading}
placeHolder="Filter by Connection Id and Schema Name"
data={verificationList}
columns={column}
index={'presentationId'}
pageIndex={proofPagination.pageIndex}
pageSize={proofPagination.pageSize}
pageCount={proofPagination.pageCount}
onPageChange={(index) =>
setProofPagination((prev) => ({ ...prev, pageIndex: index }))
}
onPageSizeChange={(size) => {
setProofPagination((prev) => ({
...prev,
pageSize: size,
pageIndex: 0,
}))
}}
onSearchTerm={(term) =>
setProofPagination((prev) => ({ ...prev, searchTerm: term }))
}
/>
</div>
)}
<div className="-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-y-0 lg:space-x-12">
<DataTable
isLoading={loading}
placeHolder="Filter by Connection Id and Schema Name"
data={verificationList}
columns={column}
index={'presentationId'}
pageIndex={proofPagination.pageIndex}
pageSize={proofPagination.pageSize}
pageCount={proofPagination.pageCount}
onPageChange={(index) =>
setProofPagination((prev) => ({ ...prev, pageIndex: index }))
}
onPageSizeChange={(size) => {
setProofPagination((prev) => ({
...prev,
pageSize: size,
pageIndex: 0,
}))
}}
onSearchTerm={(term) =>
setProofPagination((prev) => ({ ...prev, searchTerm: term }))
}
/>
</div>

{userData && (
<ProofRequest
Expand Down