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

[Ellipsis] Prevent responses in form fill page #80

Closed
wants to merge 1 commit into from

Conversation

ellipsis-dev-beta[bot]
Copy link

Summary:

Issue: #68
Plan feedback: Approved by @hbrooks

Implementation:

  1. Add a check for form open status
    • In the 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's is_open property is false, set a new state variable isFormOpen to false. This state variable will be used to conditionally render the form or a message indicating that the form is closed.
  2. Create a new component for closed forms
    • Create a new React component in the /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/'.
  3. Render the new component conditionally
    • In the CreateFormInner function in the /src/pages/forms/fill/[id].tsx file, use the isFormOpen state variable to conditionally render the form or the new component for closed forms. If isFormOpen is false, render the new component. Otherwise, render the form as usual.

Report:

Step Result Details
1
Add a check for form open statusAdded a check for form open status in the CreateFormInner function in the /src/pages/forms/fill/[id].tsx file. A new state variable isFormOpen was introduced and set to false if the form's is_open property is false. This state variable will be used to conditionally render the form or a message indicating that the form is closed.
2
Create a new component for closed formsCreated a new React component for closed forms.
3
Render the new component conditionallyUpdated the CreateFormInner function in the /src/pages/forms/fill/[id].tsx file to use the isFormOpen state variable for conditional rendering. If isFormOpen is true, the form is rendered as usual. If isFormOpen is false, a message is displayed indicating that the form is currently closed.

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

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.

1 participant