Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update metadata, the proper way #292

Merged
merged 29 commits into from
Dec 10, 2020
Merged

Update metadata, the proper way #292

merged 29 commits into from
Dec 10, 2020

Conversation

kremalicious
Copy link
Contributor

@kremalicious kremalicious commented Dec 4, 2020

  • closes Edit metadata in UI #237
  • replaces interim solution, closes quick update metadata page #242
  • touching Asset edit history #282
  • new owner actions UI, and edit flow on the respective asset details view
  • new components shared among publish and edit flows: DebugOutput, MetadataPreview, MetadataFeedback
  • switch to ddo.created for showing publish date, and ddo.updated for update date, both of which are set based on block timestamp together with use block timestamp aquarius#330
  • reduce passing of ddo and other props to components, replace with useAsset() hook calls
  • remove lots of useMetadata() calls made redundant by useAsset()
  • metadata preview tweaks: deprioritize author, show datatoken values
  • visual tweaks to metadata output

UI changes

New owner actions row only visible to data set owner:

Screen Shot 2020-12-07 at 18 10 23

Clicking it opens the data set edit view:

Screen Shot 2020-12-08 at 22 51 24

Loading view:

Screen Shot 2020-12-07 at 17 06 10

Success View:

Screen Shot 2020-12-09 at 13 11 33

When data set was updated, will be shown in the moved date output, and all dates show the exact time when hovered:

Screen Shot 2020-12-07 at 17 03 51

Also includes the new metadata history component, but it can't be shipped until #288 and oceanprotocol/aquarius#324 are finalized. Tracked in #282:

Screen Shot 2020-12-09 at 13 13 02

@vercel
Copy link

vercel bot commented Dec 4, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/oceanprotocol/market/hj553jhnt
✅ Preview: https://market-git-feature-metadata-update.oceanprotocol.now.sh

* output created & updated date at top of asset
* use ddo.created & ddo.updated everywhere
* stop pushing metadata.main.datePublished
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
@mihaisc
Copy link
Contributor

mihaisc commented Dec 9, 2020

Title can be updated to blank space
image

@mihaisc
Copy link
Contributor

mihaisc commented Dec 9, 2020

Title seems to not have max limit, might be an issue in publish too.
https://market-2pcgzh971.vercel.app/asset/did:op:C81EAEab66cDD2edb1d19607d6A902F576a5eF5C ( on rinkeby)

@mihaisc
Copy link
Contributor

mihaisc commented Dec 9, 2020

Same blank space works for description too
image

@mihaisc
Copy link
Contributor

mihaisc commented Dec 9, 2020

Still an issue with the file validation
image

@mihaisc
Copy link
Contributor

mihaisc commented Dec 9, 2020

Published a data set with all blanks, including tags,
https://market-2pcgzh971.vercel.app/asset/did:op:25Caf45fE360f8b9133fc8341b2142838d3fbdc1

image

@kremalicious
Copy link
Contributor Author

kremalicious commented Dec 9, 2020

solved most empty space issues by introducing minimum character lengths for title & description in publish & edit forms. All other validation issues are caused by Formik/Yup not validating on each onChange event, despite this being the default: https://formik.org/docs/api/formik#validateonchange-boolean

So I think somewhere in our chain of Input component calls these handlers get removed somewhere

* manually trigger onChange validation in publish & edit forms
@kremalicious
Copy link
Contributor Author

kremalicious commented Dec 10, 2020

hacked in semi-manual live-validation to fix most weirdnesses around that. The file input behaves so weird cause the blur event of the input fires (which correctly triggers validation) just before the mousedown event of the button fires when user clicks it. Which is why I only could make the Required disappear after like 300ms, but it's not shown anymore for the full loading time.

Definitely all needs to be revisited in case we add more forms but for now should be good enough.

@kremalicious
Copy link
Contributor Author

As for limiting the title, I would not go there cause it can be problematic. Not technically, but from user perspective where there can be many reasons to have a longer title and the problem then only lies in the UI. So we should deal with long titles somehow, like cutting them off on the asset teasers, but on asset details show them in full, ideally with some variable font size the longer it gets or something

@kremalicious kremalicious merged commit 960c5b3 into main Dec 10, 2020
@kremalicious kremalicious deleted the feature/metadata-update branch December 10, 2020 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit metadata in UI
2 participants