From 06843fea093b7c254c36a1246ca82ef14acf1800 Mon Sep 17 00:00:00 2001 From: Anandashankar Anil Date: Wed, 13 Dec 2023 09:50:09 +0100 Subject: [PATCH 1/4] Update template to account for users with only pending projects where samples havent been received yet --- daily_read/templates/daily_report.html.j2 | 118 ++++++++++++---------- 1 file changed, 64 insertions(+), 54 deletions(-) diff --git a/daily_read/templates/daily_report.html.j2 b/daily_read/templates/daily_report.html.j2 index ceb16af..fc509d4 100644 --- a/daily_read/templates/daily_report.html.j2 +++ b/daily_read/templates/daily_report.html.j2 @@ -148,67 +148,77 @@ + {% if data["projects"]|length == 1 and None in data["projects"] %} +
+
No recorded activity at the time of report generation!
+
+ {% else %}
{% for date_prio, date_type in priority | dictsort %} -
-
-
- {{ date_type }} -
-
-
- {% for project in data["projects"][date_type] %} -
-
-

- -

-
-
-

- Order Portal: - - {{ project.project_id }} - -

- {% for date, statuses in project.project_dates | dictsort %} - {% if project.project_dates[date] and project.project_dates[date] != "XXXX-XX-XX" %} -
-
{{ date }}
-
- {% for status in statuses %} - - {{ status }} -
- {% endfor %} -
-
- {% endif %} - {% endfor %} +
+
+
+ {{ date_type }} +
+
+
+ {% for project in data["projects"][date_type] %} +
+
+

+ +

+
+
+

+ Order Portal: + + {{ project.project_id }} + +

+ {% for date, statuses in project.project_dates | dictsort %} + {% if project.project_dates[date] and project.project_dates[date] != "XXXX-XX-XX" %} +
+
{{ date }}
+
+ {% for status in statuses %} + + {{ status }} +
+ {% endfor %} +
+
+ {% endif %} + {% endfor %} +
+
-
+ {% endfor %}
- {% endfor %} -
-
- {% endfor %} +
+ {% endfor %}
+ {% endif %}
+

Please note that there could be a delay of up to a few days between the actual event and its appearance in the report depending on the entry into our system and when this report is generated.

Created with DailyRead (commit {{ git_commits["git_commit"] }})

From 195ada9b944132557e3c97967eb9c575837592ac Mon Sep 17 00:00:00 2001 From: Anandashankar Anil Date: Wed, 13 Dec 2023 09:54:43 +0100 Subject: [PATCH 2/4] Also add check for validation/no validation label --- .github/pr_labels.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/pr_labels.yml diff --git a/.github/pr_labels.yml b/.github/pr_labels.yml new file mode 100644 index 0000000..8db6d10 --- /dev/null +++ b/.github/pr_labels.yml @@ -0,0 +1,6 @@ +version: "1" +invalidStatus: "pending" +labelRule: + values: + - "validation" + - "no validation" From 6d9a0b22babfcf504694eeed90cae0d0a9a5aa02 Mon Sep 17 00:00:00 2001 From: Anandashankar Anil Date: Tue, 2 Jan 2024 14:39:43 +0100 Subject: [PATCH 3/4] Remove hardcoded order year --- daily_read/ngi_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daily_read/ngi_data.py b/daily_read/ngi_data.py index e7aba60..7fdf1c5 100644 --- a/daily_read/ngi_data.py +++ b/daily_read/ngi_data.py @@ -340,7 +340,7 @@ def get_data(self, project_id=None, close_date=None): if close_date is None: close_date = (datetime.datetime.now() - relativedelta(months=6)).strftime("%Y-%m-%d") for row in self.statusdb_session.rows(close_date=close_date): - order_year = "2023" # TODO - get order year from data + order_year = row.value["order_year"] portal_id = row.value["portal_id"] relative_path = f"{self.dirname}/{order_year}/{portal_id}.json" From 17ca336d7be8f21fc23a9a4ff50bda5abe9753f5 Mon Sep 17 00:00:00 2001 From: Anandashankar Anil Date: Wed, 3 Jan 2024 17:43:54 +0100 Subject: [PATCH 4/4] Remove one more hardcoded order year --- daily_read/ngi_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daily_read/ngi_data.py b/daily_read/ngi_data.py index 7fdf1c5..f739f49 100644 --- a/daily_read/ngi_data.py +++ b/daily_read/ngi_data.py @@ -361,7 +361,7 @@ def get_entry(self, project_id): rows = self.statusdb_session.rows(close_date=close_date) for row in rows: if row.value["portal_id"] == project_id: - order_year = "2023" # TODO - get order year from data + order_year = row.value["order_year"] portal_id = row.value["portal_id"] relative_path = f"{self.dirname}/{order_year}/{portal_id}.json" self.data[portal_id] = ProjectDataRecord(relative_path, data=row.value)