From 49caca234d6d7ad016778af9cf9d317c84e92dcd Mon Sep 17 00:00:00 2001 From: claudiaHash <49017601+claudiaHash@users.noreply.github.com> Date: Thu, 15 Apr 2021 15:54:41 +0300 Subject: [PATCH] filter ordered assets by service type (#515) * filter ordered assets by service type * filter dids fetched * loader added * show loader fix Co-authored-by: claudia.holhos --- src/components/pages/History/Downloads.tsx | 68 +++++++++++++++++----- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/src/components/pages/History/Downloads.tsx b/src/components/pages/History/Downloads.tsx index c8bc25cc0..e96070551 100644 --- a/src/components/pages/History/Downloads.tsx +++ b/src/components/pages/History/Downloads.tsx @@ -2,10 +2,13 @@ import React, { ReactElement, useEffect, useState } from 'react' import Table from '../../atoms/Table' import { gql, useQuery } from '@apollo/client' import Time from '../../atoms/Time' -import { OrdersData_tokenOrders as OrdersDataTokenOrders } from '../../../@types/apollo/OrdersData' import web3 from 'web3' import AssetTitle from '../../molecules/AssetListTitle' import { useWeb3 } from '../../../providers/Web3' +import axios from 'axios' +import { useOcean } from '../../../providers/Ocean' +import { retrieveDDO } from '../../../utils/aquarius' +import { Logger } from '@oceanprotocol/lib' const getTokenOrders = gql` query OrdersData($user: String!) { @@ -24,26 +27,28 @@ const getTokenOrders = gql` } ` +interface DownloadedAssets { + did: string + dtSymbol: string + timestamp: string +} + const columns = [ { name: 'Data Set', - selector: function getAssetRow(row: OrdersDataTokenOrders) { - const did = web3.utils - .toChecksumAddress(row.datatokenId.address) - .replace('0x', 'did:op:') - - return + selector: function getAssetRow(row: DownloadedAssets) { + return } }, { name: 'Datatoken', - selector: function getTitleRow(row: OrdersDataTokenOrders) { - return row.datatokenId.symbol + selector: function getTitleRow(row: DownloadedAssets) { + return row.dtSymbol } }, { name: 'Time', - selector: function getTimeRow(row: OrdersDataTokenOrders) { + selector: function getTimeRow(row: DownloadedAssets) { return