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 Submit Boundary #195

Merged
merged 3 commits into from
Nov 11, 2022
Merged

Conversation

mstone121
Copy link
Contributor

@mstone121 mstone121 commented Nov 10, 2022

Overview

There are two issues with the Submit Boundary feature:

  1. API request to submit is broken. This is due to invalid timezone strings.
  2. The "After Submit" modal isn't showing up. This is because it was moved to the draft tools which don't render when a submission is in "Submitted" state.

To Solve:

  1. Use django's timezone.now(). See https://docs.djangoproject.com/en/3.2/topics/i18n/timezones/#naive-and-aware-datetime-objects. The seemed like a good idea to do everywhere so it's been replaced everywhere.
  2. Move the "After Submit" modal to the parent, DrawTools component and render it only when in "Submitted" state. Still tie into the submit onSuccess so it doesn't show up on subsequent visits to the page.

Closes #193

Testing Instructions

  • ./scripts/resetdb
  • Log in as contributor
  • Go to a "Draft" or a submission that "Needs Revisions"
  • Make changes and submit
    • Ensure "After Submit" dialog shows up
  • Revisit submission page
    • Ensure "After Submit" dialog is not visible
    • Ensure submission was saved successfully

Checklist

  • fixup! commits have been squashed
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines
  • README.md updated if necessary to reflect the changes
  • CI passes after rebase

Matt Stone added 2 commits November 10, 2022 15:51
Since USE_TZ=True, django can create timezone aware dates that take
into account the TIME_ZONE setting.
DraftTools render only in the draft state. Submitting the boundary
causes the status to become Submitted, so that's when this modal needs
to render.
@rajadain rajadain self-requested a review November 11, 2022 00:30
@rajadain rajadain self-assigned this Nov 11, 2022
@rajadain
Copy link
Contributor

Taking a look

Copy link
Contributor

@rajadain rajadain left a comment

Choose a reason for hiding this comment

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

+1 tested, working correctly! Nice follow up fix too.

@rajadain rajadain assigned mstone121 and unassigned rajadain Nov 11, 2022
@mstone121 mstone121 merged commit 8fce993 into develop Nov 11, 2022
@mstone121 mstone121 deleted the ms/use-django-utils-timezone-for-dates branch November 11, 2022 15:46
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.

Cannot Resubmit Boundaries
2 participants