Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report Schedules List #3608

Merged
merged 317 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
317 commits
Select commit Hold shift + click to select a range
c5d7aae
Continue updating tests
jpbruinsslot Apr 16, 2024
45019f3
Continue with fixing tests
jpbruinsslot Apr 17, 2024
1f46615
Update tests
jpbruinsslot Apr 18, 2024
5275ec4
Fixing tests
jpbruinsslot Apr 22, 2024
88208b4
Fix stalled tests
jpbruinsslot Apr 30, 2024
b729d7c
Remove PrioritizedItem
jpbruinsslot May 1, 2024
3942029
Updating tests
jpbruinsslot May 2, 2024
473199e
Restructure deadline calculation
jpbruinsslot May 20, 2024
8f31c61
Start fixing normalizer scheduler
jpbruinsslot May 20, 2024
cc53a39
Restructure
jpbruinsslot May 27, 2024
a0f4be6
Remove obsolete code
jpbruinsslot May 28, 2024
8c5d7bf
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Jun 11, 2024
c90e216
Some more merge conflict fixes
jpbruinsslot Jun 11, 2024
592270f
Update
jpbruinsslot Jun 24, 2024
5aefdb9
Refactor push task
jpbruinsslot Jun 25, 2024
8d29a3e
Refactor
jpbruinsslot Jun 26, 2024
51f40fd
Start with normalizer refactor
jpbruinsslot Jun 26, 2024
4c46160
Todo
jpbruinsslot Jun 27, 2024
ee9a234
Refactor push task normalizer
jpbruinsslot Jun 27, 2024
25bfe06
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Jun 27, 2024
064d930
Fix conflict
jpbruinsslot Jun 27, 2024
0c27657
Fix server api tests
jpbruinsslot Jul 1, 2024
35c57bb
Refactor server
jpbruinsslot Jul 1, 2024
44c9b8e
Add api endpoints for schedules
jpbruinsslot Jul 2, 2024
5459ccd
Rename method normalizer scheduler
jpbruinsslot Jul 3, 2024
126ab04
Changes
jpbruinsslot Jul 3, 2024
76ad63e
Trying to fix bug
jpbruinsslot Jul 4, 2024
3cb590f
Update normalizer
jpbruinsslot Jul 8, 2024
8e9b401
Fix validation and setting of schedule
jpbruinsslot Jul 8, 2024
3c1c9d3
Bug finally fixed
jpbruinsslot Jul 9, 2024
4820d1b
Continue fixing bugs
jpbruinsslot Jul 10, 2024
c48d93f
Fix retrieving schedules from database
jpbruinsslot Jul 11, 2024
d673789
Make tests work
jpbruinsslot Jul 11, 2024
f2f7ca9
Fixing bugs, updating tests
jpbruinsslot Jul 11, 2024
e9ce420
Fix tests
jpbruinsslot Jul 15, 2024
ec03654
Fixing tests
jpbruinsslot Jul 15, 2024
448b580
For now skip test
jpbruinsslot Jul 16, 2024
78e0101
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Jul 16, 2024
6f6836d
Integration scheduler changes with other services
jpbruinsslot Jul 17, 2024
8f18cd6
Fix normalizer bug
jpbruinsslot Jul 18, 2024
d566317
Start with schedule implementation
jpbruinsslot Jul 18, 2024
8e358a8
Update and fix scripts
jpbruinsslot Jul 18, 2024
09d8861
Add tests
jpbruinsslot Jul 18, 2024
8e67fe3
Fixes
jpbruinsslot Jul 22, 2024
afe8acb
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Jul 23, 2024
64487b4
Add some tests
jpbruinsslot Jul 23, 2024
7a2a938
Update migration
jpbruinsslot Jul 23, 2024
b576a2d
Update migrations
jpbruinsslot Jul 23, 2024
e68a7e7
Update migrations
jpbruinsslot Jul 23, 2024
64e6820
Fix new boefjes
jpbruinsslot Jul 23, 2024
4405160
Add tests
jpbruinsslot Jul 24, 2024
7fb719e
Remove breakpoint
jpbruinsslot Jul 24, 2024
5b360a5
Precommit
jpbruinsslot Jul 24, 2024
260a2f3
Restructure scripts
jpbruinsslot Jul 24, 2024
cd64da4
Restructure storage
jpbruinsslot Jul 24, 2024
395ae2f
Restructure server
jpbruinsslot Jul 24, 2024
81b1a34
Fix new boefjes issue
jpbruinsslot Jul 24, 2024
735d4b4
Merge branch 'feature/mula/refactor-queue' into feature/rocky/schedules
jpbruinsslot Jul 24, 2024
83ef876
Add thread safety tests
jpbruinsslot Jul 24, 2024
ba3a81d
Add additional thread safety test for the other caches
jpbruinsslot Jul 25, 2024
7e4ce13
Add more tests
jpbruinsslot Jul 25, 2024
d90d6d5
Merge branch 'fix/mula/new_boefjes' into feature/mula/refactor-queue
jpbruinsslot Jul 25, 2024
e6c800c
Merge branch 'main' into fix/mula/new_boefjes
underdarknl Jul 25, 2024
88e7bb7
Exclude folder from pre-commit
jpbruinsslot Jul 29, 2024
1d83f0f
Update .pre-commit-config.yaml
jpbruinsslot Jul 29, 2024
8dc860c
Update pyproject.toml
jpbruinsslot Jul 29, 2024
95ed5ed
Update .pre-commit-config.yaml
jpbruinsslot Jul 29, 2024
8c08c9a
Remove logging statements
jpbruinsslot Jul 29, 2024
1a19d77
Precommit
jpbruinsslot Jul 29, 2024
626301d
Merge branch 'main' into feature/mula/server-updates
jpbruinsslot Jul 29, 2024
b9553ad
Merge branch 'main' into feature/mula/storage-updates
jpbruinsslot Jul 29, 2024
35fc046
Fix mypy suggestions
jpbruinsslot Jul 29, 2024
51089dd
Update tests
jpbruinsslot Jul 29, 2024
e5823be
Update
jpbruinsslot Jul 29, 2024
cea7f53
Fix tests
jpbruinsslot Jul 29, 2024
b63faa0
Pre-commit
jpbruinsslot Jul 29, 2024
ff49bc5
Merge branch 'feature/mula/storage-updates' into feature/mula/refacto…
jpbruinsslot Jul 29, 2024
79c860e
Merge branch 'feature/mula/scripts' into feature/mula/refactor-queue
jpbruinsslot Jul 29, 2024
66c2a16
Pre-commit
jpbruinsslot Jul 29, 2024
c446e13
Merge branch 'feature/mula/server-updates' into feature/mula/refactor…
jpbruinsslot Jul 29, 2024
e30ba73
Pre-commit
jpbruinsslot Jul 29, 2024
0b45e49
Merge branch 'feature/mula/scripts' into feature/mula/refactor-queue
jpbruinsslot Jul 29, 2024
408227d
Pre-commit
jpbruinsslot Jul 29, 2024
55e4673
Update mula/scheduler/connectors/services/katalogus.py
jpbruinsslot Jul 30, 2024
f97b196
Updates according to code-review
jpbruinsslot Jul 30, 2024
019752b
Pre-commit
jpbruinsslot Jul 30, 2024
7cdb525
Update filters.py
jpbruinsslot Jul 30, 2024
093276c
Update logging
jpbruinsslot Jul 30, 2024
33bac6e
Update filters.py
jpbruinsslot Jul 30, 2024
4e1dc9e
Pre-commit
jpbruinsslot Jul 30, 2024
da875c5
Fix filters
jpbruinsslot Jul 30, 2024
df4855e
Trying to fix mypy errors
jpbruinsslot Jul 30, 2024
9185597
Merge branch 'main' into feature/mula/storage-updates
jpbruinsslot Jul 30, 2024
e97a460
Fix datastore connection
jpbruinsslot Jul 30, 2024
0633a06
Trying to fix boefje tests
jpbruinsslot Jul 30, 2024
9bfd16b
Fix boefje tests
jpbruinsslot Jul 30, 2024
5a60394
Merge branch 'main' into fix/mula/new_boefjes
ammar92 Jul 31, 2024
de2eef7
Remove unnecessary type hints
jpbruinsslot Jul 31, 2024
c560581
Fix rocky tests
jpbruinsslot Jul 31, 2024
494a558
Fix rocky tests
jpbruinsslot Jul 31, 2024
ad44c02
Fix rocky tests
jpbruinsslot Jul 31, 2024
aa5aa2d
Update filters.py
jpbruinsslot Jul 31, 2024
e9950a9
Pre-commit
jpbruinsslot Jul 31, 2024
bd1a99e
Fix mypy
jpbruinsslot Jul 31, 2024
86901ab
Trying to add stubs
jpbruinsslot Jul 31, 2024
1fbceb6
Update mula/scheduler/context/context.py
jpbruinsslot Jul 31, 2024
4fbbe42
Update mula/scheduler/context/context.py
jpbruinsslot Jul 31, 2024
875cf08
Updates according to code review
jpbruinsslot Jul 31, 2024
7a78358
Add code-review suggestions
jpbruinsslot Jul 31, 2024
48bd09d
Merge branch 'feature/mula/scripts' into feature/mula/refactor-queue
jpbruinsslot Jul 31, 2024
20654d5
Merge remote-tracking branch 'origin/fix/mula/new_boefjes' into featu…
jpbruinsslot Jul 31, 2024
b862117
Merge remote-tracking branch 'origin/feature/mula/server-updates' int…
jpbruinsslot Jul 31, 2024
9f64326
Merge remote-tracking branch 'origin/feature/mula/storage-updates' in…
jpbruinsslot Jul 31, 2024
14fbe54
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Jul 31, 2024
aebb870
Fix for boefje/normalizer runner
jpbruinsslot Aug 1, 2024
f6be13a
Pre-commit
jpbruinsslot Aug 1, 2024
2516b1b
Fix requirements
jpbruinsslot Aug 1, 2024
abf5bf1
Update croniter
jpbruinsslot Aug 1, 2024
f777ef3
Update from croniter types
jpbruinsslot Aug 1, 2024
dc7f1f4
Ignore type
jpbruinsslot Aug 1, 2024
6ed961f
Ignore security-sensitive check of random
jpbruinsslot Aug 1, 2024
beeab12
Fix shadowing of python builtin
jpbruinsslot Aug 1, 2024
c849d0a
Pre-commit
jpbruinsslot Aug 1, 2024
00c126d
Fix linting
jpbruinsslot Aug 1, 2024
7926f53
Fix manual rescheduling
jpbruinsslot Aug 5, 2024
4b46b0c
Fix schedule_id when manual rescheduling
jpbruinsslot Aug 5, 2024
ce073ea
Merge branch 'feature/mula/refactor-queue' into feature/rocky/schedules
jpbruinsslot Aug 6, 2024
6ee70e9
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Aug 6, 2024
5df88d0
Merge branch 'feature/mula/refactor-queue' into feature/rocky/schedules
jpbruinsslot Aug 6, 2024
69e6faf
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Aug 6, 2024
94a25c5
Merge branch 'feature/mula/refactor-queue' into feature/rocky/schedules
jpbruinsslot Aug 6, 2024
0e4b2fa
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Aug 6, 2024
7371c55
Fix formatting
jpbruinsslot Aug 7, 2024
e4daab6
Formatting
jpbruinsslot Aug 7, 2024
bfda8fb
Formatting
jpbruinsslot Aug 7, 2024
299fc22
Updates according to code review
jpbruinsslot Aug 8, 2024
efb871a
Merge branch 'main' into feature/mula/refactor-queue
jpbruinsslot Aug 8, 2024
50c39a2
Fix poetry
jpbruinsslot Aug 8, 2024
c0af1ea
Schedule report forms and validations and corn expressions
Rieven Aug 8, 2024
8efbf8a
Merge branch 'feature/mula/refactor-queue' into feature/rocky/schedules
jpbruinsslot Aug 8, 2024
c3a7854
Add form to reports for shculing
Rieven Aug 8, 2024
15087be
Merge branch 'feature/rocky/schedules' of github.com:minvws/nl-kat-co…
Rieven Aug 8, 2024
8b7c3ca
Add api create schedules functionality
jpbruinsslot Aug 8, 2024
6117eec
Merge branch 'feature/mula/api-create-schedules' into feature/rocky/s…
jpbruinsslot Aug 8, 2024
9f0da80
Update create schedule functionality
jpbruinsslot Aug 12, 2024
d4408fe
Pre-commit
jpbruinsslot Aug 12, 2024
c6f8f9f
Update scheduler client for rocky
jpbruinsslot Aug 12, 2024
265ced6
Fix tests
jpbruinsslot Aug 12, 2024
e985caf
Fix test
jpbruinsslot Aug 13, 2024
54ade75
Merge remote-tracking branch 'origin' into feature/rocky/schedules
jpbruinsslot Aug 13, 2024
d99d2b5
Add create schedule functionality to api
jpbruinsslot Aug 13, 2024
90ae4c8
Update serializers
jpbruinsslot Aug 13, 2024
9141fbf
Add TODO
jpbruinsslot Aug 13, 2024
2e8937b
Refactor report history
madelondohmen Aug 13, 2024
f3a7d3d
Add scheduled report page
madelondohmen Aug 13, 2024
fddbaf9
Add validation, and hash generation
jpbruinsslot Aug 14, 2024
f4075b9
Table changes
madelondohmen Aug 14, 2024
bb968df
Add tests
jpbruinsslot Aug 14, 2024
5f2ee1e
Remove action buttons
madelondohmen Aug 14, 2024
11821ea
Pre-commit
jpbruinsslot Aug 14, 2024
061df46
Merge branch 'main' into feature/mula/create-schedule
jpbruinsslot Aug 14, 2024
978656b
Check if hash already exists
jpbruinsslot Aug 14, 2024
ba33e61
Update
jpbruinsslot Aug 14, 2024
d585ce3
Merge branch 'main' into feature/mula/create-schedule
jpbruinsslot Aug 15, 2024
819955a
Merge branch 'main' into feature/mula/create-schedule
jpbruinsslot Aug 19, 2024
1bd0c61
Merge branch 'feature/rocky/schedules' of github.com:minvws/nl-kat-co…
Rieven Aug 19, 2024
700db1f
Merge branch 'feature/mula/create-schedule' of github.com:minvws/nl-k…
Rieven Aug 19, 2024
55c5967
Merge branch 'feature/merge-scheduled-reports' of github.com:minvws/n…
Rieven Aug 19, 2024
a1cde85
Scheduler api integrated
Rieven Aug 19, 2024
35ebc9c
add schedule
Rieven Aug 19, 2024
57009a2
start with report recipe
Rieven Aug 20, 2024
a25d1e4
report recipe setup
Rieven Aug 21, 2024
55b65ed
Report recipe for generate report
Rieven Aug 26, 2024
ad1f8d2
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Aug 29, 2024
8c4867c
move error messages
Rieven Aug 29, 2024
101af63
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 3, 2024
d3c2430
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 10, 2024
3904028
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 10, 2024
2767329
Merge branch 'main' into feature/schedule-report
Rieven Sep 11, 2024
2189e55
Merge branch 'main' into feature/schedule-report
Rieven Sep 11, 2024
db5798a
Merge remote-tracking branch 'origin' into feature/schedule-report
jpbruinsslot Sep 11, 2024
5671a0d
Rebase
jpbruinsslot Sep 11, 2024
512b2e9
Update report task
jpbruinsslot Sep 11, 2024
780870e
Remove patch method for now to avoid confusion
jpbruinsslot Sep 11, 2024
881aac8
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 11, 2024
a59d07b
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 11, 2024
c047a43
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 11, 2024
41232a8
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 11, 2024
7092cde
fix lang
Rieven Sep 11, 2024
74cd0b5
Update scheduler client
jpbruinsslot Sep 11, 2024
b9ce6b0
fix multi report
Rieven Sep 11, 2024
53c55c7
Merge branch 'feature/schedule-report' of github.com:minvws/nl-kat-co…
Rieven Sep 11, 2024
565ac48
Update
jpbruinsslot Sep 11, 2024
89965be
Fix multi-report
Rieven Sep 12, 2024
1736ced
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 12, 2024
18c03e5
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 12, 2024
978492d
fix multirepor view
Rieven Sep 12, 2024
8cbcdc8
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 12, 2024
f1795db
fix lang
Rieven Sep 12, 2024
137f926
Add report type to multireport
Rieven Sep 12, 2024
978f35c
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 12, 2024
1c5d262
fix precommit
Rieven Sep 12, 2024
4eac7be
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 12, 2024
a7b3d0f
fix precommit
Rieven Sep 12, 2024
16298bc
Fix views for aggregate report
Rieven Sep 13, 2024
7f24508
Fix typing
Rieven Sep 13, 2024
19059e6
Fix views and template to prepare repor recipe
Rieven Sep 17, 2024
093236f
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 17, 2024
4d346b0
fix test
Rieven Sep 17, 2024
7ff4072
fix precommit
Rieven Sep 17, 2024
7192bb6
fix lang
Rieven Sep 17, 2024
33f635e
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 18, 2024
5ea561c
fix test
Rieven Sep 18, 2024
35d7190
Add form
Rieven Sep 18, 2024
a591fcf
chaneg names
Rieven Sep 18, 2024
69fd077
add typing
Rieven Sep 19, 2024
abd8f7e
Fix form validation for cron
Rieven Sep 23, 2024
5a5dc78
Add report recipe OOI (#3442)
Rieven Sep 23, 2024
fde2ff3
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 23, 2024
284536f
Merge branch 'main' into feature/scheduled-reports-page
madelondohmen Sep 25, 2024
f46ebb1
Fix views for report schedule
Rieven Sep 25, 2024
f68be57
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 25, 2024
98399df
Get data from scheduler
madelondohmen Sep 25, 2024
683feb8
Merge branch 'main' into feature/scheduled-reports-page
madelondohmen Sep 26, 2024
d214896
Add schdule reports
Rieven Sep 26, 2024
5d29d7b
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 26, 2024
bbc6ecf
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 26, 2024
e1c28e8
bundled errors
Rieven Sep 26, 2024
806c464
add natural key
noamblitz Sep 26, 2024
2b4e57e
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 26, 2024
883eacf
Fix some bug when change selection
Rieven Sep 26, 2024
a47f112
Merge branch 'main' into feature/scheduled-reports-page
madelondohmen Sep 30, 2024
e0cc588
Add a report runner implementation (#3587)
Donnype Sep 30, 2024
a1dcbc2
add text
Rieven Sep 30, 2024
6964e3c
fix test
Rieven Sep 30, 2024
4df40e0
Merge branch 'main' of github.com:minvws/nl-kat-coordination into fea…
Rieven Sep 30, 2024
15343db
Merge branch 'feature/report-recipe' of github.com:minvws/nl-kat-coor…
Rieven Sep 30, 2024
2d8b329
merge base
Rieven Sep 30, 2024
f11891f
fix base
Rieven Sep 30, 2024
3afd2ef
fix lang
Rieven Sep 30, 2024
cbc81b5
Merge branch 'feature/scheduled-reports-page' of github.com:minvws/nl…
Rieven Sep 30, 2024
94328cf
report schedules list
Rieven Oct 1, 2024
a2292bd
add reports to recipe in overview
noamblitz Oct 1, 2024
ee5705f
add expando
Rieven Oct 1, 2024
172304b
fix expando
noamblitz Oct 1, 2024
0af8ad2
fix templat
Rieven Oct 1, 2024
c22a9b0
Merge branch 'main' of github.com:minvws/nl-kat-coordination into mer…
Rieven Oct 1, 2024
069164c
fix routing for schedules, fix pre-commit
Rieven Oct 2, 2024
9c08de6
fix precommit
Rieven Oct 2, 2024
a0f2de4
Merge branch 'main' into merge/report-schedule-page
stephanie0x00 Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions rocky/reports/templates/report_overview/report_history.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{% extends "layouts/base.html" %}

{% load i18n %}
{% load static %}

{% block content %}
{% include "header.html" %}

<main id="main-content" tabindex="-1" class="katalogus">
<section>
{% include "report_overview/report_overview_header.html" %}
{% include "report_overview/report_overview_navigation.html" with active="history" %}

<div class="horizontal-scroll">
<h2>{% translate "Reports history" %}</h2>
<p>{% translate "An overview of all your generated reports." %}</p>
<p class="de-emphasized">
{% blocktranslate with length=reports|length total=total_oois %}Showing {{ length }} of {{ total }} reports{% endblocktranslate %}
</p>
{% include "report_overview/report_history_table.html" %}
{% include "partials/list_paginator.html" %}

<section>
<div class="horizontal-scroll">
<h2>{% translate "Reports history" %}</h2>
<p>{% translate "An overview of all your generated reports." %}</p>
<p class="de-emphasized">
{% blocktranslate with length=reports|length total=total_oois %}Showing {{ length }} of {{ total }} reports{% endblocktranslate %}
</p>
{% include "report_overview/report_history_table.html" %}
{% include "partials/list_paginator.html" %}

</div>
</section>
</div>
</section>
</main>
{% endblock content %}
16 changes: 0 additions & 16 deletions rocky/reports/templates/report_overview/report_overview.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@
<div>
<nav class="tabs" aria-label="{% translate "Plugins Navigation" %}">
<ul>
<li {% if active == "recent" %}aria-current="page"{% endif %}>
<a href="">{% translate "Recent" %}</a>
</li>
<li {% if active == "presets" %}aria-current="page"{% endif %}>
<a href="">{% translate "Presets" %}</a>
</li>
<li {% if active == "scheduled" %}aria-current="page"{% endif %}>
<a href="">{% translate "Scheduled" %}</a>
</li>
<li {% if active == "folders" %}aria-current="page"{% endif %}>
<a href="">{% translate "Folders" %}</a>
<a href="{% url 'scheduled_reports' organization.code %}">{% translate "Scheduled" %}</a>
</li>
<li {% if active == "history" %}aria-current="page"{% endif %}>
<a href="{% url 'report_history' organization.code %}">{% translate "History" %}</a>
Expand Down
26 changes: 26 additions & 0 deletions rocky/reports/templates/report_overview/scheduled_reports.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% extends "layouts/base.html" %}

{% load i18n %}
{% load static %}

{% block content %}
{% include "header.html" %}

<main id="main-content" tabindex="-1" class="katalogus">
<section>
{% include "report_overview/report_overview_header.html" %}
{% include "report_overview/report_overview_navigation.html" with active="scheduled" %}

<div class="horizontal-scroll">
<h2>{% translate "Scheduled reports" %}</h2>
<p>{% translate "View your scheduled reports." %}</p>
<p class="de-emphasized">
{% blocktranslate with length=scheduled_reports|length total=total_oois %}Showing {{ length }} scheduled reports{% endblocktranslate %}
</p>
{% include "report_overview/scheduled_reports_table.html" %}
{% include "partials/list_paginator.html" %}

</div>
</section>
</main>
{% endblock content %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{% load i18n %}
{% load ooi_extra %}
{% load report_extra %}

<div class="horizontal-scroll">
<table>
<caption class="visually-hidden">{% translate "Scheduled reports:" %}</caption>
<thead>
<tr>
<th scope="col">{% translate "Report Name" %}</th>
<th scope="col">{% translate "Subreport Name" %}</th>
<th scope="col">{% translate "Report types" %}</th>
<th scope="col">{% translate "Scheduled for" %}</th>
<th scope="col">{% translate "Recurrence" %}</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{% for schedule in scheduled_reports %}
{% if schedule.recipe %}
<tr>
<td class="nowrap">{{ schedule.recipe.report_name_format }}</td>
<td class="nowrap">{{ schedule.recipe.subreport_name_format }}</td>
<td>
{% for report_type in schedule.recipe.report_types %}
{% if forloop.counter0 < 2 %}
<span class="label tags-color-{{ report_type|get_report_type_label_style }}">{{ report_type|get_report_type_name }}</span>
{% endif %}
{% if forloop.counter0 == 2 %}
<span class="label tags-color-grey-2">+ {{ schedule.recipe.report_types|length|add:"-2" }}</span>
{% endif %}
{% endfor %}
Comment on lines +25 to +32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better for accessibility if these were in a <ul>.

</td>
<td class="nowrap">{{ schedule.deadline_at }}</td>
<td class="nowrap">{{ schedule.cron }}</td>
{% if schedule.reports %}
<td class="actions">
<button class="expando-button"
data-icon-open-class="icon ti-chevron-down"
data-icon-close-class="icon ti-chevron-up"
data-close-label="{% translate "Close details" %}">
{% translate "Open details" %}
</button>
</td>
{% else %}
<td></td>
{% endif %}
</tr>
{% if schedule.reports %}
<tr class="expando-row">
<td colspan="6">
<table>
<caption class="visually-hidden">{% translate "Scheduled Reports:" %}</caption>
<thead>
<tr>
<th scope="col">{% translate "Name" %}</th>
<th scope="col">{% translate "Report type" %}</th>
<th scope="col">{% translate "Input Object" %}</th>
<th scope="col">{% translate "Reference date" %}</th>
<th scope="col">{% translate "Creation date" %}</th>
</tr>
</thead>
<tbody>
{% for report in schedule.reports %}
<tr>
<td>
<a href="{% url "view_report" organization.code %}?report_id={{ report.reference }}&observed_at={{ report.observed_at|date:"Y-m-d H:i:s:u" }}"
title="{% translate "Show report details" %}">{{ report.name }}</a>
</td>
<td>
<span class="label tags-color-{{ report.report_type|get_report_type_label_style }}">{{ report.report_type|get_report_type_name }}</span>
</td>
<td>
{% for ooi in report.input_oois %}<span>{{ ooi|human_readable }}</span>{% endfor %}
</td>
<td class="nowrap">{{ report.observed_at|date }}</td>
<td class="nowrap">{{ report.date_generated }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
3 changes: 2 additions & 1 deletion rocky/reports/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
ReportTypesSelectionMultiReportView,
SetupScanMultiReportView,
)
from reports.views.report_overview import ReportHistoryView, SubreportView
from reports.views.report_overview import ReportHistoryView, ScheduledReportsView, SubreportView

# Report overview urls
urlpatterns = [
path("", ReportsLandingView.as_view(), name="reports"),
path("scheduled-reports/", ScheduledReportsView.as_view(), name="scheduled_reports"),
path("report-history/", ReportHistoryView.as_view(), name="report_history"),
path("report-history/subreports", SubreportView.as_view(), name="subreports"),
]
Expand Down
2 changes: 1 addition & 1 deletion rocky/reports/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:

self.create_report_schedule(report_recipe)

return redirect(reverse("report_history", kwargs={"organization_code": self.organization.code}))
return redirect(reverse("scheduled_reports", kwargs={"organization_code": self.organization.code}))

messages.error(request, _("Empty name should not be possible."))
return PostRedirect(self.get_previous())
Expand Down
63 changes: 62 additions & 1 deletion rocky/reports/views/report_overview.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
from datetime import datetime
from typing import Any

import structlog
from django.contrib import messages
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.views.generic import ListView

from octopoes.models import Reference
from octopoes.models.exception import ObjectNotFoundException
from octopoes.models.ooi.reports import Report, ReportRecipe
from reports.views.base import ReportBreadcrumbs, get_selection
from rocky.paginator import RockyPaginator
from rocky.views.mixins import OctopoesView, ReportList
from rocky.views.scheduler import SchedulerView

logger = structlog.get_logger(__name__)


class BreadcrumbsReportOverviewView(ReportBreadcrumbs):
Expand All @@ -25,6 +36,56 @@ def build_breadcrumbs(self):
return breadcrumbs


class ScheduledReportsView(BreadcrumbsReportOverviewView, SchedulerView, ListView):
"""
Shows all the reports that have ever been generated for the organization.
"""

paginate_by = 20
breadcrumbs_step = 2
context_object_name = "reports"
paginator = RockyPaginator
template_name = "report_overview/scheduled_reports.html"
task_type = "report"
context_object_name = "scheduled_reports"

def get_recipe_ooi_tree(self, ooi_pk: str) -> ReportRecipe | None:
try:
return self.octopoes_api_connector.get_tree(
Reference.from_str(f"ReportRecipe|{ooi_pk}"),
valid_time=self.observed_at,
depth=1,
types={ReportRecipe, Report},
)
except ObjectNotFoundException:
return messages.error(self.request, f"Report recipe with id {ooi_pk} not found.")

def get_queryset(self) -> list[dict[str, Any]]:
report_schedules = self.get_report_schedules()

recipes = []
if report_schedules:
for schedule in report_schedules:
recipe_id = schedule["data"]["report_recipe_id"]
# TODO: This is a workaround to get the recipes and reports.
# We should create an endpoint for this in octopoes
recipe_ooi_tree = self.get_recipe_ooi_tree(recipe_id)
if recipe_ooi_tree is not None:
recipe_tree = recipe_ooi_tree.store.values()
recipe_ooi = [ooi for ooi in recipe_tree if isinstance(ooi, ReportRecipe)][0]
report_oois = [ooi for ooi in recipe_tree if isinstance(ooi, Report)]
recipes.append(
{
"recipe": recipe_ooi,
"cron": schedule["schedule"],
"deadline_at": datetime.fromisoformat(schedule["deadline_at"]),
"reports": report_oois,
}
)

return recipes


class ReportHistoryView(BreadcrumbsReportOverviewView, OctopoesView, ListView):
"""
Shows all the reports that have ever been generated for the organization.
Expand All @@ -34,7 +95,7 @@ class ReportHistoryView(BreadcrumbsReportOverviewView, OctopoesView, ListView):
breadcrumbs_step = 2
context_object_name = "reports"
paginator = RockyPaginator
template_name = "report_overview/report_overview.html"
template_name = "report_overview/report_history.html"

def get_queryset(self) -> ReportList:
return ReportList(
Expand Down
Loading