From 2454a6e94bf1334e2d53a82ded7505587cd40f2a Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Mon, 15 Apr 2024 10:38:27 -0600
Subject: [PATCH 1/9] poetry lock
---
poetry.lock | 1 -
1 file changed, 1 deletion(-)
diff --git a/poetry.lock b/poetry.lock
index 21064bf51..4e46a0a61 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1516,7 +1516,6 @@ files = [
{file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"},
{file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"},
{file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"},
- {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"},
{file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"},
]
From 98f12980add604fb9cddb20e4a12d060c1368f3b Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Mon, 22 Apr 2024 10:48:46 -0600
Subject: [PATCH 2/9] poetry lock
---
poetry.lock | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/poetry.lock b/poetry.lock
index 0e93fd083..fc284fe31 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1211,6 +1211,7 @@ description = "Powerful and Pythonic XML processing library combining libxml2/li
optional = false
python-versions = ">=3.6"
files = [
+ {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:704f5572ff473a5f897745abebc6df40f22d4133c1e0a1f124e4f2bd3330ff7e"},
{file = "lxml-5.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9d3c0f8567ffe7502d969c2c1b809892dc793b5d0665f602aad19895f8d508da"},
{file = "lxml-5.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5fcfbebdb0c5d8d18b84118842f31965d59ee3e66996ac842e21f957eb76138c"},
{file = "lxml-5.1.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2f37c6d7106a9d6f0708d4e164b707037b7380fcd0b04c5bd9cae1fb46a856fb"},
@@ -1220,6 +1221,7 @@ files = [
{file = "lxml-5.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:82bddf0e72cb2af3cbba7cec1d2fd11fda0de6be8f4492223d4a268713ef2147"},
{file = "lxml-5.1.0-cp310-cp310-win32.whl", hash = "sha256:b66aa6357b265670bb574f050ffceefb98549c721cf28351b748be1ef9577d93"},
{file = "lxml-5.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:4946e7f59b7b6a9e27bef34422f645e9a368cb2be11bf1ef3cafc39a1f6ba68d"},
+ {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:14deca1460b4b0f6b01f1ddc9557704e8b365f55c63070463f6c18619ebf964f"},
{file = "lxml-5.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ed8c3d2cd329bf779b7ed38db176738f3f8be637bb395ce9629fc76f78afe3d4"},
{file = "lxml-5.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:436a943c2900bb98123b06437cdd30580a61340fbdb7b28aaf345a459c19046a"},
{file = "lxml-5.1.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:acb6b2f96f60f70e7f34efe0c3ea34ca63f19ca63ce90019c6cbca6b676e81fa"},
@@ -1229,6 +1231,7 @@ files = [
{file = "lxml-5.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f4c9bda132ad108b387c33fabfea47866af87f4ea6ffb79418004f0521e63204"},
{file = "lxml-5.1.0-cp311-cp311-win32.whl", hash = "sha256:bc64d1b1dab08f679fb89c368f4c05693f58a9faf744c4d390d7ed1d8223869b"},
{file = "lxml-5.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:a5ab722ae5a873d8dcee1f5f45ddd93c34210aed44ff2dc643b5025981908cda"},
+ {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9aa543980ab1fbf1720969af1d99095a548ea42e00361e727c58a40832439114"},
{file = "lxml-5.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6f11b77ec0979f7e4dc5ae081325a2946f1fe424148d3945f943ceaede98adb8"},
{file = "lxml-5.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a36c506e5f8aeb40680491d39ed94670487ce6614b9d27cabe45d94cd5d63e1e"},
{file = "lxml-5.1.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f643ffd2669ffd4b5a3e9b41c909b72b2a1d5e4915da90a77e119b8d48ce867a"},
@@ -1254,8 +1257,8 @@ files = [
{file = "lxml-5.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8f52fe6859b9db71ee609b0c0a70fea5f1e71c3462ecf144ca800d3f434f0764"},
{file = "lxml-5.1.0-cp37-cp37m-win32.whl", hash = "sha256:d42e3a3fc18acc88b838efded0e6ec3edf3e328a58c68fbd36a7263a874906c8"},
{file = "lxml-5.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:eac68f96539b32fce2c9b47eb7c25bb2582bdaf1bbb360d25f564ee9e04c542b"},
+ {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ae15347a88cf8af0949a9872b57a320d2605ae069bcdf047677318bc0bba45b1"},
{file = "lxml-5.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c26aab6ea9c54d3bed716b8851c8bfc40cb249b8e9880e250d1eddde9f709bf5"},
- {file = "lxml-5.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cfbac9f6149174f76df7e08c2e28b19d74aed90cad60383ad8671d3af7d0502f"},
{file = "lxml-5.1.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:342e95bddec3a698ac24378d61996b3ee5ba9acfeb253986002ac53c9a5f6f84"},
{file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:725e171e0b99a66ec8605ac77fa12239dbe061482ac854d25720e2294652eeaa"},
{file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d184e0d5c918cff04cdde9dbdf9600e960161d773666958c9d7b565ccc60c45"},
@@ -1263,6 +1266,7 @@ files = [
{file = "lxml-5.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6d48fc57e7c1e3df57be5ae8614bab6d4e7b60f65c5457915c26892c41afc59e"},
{file = "lxml-5.1.0-cp38-cp38-win32.whl", hash = "sha256:7ec465e6549ed97e9f1e5ed51c657c9ede767bc1c11552f7f4d022c4df4a977a"},
{file = "lxml-5.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:b21b4031b53d25b0858d4e124f2f9131ffc1530431c6d1321805c90da78388d1"},
+ {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:52427a7eadc98f9e62cb1368a5079ae826f94f05755d2d567d93ee1bc3ceb354"},
{file = "lxml-5.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6a2a2c724d97c1eb8cf966b16ca2915566a4904b9aad2ed9a09c748ffe14f969"},
{file = "lxml-5.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:843b9c835580d52828d8f69ea4302537337a21e6b4f1ec711a52241ba4a824f3"},
{file = "lxml-5.1.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9b99f564659cfa704a2dd82d0684207b1aadf7d02d33e54845f9fc78e06b7581"},
From 65899f61711018b94e43355e00685b9329745354 Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Fri, 26 Apr 2024 10:15:44 -0600
Subject: [PATCH 3/9] poetry lock
---
poetry.lock | 1 -
1 file changed, 1 deletion(-)
diff --git a/poetry.lock b/poetry.lock
index f70d06207..fc284fe31 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1517,7 +1517,6 @@ files = [
{file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"},
{file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"},
{file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"},
- {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"},
{file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"},
]
From 5506da56e219753d3a4d4c61d279f0f4b19092f0 Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Wed, 8 May 2024 09:05:27 -0600
Subject: [PATCH 4/9] poetry lock
---
poetry.lock | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/poetry.lock b/poetry.lock
index bb92d1c04..1b201f09b 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
[[package]]
name = "ago"
@@ -1278,6 +1278,7 @@ files = [
{file = "lxml-5.2.1-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c38d7b9a690b090de999835f0443d8aa93ce5f2064035dfc48f27f02b4afc3d0"},
{file = "lxml-5.2.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5670fb70a828663cc37552a2a85bf2ac38475572b0e9b91283dc09efb52c41d1"},
{file = "lxml-5.2.1-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:958244ad566c3ffc385f47dddde4145088a0ab893504b54b52c041987a8c1863"},
+ {file = "lxml-5.2.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b6241d4eee5f89453307c2f2bfa03b50362052ca0af1efecf9fef9a41a22bb4f"},
{file = "lxml-5.2.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:2a66bf12fbd4666dd023b6f51223aed3d9f3b40fef06ce404cb75bafd3d89536"},
{file = "lxml-5.2.1-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:9123716666e25b7b71c4e1789ec829ed18663152008b58544d95b008ed9e21e9"},
{file = "lxml-5.2.1-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:0c3f67e2aeda739d1cc0b1102c9a9129f7dc83901226cc24dd72ba275ced4218"},
From 8e6b3fa39e336389eb1163a3710e251b9c3c3758 Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Wed, 29 May 2024 10:15:11 -0600
Subject: [PATCH 5/9] Poetry lock
---
poetry.lock | 1 +
1 file changed, 1 insertion(+)
diff --git a/poetry.lock b/poetry.lock
index 90f743b80..96696c8dc 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1297,6 +1297,7 @@ files = [
{file = "lxml-5.2.1-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c38d7b9a690b090de999835f0443d8aa93ce5f2064035dfc48f27f02b4afc3d0"},
{file = "lxml-5.2.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5670fb70a828663cc37552a2a85bf2ac38475572b0e9b91283dc09efb52c41d1"},
{file = "lxml-5.2.1-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:958244ad566c3ffc385f47dddde4145088a0ab893504b54b52c041987a8c1863"},
+ {file = "lxml-5.2.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b6241d4eee5f89453307c2f2bfa03b50362052ca0af1efecf9fef9a41a22bb4f"},
{file = "lxml-5.2.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:2a66bf12fbd4666dd023b6f51223aed3d9f3b40fef06ce404cb75bafd3d89536"},
{file = "lxml-5.2.1-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:9123716666e25b7b71c4e1789ec829ed18663152008b58544d95b008ed9e21e9"},
{file = "lxml-5.2.1-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:0c3f67e2aeda739d1cc0b1102c9a9129f7dc83901226cc24dd72ba275ced4218"},
From a401562735987a065f5258fea5a424a27cc746c5 Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Mon, 10 Jun 2024 10:15:22 -0600
Subject: [PATCH 6/9] Add report options 1/3/5-day
---
.ds.baseline | 4 ++--
app/config.py | 7 +++++-
app/main/views/jobs.py | 32 +++++++++++++++++++++-----
app/main/views/notifications.py | 4 ++--
app/models/service.py | 7 ++++--
app/templates/views/notifications.html | 14 ++++++++++-
tests/app/main/views/test_activity.py | 14 +++++++----
7 files changed, 63 insertions(+), 19 deletions(-)
diff --git a/.ds.baseline b/.ds.baseline
index cec28396c..f95942edb 100644
--- a/.ds.baseline
+++ b/.ds.baseline
@@ -169,7 +169,7 @@
"filename": "app/config.py",
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
"is_verified": false,
- "line_number": 111,
+ "line_number": 116,
"is_secret": false
}
],
@@ -710,5 +710,5 @@
}
]
},
- "generated_at": "2024-05-20T16:03:05Z"
+ "generated_at": "2024-06-10T16:09:52Z"
}
diff --git a/app/config.py b/app/config.py
index 8ec4db186..2a0f0c3e7 100644
--- a/app/config.py
+++ b/app/config.py
@@ -53,7 +53,12 @@ class Config(object):
PERMANENT_SESSION_LIFETIME = 1800 # 30 Minutes
SEND_FILE_MAX_AGE_DEFAULT = 365 * 24 * 60 * 60 # 1 year
REPLY_TO_EMAIL_ADDRESS_VALIDATION_TIMEOUT = 45
- ACTIVITY_STATS_LIMIT_DAYS = 7
+ ACTIVITY_STATS_LIMIT_DAYS = {
+ "one_day": 1,
+ "three_day": 3,
+ "five_day": 5,
+ "seven_day": 7,
+ }
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_NAME = "notify_admin_session"
SESSION_COOKIE_SECURE = True
diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py
index 010d19b26..6608ac419 100644
--- a/app/main/views/jobs.py
+++ b/app/main/views/jobs.py
@@ -143,11 +143,33 @@ def view_notifications(service_id, message_type=None):
True: ["reference"],
False: [],
}.get(bool(current_service.api_keys)),
- download_link=url_for(
+ download_link_one_day=url_for(
".download_notifications_csv",
service_id=current_service.id,
message_type=message_type,
status=request.args.get("status"),
+ number_of_days="one_day",
+ ),
+ download_link_three_day=url_for(
+ ".download_notifications_csv",
+ service_id=current_service.id,
+ message_type=message_type,
+ status=request.args.get("status"),
+ number_of_days="three_day",
+ ),
+ download_link_five_day=url_for(
+ ".download_notifications_csv",
+ service_id=current_service.id,
+ message_type=message_type,
+ status=request.args.get("status"),
+ number_of_days="five_day",
+ ),
+ download_link_seven_day=url_for(
+ ".download_notifications_csv",
+ service_id=current_service.id,
+ message_type=message_type,
+ status=request.args.get("status"),
+ number_of_days="seven_day",
),
)
@@ -183,10 +205,9 @@ def get_notifications(service_id, message_type, status_override=None): # noqa
filter_args["status"] = set_status_filters(filter_args)
service_data_retention_days = None
search_term = request.form.get("to", "")
-
if message_type is not None:
service_data_retention_days = current_service.get_days_of_retention(
- message_type
+ message_type, number_of_days="seven_day"
)
if request.path.endswith("csv") and current_user.has_permissions("view_activity"):
@@ -212,7 +233,6 @@ def get_notifications(service_id, message_type, status_override=None): # noqa
)
url_args = {"message_type": message_type, "status": request.args.get("status")}
prev_page = None
-
if "links" in notifications and notifications["links"].get("prev", None):
prev_page = generate_previous_dict(
"main.view_notifications", service_id, page, url_args=url_args
@@ -233,7 +253,6 @@ def get_notifications(service_id, message_type, status_override=None): # noqa
)
else:
download_link = None
-
return {
"service_data_retention_days": service_data_retention_days,
"counts": render_template(
@@ -362,6 +381,7 @@ 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"])
+ number_of_days = "seven_day"
counts = render_template(
"partials/count.html",
counts=_get_job_counts(job),
@@ -371,7 +391,7 @@ def get_job_partials(job):
),
)
service_data_retention_days = current_service.get_days_of_retention(
- job.template_type
+ job.template_type, number_of_days
)
if request.referrer is not None:
diff --git a/app/main/views/notifications.py b/app/main/views/notifications.py
index ac05e05ff..e41708b8c 100644
--- a/app/main/views/notifications.py
+++ b/app/main/views/notifications.py
@@ -137,9 +137,9 @@ def get_all_personalisation_from_notification(notification):
def download_notifications_csv(service_id):
filter_args = parse_filter_args(request.args)
filter_args["status"] = set_status_filters(filter_args)
-
+ number_of_days = request.args["number_of_days"]
service_data_retention_days = current_service.get_days_of_retention(
- filter_args.get("message_type")[0]
+ filter_args.get("message_type")[0], number_of_days
)
file_time = datetime.now().strftime("%Y-%m-%d %I:%M:%S %p")
file_time = f"{file_time} {get_user_preferred_timezone()}"
diff --git a/app/models/service.py b/app/models/service.py
index 375047d8d..e9bcf8a7d 100644
--- a/app/models/service.py
+++ b/app/models/service.py
@@ -390,7 +390,7 @@ class Service(JSONModel, SortByNameMixin):
def get_data_retention_item(self, id):
return next((dr for dr in self.data_retention if dr["id"] == id), None)
- def get_days_of_retention(self, notification_type):
+ def get_days_of_retention(self, notification_type, number_of_days):
return next(
(
dr
@@ -398,7 +398,10 @@ class Service(JSONModel, SortByNameMixin):
if dr["notification_type"] == notification_type
),
{},
- ).get("days_of_retention", current_app.config["ACTIVITY_STATS_LIMIT_DAYS"])
+ ).get(
+ "days_of_retention",
+ current_app.config["ACTIVITY_STATS_LIMIT_DAYS"].get(number_of_days),
+ )
@cached_property
def organization(self):
diff --git a/app/templates/views/notifications.html b/app/templates/views/notifications.html
index 9f5accd43..4858382b2 100644
--- a/app/templates/views/notifications.html
+++ b/app/templates/views/notifications.html
@@ -64,10 +64,22 @@
{% if current_user.has_permissions('view_activity') %}
- Download this report (CSV)
+ Download all data last 7 days (CSV)
Data available for {{ partials.service_data_retention_days }} days
+
+ Download all data last 5 days (CSV)
+
+
+
+ Download all data last 3 days (CSV)
+
+
+
+ Download all data today (CSV)
+
+
{% endif %}
{{ ajax_block(
diff --git a/tests/app/main/views/test_activity.py b/tests/app/main/views/test_activity.py
index 3493aaae4..3bbe40282 100644
--- a/tests/app/main/views/test_activity.py
+++ b/tests/app/main/views/test_activity.py
@@ -228,12 +228,18 @@ def test_can_show_notifications_if_data_retention_not_available(
url_for,
".download_notifications_csv",
message_type=None,
+ number_of_days="seven_day",
),
),
(
create_active_user_with_permissions(),
{"status": "failed"},
- partial(url_for, ".download_notifications_csv", status="failed"),
+ partial(
+ url_for,
+ ".download_notifications_csv",
+ status="failed",
+ number_of_days="seven_day",
+ ),
),
(
create_active_user_with_permissions(),
@@ -242,15 +248,13 @@ def test_can_show_notifications_if_data_retention_not_available(
url_for,
".download_notifications_csv",
message_type="sms",
+ number_of_days="seven_day",
),
),
(
create_active_user_view_permissions(),
{},
- partial(
- url_for,
- ".download_notifications_csv",
- ),
+ partial(url_for, ".download_notifications_csv", number_of_days="seven_day"),
),
(
create_active_caseworking_user(),
From a9e4df059154c914d0fd83033d092337a1f23b6b Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Mon, 24 Jun 2024 10:44:19 -0600
Subject: [PATCH 7/9] Todays data is only todays
---
.ds.baseline | 4 ++--
app/config.py | 1 +
app/main/views/jobs.py | 7 +++++++
app/templates/views/notifications.html | 6 +++++-
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.ds.baseline b/.ds.baseline
index 7b2ab5f89..73435047a 100644
--- a/.ds.baseline
+++ b/.ds.baseline
@@ -169,7 +169,7 @@
"filename": "app/config.py",
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
"is_verified": false,
- "line_number": 116,
+ "line_number": 117,
"is_secret": false
}
],
@@ -710,5 +710,5 @@
}
]
},
- "generated_at": "2024-06-05T22:01:56Z"
+ "generated_at": "2024-06-24T16:44:00Z"
}
diff --git a/app/config.py b/app/config.py
index e3d7c3af9..960d6331b 100644
--- a/app/config.py
+++ b/app/config.py
@@ -54,6 +54,7 @@ class Config(object):
SEND_FILE_MAX_AGE_DEFAULT = 365 * 24 * 60 * 60 # 1 year
REPLY_TO_EMAIL_ADDRESS_VALIDATION_TIMEOUT = 45
ACTIVITY_STATS_LIMIT_DAYS = {
+ "today": 0,
"one_day": 1,
"three_day": 3,
"five_day": 5,
diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py
index 6608ac419..42a4de090 100644
--- a/app/main/views/jobs.py
+++ b/app/main/views/jobs.py
@@ -150,6 +150,13 @@ def view_notifications(service_id, message_type=None):
status=request.args.get("status"),
number_of_days="one_day",
),
+ download_link_today=url_for(
+ ".download_notifications_csv",
+ service_id=current_service.id,
+ message_type=message_type,
+ status=request.args.get("status"),
+ number_of_days="today",
+ ),
download_link_three_day=url_for(
".download_notifications_csv",
service_id=current_service.id,
diff --git a/app/templates/views/notifications.html b/app/templates/views/notifications.html
index 4858382b2..487e10b98 100644
--- a/app/templates/views/notifications.html
+++ b/app/templates/views/notifications.html
@@ -76,9 +76,13 @@
Download all data last 3 days (CSV)
-
+
+
+ Download all data today (CSV)
+
{% endif %}
From 9685a4bd2446d6390c00893a00e3ee0d7c7ed8a0 Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Tue, 25 Jun 2024 09:04:59 -0600
Subject: [PATCH 8/9] Remove code that shouldn't be in
---
app/main/views/send.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/main/views/send.py b/app/main/views/send.py
index 6d0f4f928..8bb6ce24c 100644
--- a/app/main/views/send.py
+++ b/app/main/views/send.py
@@ -1039,8 +1039,6 @@ def send_notification(service_id, template_id):
".view_job",
service_id=service_id,
job_id=upload_id,
- from_job=upload_id,
- notification_id=notifications["notifications"][0]["id"],
# used to show the final step of the tour (help=3) or not show
# a back link on a just sent one off notification (help=0)
help=request.args.get("help"),
From f218c0124436ba6f081726e5290e550156467055 Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Wed, 26 Jun 2024 08:34:05 -0600
Subject: [PATCH 9/9] Remove commented out code
---
app/templates/views/notifications.html | 4 ----
1 file changed, 4 deletions(-)
diff --git a/app/templates/views/notifications.html b/app/templates/views/notifications.html
index 487e10b98..cac2b9811 100644
--- a/app/templates/views/notifications.html
+++ b/app/templates/views/notifications.html
@@ -76,10 +76,6 @@
Download all data last 3 days (CSV)
-
Download all data today (CSV)