[Ellipsis] Prevent responses in form fill page #70
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: #68
Plan feedback: Approved by @hbrooks
Implementation:
CreateFormInner
function in the/src/pages/forms/fill/[id].tsx
file, add a check after the form is fetched from the database. If the form'sis_open
property isfalse
, set a new state variableisFormOpen
tofalse
. This state variable will be used to conditionally render the form or a message indicating that the form is closed./src/components
directory. This component will be displayed when a form is closed. It should contain a message that says 'This form is no longer accepting responses. If you believe this is an error, contact the form author.' and a button that redirects to 'https://talkform.ai/'.CreateFormInner
function in the/src/pages/forms/fill/[id].tsx
file, use theisFormOpen
state variable to conditionally render the form or the new component for closed forms. IfisFormOpen
isfalse
, render the new component. Otherwise, render the form as usual.Report:
Add a check for form open status
Unable to fetch the file '/src/pages/forms/fill/[id].tsx' from the repository.Create a new component for closed forms
Created a new React component 'ClosedFormMessage' in the '/src/components' directory. This component will be displayed when a form is closed. It contains a message that says 'This form is no longer accepting responses. If you believe this is an error, contact the form author.' and a button that redirects to 'https://talkform.ai/'.Render the new component conditionally
Unable to fetch the file '/src/pages/forms/fill/[id].tsx' from the repository.Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #68. Then, add the
ellipsis:create
label to try again. For more information, check the documentation.Generated with ❤️ by ellipsis.dev