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

Simplify metadata logic #559

Merged
merged 5 commits into from
Jul 18, 2023
Merged

Simplify metadata logic #559

merged 5 commits into from
Jul 18, 2023

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Jul 18, 2023

Summary

Related to cowprotocol/app-data#32

Since i was working on the app-data, and did some simplifications on the library, i took this chance to remove some weird logic from the DOC generation.

This code is still messy, but at least it should work more automatically out of the box when we add new meta-data.

This PRs adds the UTM codes, order class, and all the missing types:

TLDR

Turns this
image

Into this:

image

DEMO

Screen.Recording.2023-07-18.at.20.34.39.mov

Adds Prettied + Actual FullAppData + AppData hex + CID

Just for completeness adds all of that, and give some context on what is each.

It tried to be interactive, so you experiment to change some fields

Dinamic

Also makes it dynamic (you don't need to send the form, it will update automatically)

This way, you see right away how changing some parameters affects the result

Improved validation

I suppressed some annoying "required" errors you get because of the metadata and how this library work.

Removing the annoying "enable field"

It was super bad UX to enable fields in order to use them.

Also, because this was done programmatically, it was making it hard to add new metadata. You will need to handle the logic of enabling those too.

Test

Compare this PR and PRO:

@vercel
Copy link

vercel bot commented Jul 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
explorer-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2023 8:17pm

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Pull Request Test Coverage Report for Build 5591965705

  • 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 61.69%

Totals Coverage Status
Change from base Build 5590351315: 0.0%
Covered Lines: 877
Relevant Lines: 1236

💛 - Coveralls

@anxolin
Copy link
Contributor Author

anxolin commented Jul 18, 2023

@shoom3301 @elena-zh I will merge this optimistically, I hope it's not too bad.

_toFullAppData(appDataForm)
.then((fullAppData) => {
// Update the fullAppData
setFullAppData(fullAppData)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we do _toFullAppData(appDataForm).then(setFullAppData) twice?

Comment on lines +258 to +259
<RowWithCopyButton className="appData-hash" textToCopy={fullAppData} contentsToDisplay={fullAppData} />
<p className="disclaimer">Note: Don’t forget to upload this file to IPFS!</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not a requirement anymore when it's submitted to backend, right?

</a>{' '}
</p>
<p>
What this means is that you can derived the IPFS CID from on-chain CoW Orders, and download the JSON
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo: derive

</p>
<p>
What this means is that you can derived the IPFS CID from on-chain CoW Orders, and download the JSON
from IPFS network to see the meta-information of that order
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, the backend now hosts and serves this info.
Should that be mentioned here?

@nenadV91 nenadV91 mentioned this pull request Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants