-
Notifications
You must be signed in to change notification settings - Fork 40
Form Question Edit Component and Page to View Form #259
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
base: main
Are you sure you want to change the base?
Conversation
…t (looks pretty clean). Supports multiple question types with dynamic UI and uses Zod schemas.
…te/Time Funtionality. Got rid of old self made schema
DVidal1205
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
along with the 1 const change, could you please comment a video of the following:
- adding and modifying the form elements
- print the form contents from
page.tsx(notquestion-edit-card.tsx) in the console as u do this, include in the video
| dragHandleProps?: DraggableSyntheticListeners; | ||
| } | ||
|
|
||
| const QUESTION_TYPES: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move this to @forge/consts package. we want to store them there so they can be imported across the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gotchu
…th code to connect to createform but commented for now
…ted optional menu on card, Should check URL on banners for cryptic error prevention
Why
For the Blade Form Manager Question Editing. Built the frontend component that lets us create and edit questions, the form title and desc., and added the full drag-and-drop interface so we can reorder them like in Google Forms. It has both the question components and the actual page as a demo to show it working (and it looks cool).
What
I added the following:
The Editor Page
(apps/blade/src/app/admin/forms/test-editor/page.tsx)
QuestionEditCard Component:
(apps/blade/src/components/admin/forms/question-edit-card.tsx)
Zod Types
Added in the Zod schemas (QuestionValidator from @forge/consts) to ensure strict type safety and validation. (got rid of the old forms file I created)
Fixed the form to display the name, banner question, and description on the console.
Has autosave on clicking outside of cards, and has a URL check for Banner and answer areas that cannot be edited.
Test Plan
Ran pnpm dev:blade and tested on http://localhost:3000/admin/forms/test-editor.
Drag & Drop reordering works smoothly.
Checked that changing types, editing text, and toggling "Required" should update the state.
Adding, duplicating, and deleting questions works.
Also, the Card layout works on smaller screens.
This is what it looks like:

FormsDemo.mp4
PS: Title and desc to be changed after, and extra features on the side are to be added after as well. Also, yes the title is a Doofenshmirtz reference lol.