[BitBuilder] Add "Close form" functionality #48
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Issue: #47
Plan feedback: Approved by @nsbradford
Implementation:
/src/pages/forms/[id].tsx
, add a new button next to the 'View live form' button. This button should be styled similarly to the 'View live form' button. The button should be clickable only if the form is open. When clicked, it should call a function that uses the Supabase client to update theis_open
field of the form in the database tofalse
. After the form is closed, the button should appear greyed-out and unclickable./src/pages/home.tsx
, add a count of how many open and closed forms there are, next to the New Form button. This will require fetching the form data from the database and counting the number of forms whereis_open
istrue
andfalse
respectively./src/pages/forms/fill/[id].tsx
, add an error message that will be displayed if a user tries to fill a form that is closed. This will require fetching the form data from the database and checking ifis_open
isfalse
for the form. If it is, display an error message indicating that the form is closed and cannot be filled.Report:
Add 'Close form' button in Form Detail Page
Added 'Close form' button in Form Detail PageAdd form status count on Home Page
Added form status count on Home PageAdd error message for closed forms on Form Fill Page
Added error message for closed forms on Form Fill PageSomething look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #47. Then, add the
bitbuilder:create
label to try again. For more information, check the documentation.Generated with ❤️ by www.bitbuilder.ai