question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[scaffolder] Expose formData to fields

See original GitHub issue

Right now, the complete formData isn’t accessible to field implementations.

Feature Suggestion

Expose formData to fields to allow context dependent behavior. I’ve been thinking about both defaults and validation, but if #6932 is about scaffolder, it could also be used to populate options dynamically.

Possible Implementation

Create a React context for formData and expose it to fields. Maybe even together with a setFormData entry point to change status.

Context

I would like to create repository name defaults based on metadata for the created project, and validate some constraints while still being able to adjust the name manually.

Having a setFormData could allow a field to add computed values, which could be helpful for actions. I’m also seeing a lot of opportunity for shooting yourself in the foot here, though.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Pikecommented, Sep 1, 2021

TBH, I’ve tabled this as “not part of the demo”. In the end, if we write a frontend for a scaffolder, it’ll be the same kinda work independent of scaffolder-backend or not. If a mostly-full-page field is engineering-wise and ux-wise a good option would be for another day. Surely an option to look at, though.

0reactions
stale[bot]commented, Oct 31, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expose user info for scaffold templates · Issue #5441 - GitHub
Feature Suggestion When writing scaffolder templates, it would be useful to have some basic info about the user who triggered the job ...
Read more >
Provide CRUD (Create, Read, Update, Delete) Data Form ...
Let's make a few changes to the default "edit" scaffold generated, ... (which removes a few of the properties we don't want to...
Read more >
Best practices for uploading image in multipart/form-data
When I get the list of posts, an express backend can do pre-process, eg transform image reference with a real / CDN cached...
Read more >
Using FormData Objects - Web APIs | MDN
This example builds a FormData instance containing values for fields named "username", "accountnum", "userfile" and "webmasterfile", then uses ...
Read more >
Programmatically create forms & submissions with NextJS ...
Give the model a name of Submission ,; Add a new JSON Editor field with the Display Name Form Data , and, API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found