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

fix: trigger form validation on preview photo upload #2069

Merged
merged 3 commits into from
Sep 7, 2023

Conversation

flagrede
Copy link
Collaborator

@flagrede flagrede commented Sep 5, 2023

Description

Closes: regen-network/rnd-dev-team#1775

  • Allow to submit form after uploading a preview photo
  • Handle old metadata schema for regen:previewPhoto (string instead of object)

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • provided a link to the relevant issue or specification
  • provided instructions on how to test
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

How to test

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items
.

I have...

  • confirmed all author checklist items have been addressed
  • reviewed code correctness and readability
  • verified React components follow DRY principles
  • reviewed documentation is accurate
  • reviewed tests
  • manually tested (if applicable)

@netlify
Copy link

netlify bot commented Sep 5, 2023

Deploy Preview for regen-website ready!

Name Link
🔨 Latest commit 5b189a5
🔍 Latest deploy log https://app.netlify.com/sites/regen-website/deploys/64f9ec6a1d1f18000875a6c7
😎 Deploy Preview https://deploy-preview-2069--regen-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@flagrede flagrede requested a review from a team September 5, 2023 12:30
Comment on lines 25 to 33
// Handle old metadata schema
const previewPhoto = metadata?.['regen:previewPhoto'];
const isPreviewPhotoString = typeof previewPhoto === 'string';
const previewPhotoUrl = isPreviewPhotoString
? previewPhoto
: previewPhoto?.['schema:url'] ?? '';
const previewPhotoCredit = isPreviewPhotoString
? ''
: previewPhoto?.['schema:creditText'] ?? '';
Copy link
Member

Choose a reason for hiding this comment

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

I believe we should not really support that anymore. All projects on prod should have been migrated to the latest format. But that might not be the case for all projects on staging indeed. In this case, that should be updated manually from the db rather that supported from the UI.
This brings up the need again to reset staging data (both db and redwood testnet).

Copy link
Member

Choose a reason for hiding this comment

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

Opened an issue for further discussion: regen-network/rnd-dev-team#1784

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can remove that logic then but yes that's the case for most of our projects on staging.

@flagrede flagrede requested a review from blushi September 6, 2023 12:54
@flagrede flagrede force-pushed the fix-1775-submit-media-form branch from 1675b07 to e86d97c Compare September 7, 2023 10:29
@flagrede flagrede force-pushed the fix-1775-submit-media-form branch from e86d97c to 5b189a5 Compare September 7, 2023 15:29
@flagrede flagrede merged commit bb2faff into dev Sep 7, 2023
@flagrede flagrede deleted the fix-1775-submit-media-form branch September 7, 2023 15:58
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.

Submit issue with media form
3 participants