From 654f9231b5171f60346139bc85048b1eafbe0d16 Mon Sep 17 00:00:00 2001 From: dandds Date: Mon, 13 Aug 2018 10:11:07 -0400 Subject: [PATCH 1/3] show modal for requests pending CCPO approval --- atst/routes/requests/requests_form.py | 2 +- js/index.js | 1 + .../pending_ccpo_approval_alert.html | 11 ++++++ .../pending_ccpo_approval_modal.html | 35 +++++++++++++++++++ templates/requests.html | 9 +++++ 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 templates/fragments/pending_ccpo_approval_alert.html create mode 100644 templates/fragments/pending_ccpo_approval_modal.html diff --git a/atst/routes/requests/requests_form.py b/atst/routes/requests/requests_form.py index ca474d61..a8c2798f 100644 --- a/atst/routes/requests/requests_form.py +++ b/atst/routes/requests/requests_form.py @@ -104,7 +104,7 @@ def requests_submit(request_id=None): return redirect("/requests?modal=pendingFinancialVerification") else: - return redirect("/requests") + return redirect("/requests?modal=pendingCCPOApproval") # TODO: generalize this, along with other authorizations, into a policy-pattern diff --git a/js/index.js b/js/index.js index 07da8d42..b13d1a6a 100644 --- a/js/index.js +++ b/js/index.js @@ -21,6 +21,7 @@ const app = new Vue({ modals: { styleguideModal: false, pendingFinancialVerification: false, + pendingCCPOApproval: false, } } }, diff --git a/templates/fragments/pending_ccpo_approval_alert.html b/templates/fragments/pending_ccpo_approval_alert.html new file mode 100644 index 00000000..1d2e9255 --- /dev/null +++ b/templates/fragments/pending_ccpo_approval_alert.html @@ -0,0 +1,11 @@ +

+ We will review and respond to your request in 72 hours. You’ll be notified via email or phone. +

+ +

+ While your request is being reviewed, your next step is to create a Task Order associated with JEDI Cloud. Please contact a Contracting Officer (KO), Contracting Officer Representative (COR), or a Financial Manager to help with this step. +

+ +

+ Learn more about the JEDI Task Order and the Financial Verification process. +

diff --git a/templates/fragments/pending_ccpo_approval_modal.html b/templates/fragments/pending_ccpo_approval_modal.html new file mode 100644 index 00000000..68a48c2d --- /dev/null +++ b/templates/fragments/pending_ccpo_approval_modal.html @@ -0,0 +1,35 @@ +

+ Request submitted. Approval pending. +

+ +

+ We will review and respond to your request in 72 hours. You’ll be notified via email or phone. +

+ +

+ Your request is being reviewed because: +

+

+ +

+ Next Steps +

+ +

+ While your request is being reviewed, your next step is to create a Task Order associated with JEDI Cloud. Please contact a Contracting Officer (KO), Contracting Officer Representative (COR), or a Financial Manager to help with this step. +

+ +

+ Once the Task Order has been created, you will be asked to provide details about the task order in the Financial Verification step. +

+ +

+ Learn more about the JEDI Task Order and the Financial Verification process. +

diff --git a/templates/requests.html b/templates/requests.html index df6999ca..6b1e36f0 100644 --- a/templates/requests.html +++ b/templates/requests.html @@ -16,6 +16,15 @@ {% endcall %} + {% call Modal(name='pendingCCPOApproval', dismissable=True) %} + + {% include 'fragments/pending_ccpo_approval_modal.html' %} + +
+ Close +
+ {% endcall %} + {% if not requests %} {{ EmptyState( From 37bb0c5d303769a13cb6189001872bb92d16aea4 Mon Sep 17 00:00:00 2001 From: dandds Date: Mon, 13 Aug 2018 10:22:35 -0400 Subject: [PATCH 2/3] display alert on requests index page when requests are pending CCPO approval --- atst/routes/requests/index.py | 23 ++++++++++++++++++----- templates/requests.html | 6 ++++++ tests/routes/test_request_submit.py | 4 ++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/atst/routes/requests/index.py b/atst/routes/requests/index.py index f756836f..57e7e63a 100644 --- a/atst/routes/requests/index.py +++ b/atst/routes/requests/index.py @@ -9,8 +9,10 @@ def map_request(request): time_created = pendulum.instance(request.time_created) is_new = time_created.add(days=1) > pendulum.now() app_count = request.body.get("details_of_use", {}).get("num_software_systems", 0) - update_url = url_for('requests.requests_form_update', screen=1, request_id=request.id) - verify_url = url_for('requests.financial_verification', request_id=request.id) + update_url = url_for( + "requests.requests_form_update", screen=1, request_id=request.id + ) + verify_url = url_for("requests.financial_verification", request_id=request.id) return { "order_id": request.id, @@ -19,7 +21,9 @@ def map_request(request): "app_count": app_count, "date": time_created.format("M/DD/YYYY"), "full_name": request.creator.full_name, - "edit_link": verify_url if Requests.is_pending_financial_verification(request) else update_url + "edit_link": verify_url if Requests.is_pending_financial_verification( + request + ) else update_url, } @@ -33,6 +37,15 @@ def requests_index(): mapped_requests = [map_request(r) for r in requests] - pending_fv = any(Requests.is_pending_financial_verification(r) for r in requests) + pending_fv_count = [ + True for r in requests if Requests.is_pending_financial_verification(r) + ] + pending_fv = len(pending_fv_count) > 1 + pending_ccpo = len(pending_fv_count) != len(mapped_requests) - return render_template("requests.html", requests=mapped_requests, pending_financial_verification=pending_fv) + return render_template( + "requests.html", + requests=mapped_requests, + pending_financial_verification=pending_fv, + pending_ccpo_approval=pending_ccpo, + ) diff --git a/templates/requests.html b/templates/requests.html index 6b1e36f0..4f8c5cc1 100644 --- a/templates/requests.html +++ b/templates/requests.html @@ -42,6 +42,12 @@ {% endif %} + {% if pending_ccpo_approval %} + + {{ Alert('Request submitted. Approval pending.', fragment="fragments/pending_ccpo_approval_alert.html") }} + + {% endif %} +