From e80277eaf660812772aab3794138de641e5d3d95 Mon Sep 17 00:00:00 2001 From: Michel Erokhov Date: Wed, 4 Dec 2024 16:31:55 +0300 Subject: [PATCH] fix(PeersTable): fix peers table (#129) --- ...eal-ts-clients-npm-0.23.1-637f5fb879.patch | 65 +++++++++++++++++++ package.json | 2 +- src/pages/offer/PeersTable.tsx | 2 +- yarn.lock | 20 +++++- 4 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 .yarn/patches/@fluencelabs-deal-ts-clients-npm-0.23.1-637f5fb879.patch diff --git a/.yarn/patches/@fluencelabs-deal-ts-clients-npm-0.23.1-637f5fb879.patch b/.yarn/patches/@fluencelabs-deal-ts-clients-npm-0.23.1-637f5fb879.patch new file mode 100644 index 0000000..581fe30 --- /dev/null +++ b/.yarn/patches/@fluencelabs-deal-ts-clients-npm-0.23.1-637f5fb879.patch @@ -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; diff --git a/package.json b/package.json index 5b251a6..99c3bf0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/pages/offer/PeersTable.tsx b/src/pages/offer/PeersTable.tsx index e827898..90ed58a 100644 --- a/src/pages/offer/PeersTable.tsx +++ b/src/pages/offer/PeersTable.tsx @@ -77,7 +77,7 @@ const PeerRow: React.FC = ({ index, peer }) => { )} - {peer.computeUnits.length} + {peer.computeUnitsTotal} {peer.currentCapacityCommitment?.status ? ( diff --git a/yarn.lock b/yarn.lock index 281694d..0848715 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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"