Skip to content

Conversation

jjijon7000
Copy link
Contributor

fixes #419

Description:

Resubmit button so that something that should have pushed to banner can be hit so that it goes into Banner.
This button should only be for admins and it should be on approved forms.

Changes:

  • added a button to the studenthistorymodal html, added the ajax in the laborhistory js file, and added the route in allpendingforms.py
  • fixed sub-issue of the forever loading icon gif

Testing:

Before
image
^was stuck like this forever basically

After
image

  • run flask
  • reset the database to from-backup instead of test
  • select a term and search
  • select a student
  • click on any of their approved forms and see the changes

@PuskarC
Copy link

PuskarC commented Jul 3, 2025

lsf

The current implementation causes the Supervisor Portal page to load without displaying any data or interactive elements. Also, the page appears unresponsive as no results are shown under the "Form Search" section

@admin.route('/admin/addToBanner/<form_id>', methods=['POST'])


def submitToBanner(form_id):
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a function that submits to banner, right? It happens whenever a form is approved by admins. We shouldn't be re-inventing that solution.

else:
return jsonify({"success": False}), 500
else:
return jsonify({"success": False})
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use success: True and False. Use the status codes to determine success or not.

I suspect you also need a try/except around the banner save attempt, but really you should be re-using the code that already does this.


@admin.route('/admin/addToBanner/<form_id>', methods=['POST'])


Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the space between the route and the method, please

@@ -213,6 +213,7 @@
<div class = "col-sm-{{12/buttonState.num_buttons}}">

<a href="#"><button class="btn btn-primary" id="emailLabor">Email Labor</button></a>
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="submitToBanner({{statusForm.laborStatusFormID}})">Resubmit Form</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you see how all of the other buttons use the buttonState object to determine if the button should display? This is necessary because it doesn't make sense to have a Resubmit button on every form, and certainly not for every user. Students should not be able to submit their forms to banner, for example.

Copy link
Contributor

Choose a reason for hiding this comment

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

Has not been resolved yet

@BrianRamsay
Copy link
Contributor

Button state changes were never addressed. Re-implemented in commit 87211c2.

@BrianRamsay BrianRamsay deleted the resubmit-btn419 branch August 18, 2025 20:25
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.

Create a Banner resubmit button
3 participants