Skip to content

Conversation

samobermiller
Copy link
Collaborator

@samobermiller samobermiller commented Aug 21, 2025

this PR closes issue #1721. NOTE: to be merged in alongside PR #[tbd] that will enable drop down menu for status changes

Currently, a submission can continue to be edited after hitting the Submit button and there is no functionality to the UpdatesRequired submission status.

Updates:

  • Edits are now only allowed if a submission's status is InProgress or UpdatesRequired
    • This means you can no longer edit a submission after hitting the Submit button (when the status is SubmittedPendingReview)
    • This is communicated by a banner at the top of each page (superseding all other banners) saying edits aren't permitted due to status
  • Submissions are view-only if status is anything other than InProgress or UpdatesRequired
    • Resume button now says View with an eye symbol
  • If a submission's status is UpdatesRequired and edits are made, the status becomes InProgress again
    • Montana will manually assign a status of UpdatesRequired after review via a yet to be implemented drop down
  • Github issues are now only created if there is no other issue in the repo with the same submission id. If there is an existing issue, a comment is added saying it was resubmitted on x date and the issue is reopened if closed (test created in test_submission.py)
  • Restrict edits via API based on submission status (test created in test_submission.py)

Note: status does not change from 'InProgress' to 'UpdatesRequired' if admin makes edits, this is intentional

@samobermiller samobermiller linked an issue Aug 21, 2025 that may be closed by this pull request
@samobermiller samobermiller self-assigned this Aug 22, 2025
@samobermiller samobermiller changed the title 1721 add functionality to UpdatesRequired submission status 1721 restrict editing to certain submission statuses Aug 22, 2025
@samobermiller samobermiller marked this pull request as ready for review August 22, 2025 17:04
Copy link
Collaborator

@naglepuff naglepuff left a comment

Choose a reason for hiding this comment

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

Looks good! I was not able to do any functional testing for the github endpoint, but tests of the submission portal components looked good. I had a few minor code comments is all.

Copy link
Collaborator

@pkalita-lbl pkalita-lbl left a comment

Choose a reason for hiding this comment

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

Changes look good overall.

As I was testing I noticed that I wasn't seeing the status automatically change from UpdatesRequired to InProgress. I could see that the InProgress status was part of the PATCH /api/metadata_submission/{id} request, but the response still had UpdatesRequired in it. I think the source of that bug is in the update_submission route handler function gates the status change on checking if the logged-in user has role of owner on the submission. In my case I was editing someone else's submission as an admin. It's an edge case, but it might be good to clean that up now as we start making more extensive use of statuses.

Copy link
Contributor

@mslarae13 mslarae13 left a comment

Choose a reason for hiding this comment

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

lgtm from a totally non technical perspective.
The description's expected behaviors are accurate.

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.

restrict editing to certain submission statuses

4 participants