Skip to content

Commit

Permalink
fix(PeersTable): fix peers table (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
MixailE authored Dec 4, 2024
1 parent 6cae6a4 commit e80277e
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
diff --git a/dist/dealExplorerClient/indexerClient/queries/offers-query.generated.d.ts b/dist/dealExplorerClient/indexerClient/queries/offers-query.generated.d.ts
index 07fcf82e98fe2af73a8511447bf4beca4cb8a4c6..b73e6420afded231718a37242f5a9df56167372e 100644
--- a/dist/dealExplorerClient/indexerClient/queries/offers-query.generated.d.ts
+++ b/dist/dealExplorerClient/indexerClient/queries/offers-query.generated.d.ts
@@ -176,18 +176,7 @@ export type BasicPeerFragment = {
__typename?: 'Provider';
id: string;
};
- computeUnits?: Array<{
- __typename?: 'ComputeUnit';
- id: string;
- worker?: {
- __typename?: 'Worker';
- id: string;
- } | null;
- provider: {
- __typename?: 'Provider';
- id: string;
- };
- }> | null;
+ computeUnitsTotal: number;
currentCapacityCommitment?: {
__typename?: 'CapacityCommitment';
id: string;
diff --git a/dist/dealExplorerClient/indexerClient/queries/offers-query.generated.js b/dist/dealExplorerClient/indexerClient/queries/offers-query.generated.js
index 28a8fd8328169488b1bc7ba08e3f8a527927fa35..5c5daac9bfcd39f15b1b19bff33462568f301e64 100644
--- a/dist/dealExplorerClient/indexerClient/queries/offers-query.generated.js
+++ b/dist/dealExplorerClient/indexerClient/queries/offers-query.generated.js
@@ -65,9 +65,7 @@ export const BasicPeerFragmentDoc = gql `
provider {
id
}
- computeUnits(where: {deleted: false}) {
- ...ComputeUnitBasic
- }
+ computeUnitsTotal
currentCapacityCommitment {
...ProviderBasicIdCapacityCommitment
}
diff --git a/dist/dealExplorerClient/serializers/schemes.js b/dist/dealExplorerClient/serializers/schemes.js
index b4501d989701a715130598b8ee1a60a8f982fa87..99ec6fa4d0b317aca406f7c71917f59feb6d64b4 100644
--- a/dist/dealExplorerClient/serializers/schemes.js
+++ b/dist/dealExplorerClient/serializers/schemes.js
@@ -118,7 +118,7 @@ export function serializePeers(peers) {
return peers.map((peer) => ({
id: peerIdContractHexToBase58(peer.id),
offerId: peer.offer.id,
- computeUnits: serializeComputeUnitsFromBasic(peer.computeUnits ?? []),
+ computeUnitsTotal: peer.computeUnitsTotal,
currentCapacityCommitment: peer.currentCapacityCommitment
? {
...peer.currentCapacityCommitment,
diff --git a/dist/dealExplorerClient/types/schemes.d.ts b/dist/dealExplorerClient/types/schemes.d.ts
index a75092c0554124f166515bbbd6e232d40e5add74..5447abb8c7a4a306bec29c0a9865e70f4cc4417e 100644
--- a/dist/dealExplorerClient/types/schemes.d.ts
+++ b/dist/dealExplorerClient/types/schemes.d.ts
@@ -115,7 +115,7 @@ export interface Effector {
export interface Peer {
id: string;
offerId: string;
- computeUnits: ComputeUnit[];
+ computeUnitsTotal: number;
currentCapacityCommitment?: {
id: string;
status: CapacityCommitmentStatus;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fluencelabs/deal-ts-clients": "0.23.1",
"@fluencelabs/deal-ts-clients": "patch:@fluencelabs/deal-ts-clients@npm%3A0.23.1#~/.yarn/patches/@fluencelabs-deal-ts-clients-npm-0.23.1-637f5fb879.patch",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-aspect-ratio": "^1.0.3",
"@radix-ui/react-checkbox": "^1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/offer/PeersTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const PeerRow: React.FC<PeerRowProps> = ({ index, peer }) => {
)}
</Cell>
<Cell>
<Text size={12}>{peer.computeUnits.length}</Text>
<Text size={12}>{peer.computeUnitsTotal}</Text>
</Cell>
<Cell>
{peer.currentCapacityCommitment?.status ? (
Expand Down
20 changes: 19 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,24 @@ __metadata:
languageName: node
linkType: hard

"@fluencelabs/deal-ts-clients@patch:@fluencelabs/deal-ts-clients@npm%3A0.23.1#~/.yarn/patches/@fluencelabs-deal-ts-clients-npm-0.23.1-637f5fb879.patch":
version: 0.23.1
resolution: "@fluencelabs/deal-ts-clients@patch:@fluencelabs/deal-ts-clients@npm%3A0.23.1#~/.yarn/patches/@fluencelabs-deal-ts-clients-npm-0.23.1-637f5fb879.patch::version=0.23.1&hash=ecd36c"
dependencies:
"@graphql-typed-document-node/core": "npm:^3.2.0"
debug: "npm:^4.3.4"
dotenv: "npm:^16.3.1"
ethers: "npm:6.7.1"
graphql: "npm:^16.8.1"
graphql-request: "npm:^6.1.0"
graphql-scalars: "npm:^1.22.4"
graphql-tag: "npm:^2.12.6"
ipfs-http-client: "npm:^60.0.1"
multiformats: "npm:^13.0.1"
checksum: 10c0/ff30cff75c7fd1fe3d6aa0f593621b7a783646b2feb704178b62c8b00ea71785774db7bc550bead69078e63326883f88fc83fca3f6ccdd80fecf425455ec84de
languageName: node
linkType: hard

"@graphql-typed-document-node/core@npm:^3.2.0":
version: 3.2.0
resolution: "@graphql-typed-document-node/core@npm:3.2.0"
Expand Down Expand Up @@ -6470,7 +6488,7 @@ __metadata:
"@emotion/babel-plugin": "npm:^11.11.0"
"@emotion/react": "npm:^11.11.1"
"@emotion/styled": "npm:^11.11.0"
"@fluencelabs/deal-ts-clients": "npm:0.23.1"
"@fluencelabs/deal-ts-clients": "patch:@fluencelabs/deal-ts-clients@npm%3A0.23.1#~/.yarn/patches/@fluencelabs-deal-ts-clients-npm-0.23.1-637f5fb879.patch"
"@radix-ui/react-accordion": "npm:^1.1.2"
"@radix-ui/react-aspect-ratio": "npm:^1.0.3"
"@radix-ui/react-checkbox": "npm:^1.0.4"
Expand Down

0 comments on commit e80277e

Please sign in to comment.