fix: draft access publicly, invalid Petition ID and Petition Not Found Issues + Enhanced 404 page #104
+246
−85
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.
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.
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.Refactor
NotFound
Component:Updated the
NotFound
component to leverage the newErrorGui
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.