Merge pull request #265 from dod-ccpo/all-requests-#158494566
Update CCPO requests list #158494566
This commit is contained in:
commit
5a7ca5e887
@ -65,6 +65,13 @@ def renderList(value):
|
||||
return app.jinja_env.filters["safe"]("<br>".join(value))
|
||||
|
||||
|
||||
def formattedDate(value):
|
||||
if value:
|
||||
return value.strftime("%m/%d/%Y")
|
||||
else:
|
||||
return "-"
|
||||
|
||||
|
||||
def register_filters(app):
|
||||
app.jinja_env.filters["iconSvg"] = iconSvg
|
||||
app.jinja_env.filters["dollars"] = dollars
|
||||
@ -74,3 +81,4 @@ def register_filters(app):
|
||||
app.jinja_env.filters["mixedContentToJson"] = mixedContentToJson
|
||||
app.jinja_env.filters["findFilter"] = findFilter
|
||||
app.jinja_env.filters["renderList"] = renderList
|
||||
app.jinja_env.filters["formattedDate"] = formattedDate
|
||||
|
@ -1,7 +1,6 @@
|
||||
from sqlalchemy import Column, func, ForeignKey
|
||||
from sqlalchemy.types import DateTime
|
||||
from sqlalchemy.orm import relationship
|
||||
import pendulum
|
||||
|
||||
from atst.models import Base
|
||||
from atst.models.types import Id
|
||||
@ -149,7 +148,7 @@ class Request(Base):
|
||||
|
||||
last_submission = first_or_none(_is_submission, reversed(self.status_events))
|
||||
if last_submission:
|
||||
return pendulum.instance(last_submission.time_created)
|
||||
return last_submission.time_created
|
||||
return None
|
||||
|
||||
@property
|
||||
|
@ -64,11 +64,6 @@ class RequestsIndex(object):
|
||||
"num_software_systems", 0
|
||||
)
|
||||
annual_usage = request.annual_spend
|
||||
last_submission_timestamp = (
|
||||
request.last_submission_timestamp.format("M/DD/YYYY")
|
||||
if request.last_submission_timestamp
|
||||
else "-"
|
||||
)
|
||||
|
||||
if viewing_role == "ccpo":
|
||||
edit_link = url_for("requests.approval", request_id=request.id)
|
||||
@ -91,11 +86,13 @@ class RequestsIndex(object):
|
||||
"is_new": is_new,
|
||||
"status": request.status_displayname,
|
||||
"app_count": app_count,
|
||||
"last_submission_timestamp": last_submission_timestamp,
|
||||
"last_submission_timestamp": request.last_submission_timestamp,
|
||||
"last_edited_timestamp": request.latest_revision.time_updated,
|
||||
"full_name": request.creator.full_name,
|
||||
"annual_usage": annual_usage,
|
||||
"edit_link": edit_link,
|
||||
"action_required": request.action_required_by == viewing_role,
|
||||
"dod_component": request.latest_revision.dod_component,
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
||||
<div class="row kpi">
|
||||
<div class="kpi__item col col--grow">
|
||||
<div class="kpi__item__value">{{ kpi_inprogress }}</div>
|
||||
<div class="kpi__item__description">In Progress</div>
|
||||
<div class="kpi__item__description">Requests in progress</div>
|
||||
</div>
|
||||
<div class="kpi__item col col--grow">
|
||||
<div class="kpi__item__value">{{ kpi_pending }}</div>
|
||||
@ -69,7 +69,7 @@
|
||||
</div>
|
||||
<div class="kpi__item col col--grow">
|
||||
<div class="kpi__item__value">{{ kpi_completed }}</div>
|
||||
<div class="kpi__item__description">Completed (Overall)</div>
|
||||
<div class="kpi__item__description">Approved Requests</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -105,26 +105,29 @@
|
||||
<th scope="col">JEDI Cloud Request ID</th>
|
||||
<th scope="col">Date Request Submitted</th>
|
||||
{% if extended_view %}
|
||||
<th scope="col">Date Request Last Edited</th>
|
||||
<th scope="col">Requester</th>
|
||||
<th scope="col">Reason Flagged</th>
|
||||
{% endif %}
|
||||
<th scope="col">Projected Annual Usage ($)</th>
|
||||
<th scope="col">Request Status</th>
|
||||
{% if extended_view %}
|
||||
<th scope="col">DOD Component</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in requests %}
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<a class='icon-link icon-link--large' href="{{ r['edit_link'] }}">{{ r['order_id'] }}</a>
|
||||
<a class='icon-link icon-link--large' href="{{ r.edit_link }}">{{ r.order_id }}</a>
|
||||
{% if r.action_required %}<span class="label label--info">Action Required</span>{% endif %}
|
||||
</th>
|
||||
<td>{{ r.last_submission_timestamp }}</td>
|
||||
<td>{{ r.last_submission_timestamp | formattedDate }}</td>
|
||||
{% if extended_view %}
|
||||
<td>{{ r['full_name'] }}</td>
|
||||
<td></td>
|
||||
<td>{{ r.last_edited_timestamp | formattedDate }}</td>
|
||||
<td>{{ r.full_name }}</td>
|
||||
{% endif %}
|
||||
<td>{{ r['annual_usage'] | dollars }}</td>
|
||||
<td>{{ r.annual_usage | dollars }}</td>
|
||||
<td>
|
||||
{% if r.status == 'Approved' %}
|
||||
<a href="{{ url_for('workspaces.workspace_projects', workspace_id=r.workspace_id) }}">
|
||||
@ -134,6 +137,9 @@
|
||||
{{ r.status }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if extended_view %}
|
||||
<td>{{ r.dod_component }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
Loading…
x
Reference in New Issue
Block a user