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 #76

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.
2
Create a new component for closed formsCreated a new React component for closed forms.
3
Render the new component conditionallyAdded conditional rendering of the form or the ClosedForm component in the CreateFormInner function in the /src/pages/forms/fill/[id].tsx file.

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

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small fixes are required.

Summary:

This PR adds a feature to prevent responses in the form fill page when the form is closed, by checking the form's open status and conditionally rendering a new ClosedForm component.

Key points:

  • Added a check for form's open status in CreateFormInner function in /src/pages/forms/fill/[id].tsx.
  • Created a new ClosedForm component in /src/components directory.
  • Conditionally rendered the ClosedForm component in CreateFormInner function when the form is closed.

Generated with ❤️ by ellipsis.dev

@ellipsis-dev ellipsis-dev deleted a comment from ellipsis-dev bot Jan 22, 2024
@ellipsis-dev ellipsis-dev deleted a comment from ellipsis-dev bot Jan 22, 2024
@ellipsis-dev ellipsis-dev deleted a comment from ellipsis-dev bot Jan 22, 2024
@hbrooks hbrooks closed this Jan 22, 2024
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