more test fixes & letter trimming

This commit is contained in:
stvnrlly
2022-11-28 11:15:41 -05:00
parent 8bd1285bfa
commit 9689aaf89b
5 changed files with 9 additions and 773 deletions

View File

@@ -355,20 +355,14 @@ def get_job_partials(job):
filter_args = parse_filter_args(request.args)
filter_args['status'] = set_status_filters(filter_args)
notifications = job.get_notifications(status=filter_args['status'])
if job.template_type == 'letter':
counts = render_template(
'partials/jobs/count-letters.html',
job=job,
)
else:
counts = render_template(
'partials/count.html',
counts=_get_job_counts(job),
status=filter_args['status'],
notifications_deleted=(
job.status == 'finished' and not notifications['notifications']
),
)
counts = render_template(
'partials/count.html',
counts=_get_job_counts(job),
status=filter_args['status'],
notifications_deleted=(
job.status == 'finished' and not notifications['notifications']
),
)
service_data_retention_days = current_service.get_days_of_retention(job.template_type)
return {

View File

@@ -1,22 +0,0 @@
{% from 'components/big-number.html' import big_number %}
<div class="govuk-grid-row bottom-gutter-2-3">
<div class="govuk-grid-column-one-half">
<div class="keyline-block">
{{ big_number(
job.notification_count,
job.notification_count|message_count_label('letter', suffix='')|capitalize,
smaller=True
)}}
</div>
</div>
<div class="govuk-grid-column-one-half">
<div class="keyline-block">
{{ big_number(
job.letter_timings.earliest_delivery|string|format_date_short,
'Estimated delivery date',
smaller=True
)}}
</div>
</div>
</div>

View File

@@ -1,31 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Letter preview</title>
<style type="text/css">
body {
background-color: #dee0e2;
margin: 0;
}
img {
display: block;
background-color: #fff;
width: 100%;
height: auto;
}
.letter-postage,
.visually-hidden {
display: none;
}
</style>
</head>
<body>
{{ template }}
</body>
</html>