-
Notifications
You must be signed in to change notification settings - Fork 9
Conversation
2da3f7c
to
164bfc2
Compare
|
I would like to clarify some doubts @alfetopito:
|
How did you place the orders? I believe your issue is that you are placing orders against PROD backend endpoint and trying to fetch them against STAGING (dev) backend endpoint. There are settings in both CowSwap and the Explorer to synchronize the environments used.
There are a few ways to solve this:
Yep. Although the filters implemented might not all be relevant for our frontend filters https://protocol-rinkeby.dev.gnosisdev.com/api/#/default/get_api_v1_orders
Correct. When network is null there's no data to show anyway. |
@alfetopito The problem I had with the API is that I need to extend the back date. Also when when I was testing in Swagger-Rinkeby this was using was mainnet. I would like to know, when you mentioned:
|
Well, I was sure I used this before, but it seems I mistook /orders with /trades endpoint. Also, set all boolean fields to We want to show everything on the explorer.
You can switch on top which endpoint you are calling. You can access all of them from the same page. I know, weird.
I've answered this on the top above. Set all flags to true and start with
Yes, that makes a lot of sense. It'll be very handy as well for @stackseeder since trades have even less context and need the respective orders in order to build the full row of data. The tokens are already stored on global state (once loaded). Orders and trades are not because it only makes sense to do so if viewing the user details page so your idea of a context is great for the user details page. |
Hey @henrypalacios , @alfetopito , I have an endless table for my Rinkeby account with lines overlapping the table header, that is why I raised this issue |
I know, that this PR is WIP, but I would like to add a suggestion
|
We agreed to not have search, filtering and pagination on the first version.
Hmm, I do not see any orders when I open this link :/ |
Orders are supposed to come directly from the API sorted by creation date descending. Agree this should be improved. But I think we can do it all at once, similar to what's been done on CowSwap.
👍
👍
Not a big deal to me right now. Maybe we could replace the text with 'copied' depending on the screen size.
Yes, but not on the first version. |
I was not able to open this page yesterday, today I see orders again. So here is the video: https://drive.google.com/file/d/1VpDeAdbZHNziW-xyqKNVEGiTwgL37jP2/view Btw, looks a bit weird when order list flashing when a user's order info is updated. |
I have created separate tasks for cases:
|
you're right, I had problems with this, I thought it was my changes, but then I realized that something had changed in the API.
I'm working on it 😅 , I just wanted to make sure the table is updated. And thank you for your other remarks. |
src/apps/explorer/const.ts
Outdated
@@ -2,6 +2,8 @@ import { AnalyticsDimension } from 'types' | |||
|
|||
/** Explorer app constants */ | |||
export const ORDER_QUERY_INTERVAL = 10000 // in ms | |||
export const ORDERS_QUERY_INTERVAL = 10000 // in ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had agreed on 30min but I have set it to 10min to test.
74fb547
to
ea58455
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/apps/explorer/components/OrdersTableWidget/context/OrdersTableContext.tsx
Outdated
Show resolved
Hide resolved
try { | ||
const ordersFetched = await getOrders({ networkId: network, owner, minValidTo: minTimeHistoryTimeStamp }) | ||
const newErc20Addresses = ordersFetched.reduce((accumulator: string[], element) => { | ||
const updateAccumulator = (tokenAddress: string): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using a Set (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) for this?
const newErc20Address = new Set<string>()
ordersFetched.forEach(order => {
newErc20Address.add(order.buyToken)
newErc20Address.add(order.sellToken)
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the Set, it would be much more readable however but I went for the reduce
for performance.
Do you think it makes up for it or should I go for the Set
? https://jsben.ch/ognIg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/apps/explorer/components/OrdersTableWidget/useGetOrders.tsx
Outdated
Show resolved
Hide resolved
src/apps/explorer/components/OrdersTableWidget/useGetOrders.tsx
Outdated
Show resolved
Hide resolved
Hey @henrypalacios , great pr! Btw, can we change 'Canceled' status to 'Cancelled' to match Cowswap app? Also, can we add validation to URL on address format? However, I'm not sure about it.. |
Hey @henrypalacios , changes you implemented look great! Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! Working great!
@elena-zh hover has been removed in the row when there are not orders. @alongoni has suggested using the same size of the table when reloading so it doesn't look strange. @alfetopito I have set the interval back to 30sec. I also think something is going wrong in the evaluation of the test coverage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I force merged it. |
Hey @henrypalacios , great! Just curious: why do I always see these 404 errors in the console? In addition, please, don't kill me.. But still I see blinking table when it is updating each 30 seconds (see from 19 sec ) A bit strange to see this scroll in the empty table. It is also displayed when a table has orders, but it is more logical to show it there, but not in the empty table.. |
Closes gnosis/cowswap#1046
Load orders from a wallet address.
🗒️ Summary:
To Test