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

fix: draft access publicly, invalid Petition ID and Petition Not Found Issues + Enhanced 404 page #104

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

monzim
Copy link

@monzim monzim commented Sep 14, 2024

This PR resolves two key issues related to petition handling and improves the overall error experience in the application. The fixes include handling invalid petition IDs and missing petitions more gracefully, as well as introducing a new error component for better user feedback.

Issue Resolved: #83 and #65

Changes:

  • Saved draft petitions are accessible by public fixed

  • Petition ID Validation Fixed:
    Fixed the issue where entering a string instead of a number as the petition ID would break the app. Now, invalid IDs are properly handled, and the user sees an appropriate error.

  • Petition Not Found Handling:
    Improved the handling of cases where the petition ID is valid but does not exist in the database. Users now see a proper 404 error instead of a generic failure.

Jonogon _ ____

  • New Reusable Error Component (ErrorGui):
    Added a reusable ErrorGui component that centralizes error display logic. This component is now used across the app, making it easier to maintain and standardizing the error messages.

Jonogon _ ____ · 4 16pm · 09-14

  • Refactor NotFound Component:
    Updated the NotFound component to leverage the new ErrorGui for displaying 404 errors, keeping things consistent.

  • Update the PetitionActionButton

Screenshots:

  • imag1.png: Shows the old broken state when a string was used as a petition ID.
  • image1.png: Displays the new error component for the 404 page.

This PR improves error handling and enhances the user experience when dealing with invalid or missing petitions.

…he error page and component.

- Petition Id invalid issue fixed
- Petition Not found issue fixed
- custom error screen and component added
- Update NotFound component to use ErrorGui component for displaying 404 error.
- Remove unnecessary code and improve code readability.
Enhance error page and component. Also update the next/navigation import in _page.tsx to include notFound.

Add new files for error and not found pages in the petitions/[id] directory.

Update ErrorGui component to remove unused imports and replace the AlertTriangle icon with FaceFrownIcon for the 404 error page.
@monzim monzim changed the title fix invalid Petition ID and Petition Not Found Issues + Enhanced Error Handling fix invalid Petition ID and Petition Not Found Issues + Enhanced Error Screen Sep 14, 2024
@monzim monzim changed the title fix invalid Petition ID and Petition Not Found Issues + Enhanced Error Screen fix invalid Petition ID and Petition Not Found Issues + Enhanced 404 page Sep 14, 2024
… Saved draft petitions are accessible by public jonogon#65. Also update the PetitionActionButton.
@monzim monzim changed the title fix invalid Petition ID and Petition Not Found Issues + Enhanced 404 page fixed #65 and #83 invalid Petition ID and Petition Not Found Issues + Enhanced 404 page Sep 14, 2024
@monzim monzim changed the title fixed #65 and #83 invalid Petition ID and Petition Not Found Issues + Enhanced 404 page fix: draft access publicly, invalid Petition ID and Petition Not Found Issues + Enhanced 404 page Sep 14, 2024
@errhythm
Copy link
Contributor

I was about to ask you to work on issue #65 as that's similar as well. Thanks a lot!

@omranjamal
Copy link
Contributor

Hey @monzim could you stack on a commit or two to help me merge this?

@monzim
Copy link
Author

monzim commented Oct 17, 2024

Hey @monzim could you stack on a commit or two to help me merge this?

Sure

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.

Deleted petition edit link still accessible
3 participants