Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

[Explorer] Add Metadata page #168

Merged
merged 59 commits into from
Aug 18, 2022
Merged

[Explorer] Add Metadata page #168

merged 59 commits into from
Aug 18, 2022

Conversation

matextrem
Copy link
Contributor

Summary

Closes #160

Added a new Metadata page where you can create a new app data document and also upload it to IPFS

Screen Shot 2022-07-20 at 17 43 34

To Test

  1. Open the page metadata
  • You can complete the form and then hit GENERATE METADATA DOC button
  • After the app data generation, you can also upload it to IPF by clicking UPLOAD APP DATA TO IPFS button

@matextrem matextrem added the Enhancement New feature or request label Jul 20, 2022
@matextrem matextrem added this to the 2.11.0 milestone Jul 20, 2022
@matextrem matextrem self-assigned this Jul 20, 2022
@coveralls
Copy link

coveralls commented Jul 20, 2022

Pull Request Test Coverage Report for Build 2883630218

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 43.824%

Totals Coverage Status
Change from base Build 2882905680: 0.0%
Covered Lines: 2158
Relevant Lines: 4174

💛 - Coveralls

@socket-security
Copy link

socket-security bot commented Jul 20, 2022

Socket Security Report

👍 No new dependency issues detected in pull request

Socket.dev scan summary
Issue Status
Did you mean? ✅ no new possible package typos
Install scripts ✅ no new install scripts
Telemetry ✅ no new telemetry
Troll package ✅ no new troll packages
Malware ✅ no new malware
Native code ✅ no new native modules

Powered by socket.dev

@matextrem
Copy link
Contributor Author

@ramirotw could you try build the lock.file and push it ? I'm trying to do it locally but it's failing on my side.

src/components/orders/DetailsTable/index.tsx Outdated Show resolved Hide resolved
src/apps/explorer/pages/Metadata/config.ts Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
@github-actions
Copy link

@elena-zh
Copy link

Hey, this is my early review of the PR.
I know, that UI has not been implemented yet, but anyways I will leave here some my proposals. Maybe they might be useful:

  1. I think it would be nice to add hints as tooltips near a field's label
    image
  2. As for environments hint, we could add 'pr' to the list, as it is also used in Cowswap app for appdata
    pr
  3. I think it would be great to show errors in red. Besides, I think it is better to validate fields on FE side first. WDYT?
    image
  4. Nice to adjust the page to look better in a mobile view

And here is the list of issues that can be fixed before the UI part:

  1. Based on the issue description, a user can check the Quote or Refferrer section: Then, for the metadata, user can pick any of the choices of referrer and quote. Maybe a checkbox to enable them? Currently, both sections are enabled.

  2. Quote version field name is incorrect (shows 'quote' instead of the 'version'. The field should be mandatory and show the latest version (read-only)
    field name

  3. Address field should be marked as mandatory field when Referrer section is selected
    image

  4. There is no validation on the address field when I use upper or lower-case letters. I'm not sure, however, if it is needed. But I have to notice that this validation exists in Explorer when search for a user details

  5. Again, I'm not sure if it is an issue, but the fields have a different order in 'referrer' section in a metadata info
    change places

  6. Slippage Bips field should be marked as a mandatory one (when the section is selected)

  7. I think we should make a user aware of errors when there is something wrong with uploading data to IPFS (show an error banner somehow).
    error somehow

  8. The same with a success notification (show 'successfully uploaded' message/banner or so)

Thanks

@ramirotw
Copy link
Contributor

It would be helpful to add a description field on the form using the description prop from the schema:

image

@matextrem matextrem marked this pull request as ready for review July 22, 2022 21:30
@elena-zh
Copy link

elena-zh commented Aug 8, 2022

Hey @matextrem , @alongoni changes LGTM!

Still, I see that the issue with periods in the end of sentences is not fixed (will be addressed in cowprotocol/app-data#10 a bit later).
image

image

And there is no path to the page, but will be implemented soon.

Also I have found #175 issue that @ramirotw can take a look into a bit later.

So I'm approving the current PR.

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I'm happy with the behaviour and looks good for merging.

Doesn't mean there isn't more stuff to address :)
I'll write it down in more details tomorrow, when I'll also finish the code review.

@@ -132,6 +140,7 @@ const AppContent = (): JSX.Element => {
<Route path={pathPrefix + '/address/:address'} exact component={UserDetails} />
<Route path={pathPrefix + '/tx/:txHash'} exact component={TransactionDetails} />
<Route path={pathPrefix + '/search/:searchString?'} exact component={SearchNotFound} />
<Route path={pathPrefix + '/metadata'} exact component={AppDataDetails} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Route path={pathPrefix + '/metadata'} exact component={AppDataDetails} />
<Route path={pathPrefix + '/appdata'} exact component={AppDataDetails} />

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nitpicks regarding the code but nothing major.
All of them can be addressed in follow up PRs.

I'm happy merging as is and iterate.

As I mentioned today, this page will be hidden until the new menu is ready, so it's fine to be merged even if some things still need to be adjusted.

I also mentioned to the team some more information to be displayed in each of the new types to give more context to users.

src/apps/explorer/pages/AppData/FormPage.tsx Outdated Show resolved Hide resolved
src/apps/explorer/pages/AppData/FormPage.tsx Outdated Show resolved Hide resolved
src/apps/explorer/pages/AppData/FormPage.tsx Outdated Show resolved Hide resolved
src/apps/explorer/pages/AppData/FormPage.tsx Outdated Show resolved Hide resolved
src/apps/explorer/pages/AppData/config.tsx Show resolved Hide resolved
src/apps/explorer/pages/AppData/config.tsx Show resolved Hide resolved
src/apps/explorer/pages/AppData/index.tsx Outdated Show resolved Hide resolved
@matextrem
Copy link
Contributor Author

@alfetopito fixed!

Cc: @elena-zh

@elena-zh
Copy link

elena-zh commented Aug 18, 2022

Hey @matextrem , could toy please describe what exactly I need to retest except changing the page path to /appdata and changing the tab name to 'Encode'?

src/const.ts Outdated
acc[networkId] = new CowSdk(networkId, {
isDevEnvironment: true,
})
acc[networkId] = new CowSdk(networkId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for changing this?

I haven't checked it throughly, but I suspect it might be the cause of duplicated orders, like seen in this batch

I would avoid touching this if possible and leave that up to Ramiro's/mine PR which is adding Goerli support and also updating the SDK that does this
Screen Shot 2022-08-18 at 11 29 38

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this broke when I merged from develop. Will fix this

@matextrem
Copy link
Contributor Author

Hey @matextrem , could toy please describe what exactly I need to retest except changing the page path to /appdata and changing the tab name to 'Encode'?

@elena-zh I made some changes in the logic for the encode tab, so maybe we could test it again to see nothing is broken

@elena-zh
Copy link

Seems like works as expected.
Anyways, I will completely retest this page when it is going to be released.
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a new page to create a valid App Data document
7 participants