From 4bc2e57aefedb4533308a29eaf278658d425e327 Mon Sep 17 00:00:00 2001 From: Anne Schuth Date: Tue, 15 Oct 2024 08:28:30 +0200 Subject: [PATCH 1/5] Fix copy project details --- amt/locale/base.pot | 57 +++++++-------- amt/locale/en_US/LC_MESSAGES/messages.mo | Bin 451 -> 451 bytes amt/locale/en_US/LC_MESSAGES/messages.po | 60 ++++++++-------- amt/locale/nl_NL/LC_MESSAGES/messages.mo | Bin 7179 -> 7193 bytes amt/locale/nl_NL/LC_MESSAGES/messages.po | 66 +++++++++--------- .../templates/projects/details_base.html.j2 | 4 +- .../templates/projects/details_data.html.j2 | 5 +- .../templates/projects/details_info.html.j2 | 3 - .../projects/details_instruments.html.j2 | 5 +- .../projects/details_requirements.html.j2 | 3 - 10 files changed, 95 insertions(+), 108 deletions(-) diff --git a/amt/locale/base.pot b/amt/locale/base.pot index a7e53ed3c..4c2766225 100644 --- a/amt/locale/base.pot +++ b/amt/locale/base.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-14 12:11+0200\n" +"POT-Creation-Date: 2024-10-15 08:45+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -205,12 +205,16 @@ msgstr "" msgid "Email" msgstr "" -#: amt/site/templates/auth/profile.html.j2:40 +#: amt/site/templates/auth/profile.html.j2:49 #: amt/site/templates/parts/header.html.j2:92 #: amt/site/templates/parts/header.html.j2:151 msgid "Language" msgstr "" +#: amt/site/templates/auth/profile.html.j2:54 +msgid "Select language" +msgstr "" + #: amt/site/templates/errors/AMTAuthorizationError_401.html.j2:5 msgid "Not logged in" msgstr "" @@ -220,7 +224,7 @@ msgid "Please login to view this page" msgstr "" #: amt/site/templates/errors/AMTAuthorizationError_401.html.j2:11 -#: amt/site/templates/pages/landingpage.html.j2:16 +#: amt/site/templates/pages/landingpage.html.j2:17 #: amt/site/templates/parts/header.html.j2:103 #: amt/site/templates/parts/header.html.j2:161 msgid "Login" @@ -251,10 +255,10 @@ msgid "Reviewing" msgstr "" #: amt/site/templates/macros/tasks.html.j2:32 -#: amt/site/templates/projects/details_base.html.j2:22 -#: amt/site/templates/projects/details_base.html.j2:43 -#: amt/site/templates/projects/details_base.html.j2:69 -#: amt/site/templates/projects/details_base.html.j2:91 +#: amt/site/templates/projects/details_base.html.j2:20 +#: amt/site/templates/projects/details_base.html.j2:41 +#: amt/site/templates/projects/details_base.html.j2:67 +#: amt/site/templates/projects/details_base.html.j2:89 msgid "Done" msgstr "" @@ -265,7 +269,7 @@ msgstr "" #: amt/site/templates/pages/assessment_card.html.j2:7 #: amt/site/templates/pages/model_card.html.j2:6 #: amt/site/templates/pages/system_card.html.j2:4 -#: amt/site/templates/projects/details_info.html.j2:35 +#: amt/site/templates/projects/details_info.html.j2:32 msgid "Last updated" msgstr "" @@ -333,56 +337,53 @@ msgstr "" msgid "Everyone is welcome to make comments and suggestions." msgstr "" -#: amt/site/templates/projects/details_base.html.j2:3 -#: amt/site/templates/projects/details_data.html.j2:3 -#: amt/site/templates/projects/details_info.html.j2:3 -#: amt/site/templates/projects/details_instruments.html.j2:3 -#: amt/site/templates/projects/details_requirements.html.j2:3 -msgid "AMT Placeholder information page" -msgstr "" - -#: amt/site/templates/projects/details_base.html.j2:20 +#: amt/site/templates/projects/details_base.html.j2:18 msgid "Does the algorithm meet the requirements?" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:41 -#: amt/site/templates/projects/details_base.html.j2:89 +#: amt/site/templates/projects/details_base.html.j2:39 +#: amt/site/templates/projects/details_base.html.j2:87 msgid "To do" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:55 +#: amt/site/templates/projects/details_base.html.j2:53 msgid "Go to all requirements" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:66 +#: amt/site/templates/projects/details_base.html.j2:64 msgid "Which instruments are executed?" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:103 +#: amt/site/templates/projects/details_base.html.j2:101 msgid "Go to all instruments" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:10 +#: amt/site/templates/projects/details_data.html.j2:3 +#: amt/site/templates/projects/details_instruments.html.j2:3 +msgid "To be implemented" +msgstr "" + +#: amt/site/templates/projects/details_info.html.j2:7 msgid "Description" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:14 +#: amt/site/templates/projects/details_info.html.j2:11 msgid "Repository" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:20 +#: amt/site/templates/projects/details_info.html.j2:17 msgid "Project code" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:24 +#: amt/site/templates/projects/details_info.html.j2:21 msgid "Lifecyle" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:39 +#: amt/site/templates/projects/details_info.html.j2:36 msgid "Labels" msgstr "" -#: amt/site/templates/projects/details_requirements.html.j2:22 +#: amt/site/templates/projects/details_requirements.html.j2:19 msgid "measures executed" msgstr "" diff --git a/amt/locale/en_US/LC_MESSAGES/messages.mo b/amt/locale/en_US/LC_MESSAGES/messages.mo index 0e5d05bbf1389627fe3d43ba2bcec674dc7baf72..3ef07abb975661f39e93c8ddb4f75aaa7af0066d 100644 GIT binary patch delta 18 ZcmX@ie3*H{M0QgJ0}Cq?(~UE<838$(1&ROw delta 18 ZcmX@ie3*H{M0OJeLnA9g!;Lev838#$1$_Vj diff --git a/amt/locale/en_US/LC_MESSAGES/messages.po b/amt/locale/en_US/LC_MESSAGES/messages.po index 28eeecf33..4347e1233 100644 --- a/amt/locale/en_US/LC_MESSAGES/messages.po +++ b/amt/locale/en_US/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-14 12:11+0200\n" +"POT-Creation-Date: 2024-10-15 08:45+0200\n" "PO-Revision-Date: 2024-07-25 21:01+0200\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" @@ -206,12 +206,16 @@ msgstr "" msgid "Email" msgstr "" -#: amt/site/templates/auth/profile.html.j2:40 +#: amt/site/templates/auth/profile.html.j2:49 #: amt/site/templates/parts/header.html.j2:92 #: amt/site/templates/parts/header.html.j2:151 msgid "Language" msgstr "" +#: amt/site/templates/auth/profile.html.j2:54 +msgid "Select language" +msgstr "" + #: amt/site/templates/errors/AMTAuthorizationError_401.html.j2:5 msgid "Not logged in" msgstr "" @@ -221,7 +225,7 @@ msgid "Please login to view this page" msgstr "" #: amt/site/templates/errors/AMTAuthorizationError_401.html.j2:11 -#: amt/site/templates/pages/landingpage.html.j2:16 +#: amt/site/templates/pages/landingpage.html.j2:17 #: amt/site/templates/parts/header.html.j2:103 #: amt/site/templates/parts/header.html.j2:161 msgid "Login" @@ -252,10 +256,10 @@ msgid "Reviewing" msgstr "" #: amt/site/templates/macros/tasks.html.j2:32 -#: amt/site/templates/projects/details_base.html.j2:22 -#: amt/site/templates/projects/details_base.html.j2:43 -#: amt/site/templates/projects/details_base.html.j2:69 -#: amt/site/templates/projects/details_base.html.j2:91 +#: amt/site/templates/projects/details_base.html.j2:20 +#: amt/site/templates/projects/details_base.html.j2:41 +#: amt/site/templates/projects/details_base.html.j2:67 +#: amt/site/templates/projects/details_base.html.j2:89 msgid "Done" msgstr "" @@ -266,7 +270,7 @@ msgstr "" #: amt/site/templates/pages/assessment_card.html.j2:7 #: amt/site/templates/pages/model_card.html.j2:6 #: amt/site/templates/pages/system_card.html.j2:4 -#: amt/site/templates/projects/details_info.html.j2:35 +#: amt/site/templates/projects/details_info.html.j2:32 msgid "Last updated" msgstr "" @@ -334,56 +338,53 @@ msgstr "" msgid "Everyone is welcome to make comments and suggestions." msgstr "" -#: amt/site/templates/projects/details_base.html.j2:3 -#: amt/site/templates/projects/details_data.html.j2:3 -#: amt/site/templates/projects/details_info.html.j2:3 -#: amt/site/templates/projects/details_instruments.html.j2:3 -#: amt/site/templates/projects/details_requirements.html.j2:3 -msgid "AMT Placeholder information page" -msgstr "" - -#: amt/site/templates/projects/details_base.html.j2:20 +#: amt/site/templates/projects/details_base.html.j2:18 msgid "Does the algorithm meet the requirements?" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:41 -#: amt/site/templates/projects/details_base.html.j2:89 +#: amt/site/templates/projects/details_base.html.j2:39 +#: amt/site/templates/projects/details_base.html.j2:87 msgid "To do" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:55 +#: amt/site/templates/projects/details_base.html.j2:53 msgid "Go to all requirements" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:66 +#: amt/site/templates/projects/details_base.html.j2:64 msgid "Which instruments are executed?" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:103 +#: amt/site/templates/projects/details_base.html.j2:101 msgid "Go to all instruments" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:10 +#: amt/site/templates/projects/details_data.html.j2:3 +#: amt/site/templates/projects/details_instruments.html.j2:3 +msgid "To be implemented" +msgstr "" + +#: amt/site/templates/projects/details_info.html.j2:7 msgid "Description" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:14 +#: amt/site/templates/projects/details_info.html.j2:11 msgid "Repository" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:20 +#: amt/site/templates/projects/details_info.html.j2:17 msgid "Project code" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:24 +#: amt/site/templates/projects/details_info.html.j2:21 msgid "Lifecyle" msgstr "" -#: amt/site/templates/projects/details_info.html.j2:39 +#: amt/site/templates/projects/details_info.html.j2:36 msgid "Labels" msgstr "" -#: amt/site/templates/projects/details_requirements.html.j2:22 +#: amt/site/templates/projects/details_requirements.html.j2:19 msgid "measures executed" msgstr "" @@ -466,6 +467,3 @@ msgstr "" msgid "Copy results and close" msgstr "" -#~ msgid "Algortime Management Toolkit" -#~ msgstr "" - diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.mo b/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Y2s#FCk;5=+2k!sZY z?|Df}sGTeGQ4_8}?SX|cE_7^Gq5`(yNZgNFqfR78>&6vW#aYwl>+pPq3YbMb)!#u? zE`+L387h$qR01`qM7N_R7~9K*O5TBb@gk~JJ?P*=@A)@W-~_g`0;He@NXG(nymloj zp(RKct3g$`0mow#mf}gIxG{Upg$DkNMVL%OGoOySzmy*ZScfdHHKG#Sj!JwN=3*O; zLKpM#v3LJB>J$vi`qwWHRjDzk{b!|rFU-nOnJ+@kbUA9^I@C9sp>BJE4);5$^@WX|$V9E|<6wnw;7=IuyHtQ%G0XQ&yzMRojy`d9l4l~^ie z(y7TnJ$JnJSX3fYa2A%JPD2YSUN@@$V~m~P;w2ZWaR*1B5_?ezlyDT}3}pY=TvUaY zp-LJ-ZK8T)a@LC4WXDmb;uf;1b_W&b6|x%k9+eHsrf6UY>LR4?%;ltpET3 diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.po b/amt/locale/nl_NL/LC_MESSAGES/messages.po index 478965fe7..3a76a8374 100644 --- a/amt/locale/nl_NL/LC_MESSAGES/messages.po +++ b/amt/locale/nl_NL/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-14 12:11+0200\n" +"POT-Creation-Date: 2024-10-15 08:45+0200\n" "PO-Revision-Date: 2024-07-25 21:01+0200\n" "Last-Translator: FULL NAME \n" "Language: nl_NL\n" @@ -214,12 +214,16 @@ msgstr "Naam" msgid "Email" msgstr "Email" -#: amt/site/templates/auth/profile.html.j2:40 +#: amt/site/templates/auth/profile.html.j2:49 #: amt/site/templates/parts/header.html.j2:92 #: amt/site/templates/parts/header.html.j2:151 msgid "Language" msgstr "Taal" +#: amt/site/templates/auth/profile.html.j2:54 +msgid "Select language" +msgstr "Selecteer taal" + #: amt/site/templates/errors/AMTAuthorizationError_401.html.j2:5 msgid "Not logged in" msgstr "Niet ingelogd" @@ -229,7 +233,7 @@ msgid "Please login to view this page" msgstr "Meld u aan om deze pagina te bekijken" #: amt/site/templates/errors/AMTAuthorizationError_401.html.j2:11 -#: amt/site/templates/pages/landingpage.html.j2:16 +#: amt/site/templates/pages/landingpage.html.j2:17 #: amt/site/templates/parts/header.html.j2:103 #: amt/site/templates/parts/header.html.j2:161 msgid "Login" @@ -260,10 +264,10 @@ msgid "Reviewing" msgstr "Beoordelen" #: amt/site/templates/macros/tasks.html.j2:32 -#: amt/site/templates/projects/details_base.html.j2:22 -#: amt/site/templates/projects/details_base.html.j2:43 -#: amt/site/templates/projects/details_base.html.j2:69 -#: amt/site/templates/projects/details_base.html.j2:91 +#: amt/site/templates/projects/details_base.html.j2:20 +#: amt/site/templates/projects/details_base.html.j2:41 +#: amt/site/templates/projects/details_base.html.j2:67 +#: amt/site/templates/projects/details_base.html.j2:89 msgid "Done" msgstr "Afgerond" @@ -274,7 +278,7 @@ msgstr "Onbekend" #: amt/site/templates/pages/assessment_card.html.j2:7 #: amt/site/templates/pages/model_card.html.j2:6 #: amt/site/templates/pages/system_card.html.j2:4 -#: amt/site/templates/projects/details_info.html.j2:35 +#: amt/site/templates/projects/details_info.html.j2:32 msgid "Last updated" msgstr "Laatst bijgewerkt" @@ -342,56 +346,53 @@ msgstr "Deze website is in ontwikkeling. Alle versies ontstaan op een open manie msgid "Everyone is welcome to make comments and suggestions." msgstr "Iedereen mag opmerkingen en suggesties doen." -#: amt/site/templates/projects/details_base.html.j2:3 -#: amt/site/templates/projects/details_data.html.j2:3 -#: amt/site/templates/projects/details_info.html.j2:3 -#: amt/site/templates/projects/details_instruments.html.j2:3 -#: amt/site/templates/projects/details_requirements.html.j2:3 -msgid "AMT Placeholder information page" -msgstr "AMT Placeholder informatie pagina's" - -#: amt/site/templates/projects/details_base.html.j2:20 +#: amt/site/templates/projects/details_base.html.j2:18 msgid "Does the algorithm meet the requirements?" -msgstr "Voldoet het algoritme aan alle vereisten?" +msgstr "Voldoet het algoritme aan de vereisten?" -#: amt/site/templates/projects/details_base.html.j2:41 -#: amt/site/templates/projects/details_base.html.j2:89 +#: amt/site/templates/projects/details_base.html.j2:39 +#: amt/site/templates/projects/details_base.html.j2:87 msgid "To do" msgstr "Te doen" -#: amt/site/templates/projects/details_base.html.j2:55 +#: amt/site/templates/projects/details_base.html.j2:53 msgid "Go to all requirements" -msgstr "Ga naar alle vereisten" +msgstr "Ga naar alle Vereisten" -#: amt/site/templates/projects/details_base.html.j2:66 +#: amt/site/templates/projects/details_base.html.j2:64 msgid "Which instruments are executed?" msgstr "Welke instrumenten zijn uitgevoerd?" -#: amt/site/templates/projects/details_base.html.j2:103 +#: amt/site/templates/projects/details_base.html.j2:101 msgid "Go to all instruments" -msgstr "Ga naar alle instrumenten" +msgstr "Ga naar all instrumenten" -#: amt/site/templates/projects/details_info.html.j2:10 +#: amt/site/templates/projects/details_data.html.j2:3 +#: amt/site/templates/projects/details_instruments.html.j2:3 +msgid "To be implemented" +msgstr "Nog te implementeren" + +#: amt/site/templates/projects/details_info.html.j2:7 msgid "Description" msgstr "Omschrijving" -#: amt/site/templates/projects/details_info.html.j2:14 +#: amt/site/templates/projects/details_info.html.j2:11 msgid "Repository" msgstr "Repository" -#: amt/site/templates/projects/details_info.html.j2:20 +#: amt/site/templates/projects/details_info.html.j2:17 msgid "Project code" msgstr "Project" -#: amt/site/templates/projects/details_info.html.j2:24 +#: amt/site/templates/projects/details_info.html.j2:21 msgid "Lifecyle" msgstr "Levenscyclus" -#: amt/site/templates/projects/details_info.html.j2:39 +#: amt/site/templates/projects/details_info.html.j2:36 msgid "Labels" msgstr "Labels" -#: amt/site/templates/projects/details_requirements.html.j2:22 +#: amt/site/templates/projects/details_requirements.html.j2:19 msgid "measures executed" msgstr "maatregelen uitgevoerd" @@ -479,6 +480,3 @@ msgstr "Maak project" msgid "Copy results and close" msgstr "Resultaten overnemen en sluiten" -#~ msgid "Algortime Management Toolkit" -#~ msgstr "Algoritme Management Toolkit" - diff --git a/amt/site/templates/projects/details_base.html.j2 b/amt/site/templates/projects/details_base.html.j2 index eec4d3a7c..0189aef40 100644 --- a/amt/site/templates/projects/details_base.html.j2 +++ b/amt/site/templates/projects/details_base.html.j2 @@ -1,7 +1,5 @@ {% extends 'layouts/base.html.j2' %} -{% block title %} - {% trans %}AMT Placeholder information page{% endtrans %} -{% endblock %} +{% block title %}{{ project.name }} | AMT{% endblock %} {% block content %}
diff --git a/amt/site/templates/projects/details_data.html.j2 b/amt/site/templates/projects/details_data.html.j2 index b505f2f2a..22c9ad136 100644 --- a/amt/site/templates/projects/details_data.html.j2 +++ b/amt/site/templates/projects/details_data.html.j2 @@ -1,5 +1,4 @@ {% extends 'projects/details_base.html.j2' %} -{% block title %} - {% trans %}AMT Placeholder information page{% endtrans %} +{% block detail_content %} +
{% trans %}To be implemented{% endtrans %}
{% endblock %} -{% block detail_content %}
To be implemented
{% endblock %} diff --git a/amt/site/templates/projects/details_info.html.j2 b/amt/site/templates/projects/details_info.html.j2 index 52eb926d0..d74057bff 100644 --- a/amt/site/templates/projects/details_info.html.j2 +++ b/amt/site/templates/projects/details_info.html.j2 @@ -1,7 +1,4 @@ {% extends 'projects/details_base.html.j2' %} -{% block title %} - {% trans %}AMT Placeholder information page{% endtrans %} -{% endblock %} {% block detail_content %}
diff --git a/amt/site/templates/projects/details_instruments.html.j2 b/amt/site/templates/projects/details_instruments.html.j2 index b505f2f2a..22c9ad136 100644 --- a/amt/site/templates/projects/details_instruments.html.j2 +++ b/amt/site/templates/projects/details_instruments.html.j2 @@ -1,5 +1,4 @@ {% extends 'projects/details_base.html.j2' %} -{% block title %} - {% trans %}AMT Placeholder information page{% endtrans %} +{% block detail_content %} +
{% trans %}To be implemented{% endtrans %}
{% endblock %} -{% block detail_content %}
To be implemented
{% endblock %} diff --git a/amt/site/templates/projects/details_requirements.html.j2 b/amt/site/templates/projects/details_requirements.html.j2 index 1d77c09e1..28bfdc0ac 100644 --- a/amt/site/templates/projects/details_requirements.html.j2 +++ b/amt/site/templates/projects/details_requirements.html.j2 @@ -1,7 +1,4 @@ {% extends 'projects/details_base.html.j2' %} -{% block title %} - {% trans %}AMT Placeholder information page{% endtrans %} -{% endblock %} {% block detail_content %}
{% for (requirement, measures) in requirements_and_measures %} From 79e643089b3d5da23b56e258faf0e7ffb33c49a1 Mon Sep 17 00:00:00 2001 From: Anne Schuth Date: Tue, 15 Oct 2024 20:36:39 +0200 Subject: [PATCH 2/5] Add model inference for demo --- amt/api/navigation.py | 3 + amt/api/routes/project.py | 37 ++++++ amt/locale/base.pot | 38 +++++- amt/locale/en_US/LC_MESSAGES/messages.mo | Bin 451 -> 451 bytes amt/locale/en_US/LC_MESSAGES/messages.po | 44 ++++++- amt/locale/nl_NL/LC_MESSAGES/messages.mo | Bin 7193 -> 7638 bytes amt/locale/nl_NL/LC_MESSAGES/messages.po | 38 +++++- .../projects/details_inference.html.j2 | 124 ++++++++++++++++++ 8 files changed, 281 insertions(+), 3 deletions(-) create mode 100644 amt/site/templates/projects/details_inference.html.j2 diff --git a/amt/api/navigation.py b/amt/api/navigation.py index b3089e6ae..a50d3b486 100644 --- a/amt/api/navigation.py +++ b/amt/api/navigation.py @@ -98,6 +98,9 @@ class Navigation: PROJECT_DETAILS = BaseNavigationItem( display_text=DisplayText.DETAILS, url="/project/{project_id}/details/system_card" ) + PROJECT_MODEL = BaseNavigationItem( + display_text=DisplayText.MODEL, url="/project/{project_id}/details/model/inference" + ) PROJECT_NEW = BaseNavigationItem(display_text=DisplayText.NEW, url="/projects/new") PROJECT_SYSTEM_INFO = BaseNavigationItem(display_text=DisplayText.INFO, url="/project/{project_id}/details") PROJECT_SYSTEM_ALGORITHM_DETAILS = BaseNavigationItem( diff --git a/amt/api/routes/project.py b/amt/api/routes/project.py index 824615c6d..e0f526614 100644 --- a/amt/api/routes/project.py +++ b/amt/api/routes/project.py @@ -77,6 +77,7 @@ def get_project_details_tabs(request: Request) -> list[NavigationItem]: [ Navigation.PROJECT_SYSTEM_INFO, Navigation.PROJECT_SYSTEM_ALGORITHM_DETAILS, + Navigation.PROJECT_MODEL, Navigation.PROJECT_REQUIREMENTS, Navigation.PROJECT_DATA_CARD, Navigation.PROJECT_TASKS, @@ -242,6 +243,42 @@ async def get_system_card( return templates.TemplateResponse(request, "pages/system_card.html.j2", context) +@router.get("/{project_id}/details/model/inference") +async def get_project_inference( + request: Request, project_id: int, projects_service: Annotated[ProjectsService, Depends(ProjectsService)] +) -> HTMLResponse: + project = get_project_or_error(project_id, projects_service, request) + + breadcrumbs = resolve_base_navigation_items( + [ + Navigation.PROJECTS_ROOT, + BaseNavigationItem(custom_display_text=project.name, url="/project/{project_id}/details/model/inference"), + Navigation.PROJECT_MODEL, + ], + request, + ) + + system_card_data = get_system_card_data() + instrument_state = get_instrument_state() + requirements_state = get_requirements_state(project.system_card) + + tab_items = get_project_details_tabs(request) + + context = { + "lifecycle": get_lifecycle(project.lifecycle, request), + "last_edited": project.last_edited, + "system_card": system_card_data, + "instrument_state": instrument_state, + "requirements_state": requirements_state, + "project": project, + "project_id": project.id, + "breadcrumbs": breadcrumbs, + "tab_items": tab_items, + } + + return templates.TemplateResponse(request, "projects/details_inference.html.j2", context) + + # !!! # Implementation of this endpoint is for now independent of the project ID, meaning # that the same system card is rendered for all project ID's. This is due to the fact diff --git a/amt/locale/base.pot b/amt/locale/base.pot index 4c2766225..c907d726f 100644 --- a/amt/locale/base.pot +++ b/amt/locale/base.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-15 08:45+0200\n" +"POT-Creation-Date: 2024-10-15 20:42+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -363,6 +363,42 @@ msgstr "" msgid "To be implemented" msgstr "" +#: amt/site/templates/projects/details_inference.html.j2:7 +msgid "Sepal length:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:16 +msgid "Sepal width:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:25 +msgid "Petal length:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:34 +msgid "Petal width:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:47 +msgid "Run inference" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:51 +msgid "Output" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:53 +msgid "Undefined" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:57 +msgid "Output Probabilities" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:116 +msgid "Failed to run inference: " +msgstr "" + #: amt/site/templates/projects/details_info.html.j2:7 msgid "Description" msgstr "" diff --git a/amt/locale/en_US/LC_MESSAGES/messages.mo b/amt/locale/en_US/LC_MESSAGES/messages.mo index 3ef07abb975661f39e93c8ddb4f75aaa7af0066d..e303acbd4ff53340aa59f658e8bcd820d78578e7 100644 GIT binary patch delta 16 XcmX@ie3*H{WL6^sD-)xQGqf22Fm44b delta 16 XcmX@ie3*H{WL5(UD-+X=Gqf22FslVM diff --git a/amt/locale/en_US/LC_MESSAGES/messages.po b/amt/locale/en_US/LC_MESSAGES/messages.po index 4347e1233..d54c1ee1a 100644 --- a/amt/locale/en_US/LC_MESSAGES/messages.po +++ b/amt/locale/en_US/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-15 08:45+0200\n" +"POT-Creation-Date: 2024-10-15 20:42+0200\n" "PO-Revision-Date: 2024-07-25 21:01+0200\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" @@ -364,6 +364,42 @@ msgstr "" msgid "To be implemented" msgstr "" +#: amt/site/templates/projects/details_inference.html.j2:7 +msgid "Sepal length:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:16 +msgid "Sepal width:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:25 +msgid "Petal length:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:34 +msgid "Petal width:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:47 +msgid "Run inference" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:51 +msgid "Output" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:53 +msgid "Undefined" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:57 +msgid "Output Probabilities" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:116 +msgid "Failed to run inference: " +msgstr "" + #: amt/site/templates/projects/details_info.html.j2:7 msgid "Description" msgstr "" @@ -467,3 +503,9 @@ msgstr "" msgid "Copy results and close" msgstr "" +#~ msgid "Algortime Management Toolkit" +#~ msgstr "" + +#~ msgid "Inference" +#~ msgstr "" + diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.mo b/amt/locale/nl_NL/LC_MESSAGES/messages.mo index 76c4d39278fed328b34860176174bb809097cc12..fc9f8012b4453b20721f1842044395ea57b95e81 100644 GIT binary patch delta 2181 zcmY+_dq~}79LMp;+cr0K=B0U3*U!r`Q%r2Jc2;Z@ZK#y8ixw`|apyPvZO3!m@tkdq z=mg0&WWwm+DiGTK(0^uNoe}g$w61K_m>8`funR~Gx!DY00RJ8AeC;kSz4sT|e*`>9%POcB*;tixtpf!$b&Pol;R<83&O^*Ckg z@8Tf!Pq70xF}M+r;Sxx8p%nf+w&H zU&36RMF(HURk(nfXAw1iDcznh<_8LmH2j8nShq40pb`0)79MKfi1*`WY{fYGa0Zq5 z1+2h%Y{F|;j^)g*M4M2FJ&a0to9fJOdMNNQeLU{OK~&)5s4YK>3j86aSAaT#CDac6 zh~#emuQXrEad#vVa9e$p#oh%1-@kKi>S=ML-qd|wc@`~ z3&>|bDVieGQB+|YHrw_+sBy#CiAPZheN@E$YpWJ$sLL|u3*1BfPog}IyG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R;C5G2FvGnde9*ljBHWi4?T9X%KC?Iw9`KArwWj1n1Q({(21imGg16F^ OhjY`vIfDMo8-D;cEvxMS diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.po b/amt/locale/nl_NL/LC_MESSAGES/messages.po index 3a76a8374..438776dbf 100644 --- a/amt/locale/nl_NL/LC_MESSAGES/messages.po +++ b/amt/locale/nl_NL/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-15 08:45+0200\n" +"POT-Creation-Date: 2024-10-15 20:42+0200\n" "PO-Revision-Date: 2024-07-25 21:01+0200\n" "Last-Translator: FULL NAME \n" "Language: nl_NL\n" @@ -372,6 +372,42 @@ msgstr "Ga naar all instrumenten" msgid "To be implemented" msgstr "Nog te implementeren" +#: amt/site/templates/projects/details_inference.html.j2:7 +msgid "Sepal length:" +msgstr "Kelkbladlengte:" + +#: amt/site/templates/projects/details_inference.html.j2:16 +msgid "Sepal width:" +msgstr "Kelkbladbreedte:" + +#: amt/site/templates/projects/details_inference.html.j2:25 +msgid "Petal length:" +msgstr "Kroonbladlengte:" + +#: amt/site/templates/projects/details_inference.html.j2:34 +msgid "Petal width:" +msgstr "Kroonbladbreedte:" + +#: amt/site/templates/projects/details_inference.html.j2:47 +msgid "Run inference" +msgstr "Voer inferentie uit" + +#: amt/site/templates/projects/details_inference.html.j2:51 +msgid "Output" +msgstr "Uitvoer" + +#: amt/site/templates/projects/details_inference.html.j2:53 +msgid "Undefined" +msgstr "Ongedefinieerd" + +#: amt/site/templates/projects/details_inference.html.j2:57 +msgid "Output Probabilities" +msgstr "Uitvoerwaarschijnlijkheden" + +#: amt/site/templates/projects/details_inference.html.j2:116 +msgid "Failed to run inference: " +msgstr "Inferentie uitvoeren mislukt: " + #: amt/site/templates/projects/details_info.html.j2:7 msgid "Description" msgstr "Omschrijving" diff --git a/amt/site/templates/projects/details_inference.html.j2 b/amt/site/templates/projects/details_inference.html.j2 new file mode 100644 index 000000000..914cc43b2 --- /dev/null +++ b/amt/site/templates/projects/details_inference.html.j2 @@ -0,0 +1,124 @@ +{% extends 'projects/details_base.html.j2' %} +{% block detail_content %} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans %}Sepal length:{% endtrans %} + +
{% trans %}Sepal width:{% endtrans %} + +
{% trans %}Petal length:{% endtrans %} + +
{% trans %}Petal width:{% endtrans %} + +
+ +
{% trans %}Output{% endtrans %} + {% trans %}Undefined{% endtrans %} +
{% trans %}Output Probabilities{% endtrans %} +
+
+
+ + +{% endblock %} From 22f2e957b3b132101e651eee281c66c7fe2fa983 Mon Sep 17 00:00:00 2001 From: Anne Schuth Date: Wed, 16 Oct 2024 08:59:20 +0200 Subject: [PATCH 3/5] change to woz model --- amt/locale/base.pot | 50 +++-- amt/locale/en_US/LC_MESSAGES/messages.mo | Bin 451 -> 451 bytes amt/locale/en_US/LC_MESSAGES/messages.po | 74 +++++-- amt/locale/nl_NL/LC_MESSAGES/messages.mo | Bin 7638 -> 7905 bytes amt/locale/nl_NL/LC_MESSAGES/messages.po | 66 +++--- .../projects/details_inference.html.j2 | 195 ++++++++++++------ 6 files changed, 264 insertions(+), 121 deletions(-) diff --git a/amt/locale/base.pot b/amt/locale/base.pot index c907d726f..1bab27312 100644 --- a/amt/locale/base.pot +++ b/amt/locale/base.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-15 20:42+0200\n" +"POT-Creation-Date: 2024-10-16 08:58+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -364,39 +364,59 @@ msgid "To be implemented" msgstr "" #: amt/site/templates/projects/details_inference.html.j2:7 -msgid "Sepal length:" +msgid "Floor area (m²):" msgstr "" #: amt/site/templates/projects/details_inference.html.j2:16 -msgid "Sepal width:" +msgid "Plot size (m²):" msgstr "" #: amt/site/templates/projects/details_inference.html.j2:25 -msgid "Petal length:" +msgid "Building year:" msgstr "" #: amt/site/templates/projects/details_inference.html.j2:34 -msgid "Petal width:" +msgid "Object type:" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:47 -msgid "Run inference" +#: amt/site/templates/projects/details_inference.html.j2:43 +msgid "Number of annexes:" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:51 -msgid "Output" +#: amt/site/templates/projects/details_inference.html.j2:52 +msgid "Neighborhood code:" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:53 -msgid "Undefined" +#: amt/site/templates/projects/details_inference.html.j2:61 +msgid "Quality rating:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:73 +msgid "Maintenance rating:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:85 +msgid "Amenities rating:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:97 +msgid "Location rating:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:113 +msgid "Estimate WOZ Value" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:57 -msgid "Output Probabilities" +#: amt/site/templates/projects/details_inference.html.j2:117 +msgid "Estimated WOZ Value" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:119 +msgid "Undefined" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:116 -msgid "Failed to run inference: " +#: amt/site/templates/projects/details_inference.html.j2:175 +msgid "Failed to estimate WOZ value: " msgstr "" #: amt/site/templates/projects/details_info.html.j2:7 diff --git a/amt/locale/en_US/LC_MESSAGES/messages.mo b/amt/locale/en_US/LC_MESSAGES/messages.mo index e303acbd4ff53340aa59f658e8bcd820d78578e7..332f50d134730b4e77ff78d7282ee9c1f0fb7a0d 100644 GIT binary patch delta 18 ZcmX@ie3*H{M0PU;0}Crti;Xk1838%E1&;s# delta 18 ZcmX@ie3*H{M0QgJBLgcFqm47P838$61%Utn diff --git a/amt/locale/en_US/LC_MESSAGES/messages.po b/amt/locale/en_US/LC_MESSAGES/messages.po index d54c1ee1a..28ae81ca1 100644 --- a/amt/locale/en_US/LC_MESSAGES/messages.po +++ b/amt/locale/en_US/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-15 20:42+0200\n" +"POT-Creation-Date: 2024-10-16 08:58+0200\n" "PO-Revision-Date: 2024-07-25 21:01+0200\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" @@ -365,39 +365,59 @@ msgid "To be implemented" msgstr "" #: amt/site/templates/projects/details_inference.html.j2:7 -msgid "Sepal length:" +msgid "Floor area (m²):" msgstr "" #: amt/site/templates/projects/details_inference.html.j2:16 -msgid "Sepal width:" +msgid "Plot size (m²):" msgstr "" #: amt/site/templates/projects/details_inference.html.j2:25 -msgid "Petal length:" +msgid "Building year:" msgstr "" #: amt/site/templates/projects/details_inference.html.j2:34 -msgid "Petal width:" +msgid "Object type:" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:47 -msgid "Run inference" +#: amt/site/templates/projects/details_inference.html.j2:43 +msgid "Number of annexes:" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:51 -msgid "Output" +#: amt/site/templates/projects/details_inference.html.j2:52 +msgid "Neighborhood code:" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:53 -msgid "Undefined" +#: amt/site/templates/projects/details_inference.html.j2:61 +msgid "Quality rating:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:73 +msgid "Maintenance rating:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:85 +msgid "Amenities rating:" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:97 +msgid "Location rating:" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:57 -msgid "Output Probabilities" +#: amt/site/templates/projects/details_inference.html.j2:113 +msgid "Estimate WOZ Value" msgstr "" -#: amt/site/templates/projects/details_inference.html.j2:116 -msgid "Failed to run inference: " +#: amt/site/templates/projects/details_inference.html.j2:117 +msgid "Estimated WOZ Value" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:119 +msgid "Undefined" +msgstr "" + +#: amt/site/templates/projects/details_inference.html.j2:175 +msgid "Failed to estimate WOZ value: " msgstr "" #: amt/site/templates/projects/details_info.html.j2:7 @@ -509,3 +529,27 @@ msgstr "" #~ msgid "Inference" #~ msgstr "" +#~ msgid "Sepal length:" +#~ msgstr "" + +#~ msgid "Sepal width:" +#~ msgstr "" + +#~ msgid "Petal length:" +#~ msgstr "" + +#~ msgid "Petal width:" +#~ msgstr "" + +#~ msgid "Run inference" +#~ msgstr "" + +#~ msgid "Output" +#~ msgstr "" + +#~ msgid "Output Probabilities" +#~ msgstr "" + +#~ msgid "Failed to run inference: " +#~ msgstr "" + diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.mo b/amt/locale/nl_NL/LC_MESSAGES/messages.mo index fc9f8012b4453b20721f1842044395ea57b95e81..fd8052eceac5a85feaad62ba7a0235d3f0c4f2b5 100644 GIT binary patch delta 2495 zcmY+^eQXp(7{~Fsf-Tfu-za?p%R*bARtl8Y91%?^sGw9a0zts+^_KR^^{(FSwUoCr zk?^9R;z^=l2nLNBgBnf)F(fLO7#l=mgn&U5NkoEC|IkECsD6KR5oosinVHVcJkPVU zJvHn6-KlfMgLfHzTz*ILdt{J$H-47q7?V$T1y*AOhu{l13|~P#cL0m94{PwO*Y`15 z~FTx7>*yHGU!8XcpjC>&tCs8}Fr2@yI zUd_Fz4MM0&Za|7_HX)bU!Hr^=-QM`?m{NuZXy}0qDwB^;<0p_L%(tkGen16w1(kU} z>bMm72Lc<8S@cIEm#N{Vd5y?aGZ!sfgi0Xcr~ZmC&A@tm6_sHHX{&U#ScuJ@kD(S? z<(WV|{}k$7Z$p)Ou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#i%2%LS0cksyH_yw`V$0 z#XE?4%j~j;7XOVtM~4DWB6Vagp?35ID$unu``N5_Qr=|=SL(dm?XqW<59P!XQ7asM zJ`@W@d+b1VUF!Ah2A6#;=TW;Lca`0q+mxS(4<+KJHI3C48|)6+Be`dNp?EN2MMBZO zcz>g5OSg`OduiCko`>xYPqRJcsmp1PwPEk$j@#6h1 zd)ilP-||)2^(C#o-HXGFsUaf( diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.po b/amt/locale/nl_NL/LC_MESSAGES/messages.po index 438776dbf..6bc7de8f5 100644 --- a/amt/locale/nl_NL/LC_MESSAGES/messages.po +++ b/amt/locale/nl_NL/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-15 20:42+0200\n" +"POT-Creation-Date: 2024-10-16 08:58+0200\n" "PO-Revision-Date: 2024-07-25 21:01+0200\n" "Last-Translator: FULL NAME \n" "Language: nl_NL\n" @@ -373,40 +373,60 @@ msgid "To be implemented" msgstr "Nog te implementeren" #: amt/site/templates/projects/details_inference.html.j2:7 -msgid "Sepal length:" -msgstr "Kelkbladlengte:" +msgid "Floor area (m²):" +msgstr "Vloeroppervlakte (m²):" #: amt/site/templates/projects/details_inference.html.j2:16 -msgid "Sepal width:" -msgstr "Kelkbladbreedte:" +msgid "Plot size (m²):" +msgstr "Perceelgrootte (m²):" #: amt/site/templates/projects/details_inference.html.j2:25 -msgid "Petal length:" -msgstr "Kroonbladlengte:" +msgid "Building year:" +msgstr "Bouwjaar:" #: amt/site/templates/projects/details_inference.html.j2:34 -msgid "Petal width:" -msgstr "Kroonbladbreedte:" +msgid "Object type:" +msgstr "Objecttype:" -#: amt/site/templates/projects/details_inference.html.j2:47 -msgid "Run inference" -msgstr "Voer inferentie uit" +#: amt/site/templates/projects/details_inference.html.j2:43 +msgid "Number of annexes:" +msgstr "Aantal bijgebouwen:" -#: amt/site/templates/projects/details_inference.html.j2:51 -msgid "Output" -msgstr "Uitvoer" +#: amt/site/templates/projects/details_inference.html.j2:52 +msgid "Neighborhood code:" +msgstr "Buurtcode:" -#: amt/site/templates/projects/details_inference.html.j2:53 +#: amt/site/templates/projects/details_inference.html.j2:61 +msgid "Quality rating:" +msgstr "Kwaliteitsbeoordeling:" + +#: amt/site/templates/projects/details_inference.html.j2:73 +msgid "Maintenance rating:" +msgstr "Onderhoudsbeoordeling:" + +#: amt/site/templates/projects/details_inference.html.j2:85 +msgid "Amenities rating:" +msgstr "Voorzieningenbeoordeling:" + +#: amt/site/templates/projects/details_inference.html.j2:97 +msgid "Location rating:" +msgstr "Locatiebeoordeling:" + +#: amt/site/templates/projects/details_inference.html.j2:113 +msgid "Estimate WOZ Value" +msgstr "WOZ-waarde schatten" + +#: amt/site/templates/projects/details_inference.html.j2:117 +msgid "Estimated WOZ Value" +msgstr "Geschatte WOZ-waarde" + +#: amt/site/templates/projects/details_inference.html.j2:119 msgid "Undefined" msgstr "Ongedefinieerd" -#: amt/site/templates/projects/details_inference.html.j2:57 -msgid "Output Probabilities" -msgstr "Uitvoerwaarschijnlijkheden" - -#: amt/site/templates/projects/details_inference.html.j2:116 -msgid "Failed to run inference: " -msgstr "Inferentie uitvoeren mislukt: " +#: amt/site/templates/projects/details_inference.html.j2:175 +msgid "Failed to estimate WOZ value: " +msgstr "Fout bij het schatten van de WOZ-waarde: " #: amt/site/templates/projects/details_info.html.j2:7 msgid "Description" diff --git a/amt/site/templates/projects/details_inference.html.j2 b/amt/site/templates/projects/details_inference.html.j2 index 914cc43b2..5339af992 100644 --- a/amt/site/templates/projects/details_inference.html.j2 +++ b/amt/site/templates/projects/details_inference.html.j2 @@ -4,39 +4,105 @@ - + + + + + + + + + + + + + - + - + - + + + + + + + + + + + + + @@ -44,19 +110,13 @@ - + - - - - @@ -64,61 +124,60 @@ {% endblock %} From 21dcdc10f8e7eb15e1bd422359580abc03b28469 Mon Sep 17 00:00:00 2001 From: ChristopherSpelt Date: Mon, 14 Oct 2024 15:15:45 +0200 Subject: [PATCH 4/5] Add modal for measures --- amt/api/routes/project.py | 121 +++++++++++- amt/locale/base.pot | 73 ++++++-- amt/locale/en_US/LC_MESSAGES/messages.mo | Bin 451 -> 451 bytes amt/locale/en_US/LC_MESSAGES/messages.po | 103 +++++----- amt/locale/nl_NL/LC_MESSAGES/messages.mo | Bin 7905 -> 8492 bytes amt/locale/nl_NL/LC_MESSAGES/messages.po | 77 ++++++-- amt/schema/measure.py | 8 +- amt/services/projects.py | 2 + amt/services/task_registry.py | 36 ++-- amt/site/static/scss/layout.scss | 4 + amt/site/static/ts/amt.ts | 12 +- .../templates/projects/details_base.html.j2 | 17 +- .../projects/details_measure_modal.html.j2 | 89 +++++++++ .../projects/details_requirements.html.j2 | 44 ++++- amt/site/templates/projects/new.html.j2 | 9 +- .../bnd-01-aselecte_steekproeven.yaml | 29 +++ .../bnd-02-voer_een_biasanalyse_uit.yaml | 41 ++++ ...e_eigen_data_schending_auteursrechten.yaml | 35 ++++ .../measures/fur-01-afwegen_grondrechten.yaml | 28 +++ ...gestelde_beleidskaders_zijn_nageleefd.yaml | 23 ++- ...gov-02-periodieke_evaluatie_kwaliteit.yaml | 23 ++- ...eving_beleid_naar_werkproces_systemen.yaml | 12 +- example_registry/measures/gov-04-logging.yaml | 28 +++ .../measures/gov-05-stopzetten_gebruik.yaml | 43 +++++ .../gov-06-menselijke_tussenkomst.yaml | 28 +++ ...7-archiveren_beperkingen_openbaarheid.yaml | 32 ++++ .../gov-08-archiveren_bewaartermijnen.yaml | 36 ++++ ...-09-archiveren_vaststellen_documenten.yaml | 39 ++++ ...v-10-archiveren_duurzaam_toegankelijk.yaml | 33 ++++ ...hrijf_rollen_en_verantwoordelijkheden.yaml | 28 +++ ...nkomst_projectplan_en_dchargedocument.yaml | 34 ++++ .../gov-13-beveiliging_van_componenten.yaml | 52 ++++++ ...v-14-informatiebeveiligingsincidenten.yaml | 28 +++ .../measures/gov-15-security_by_design.yaml | 28 +++ .../gov-16-politiek-bestuurlijk_besluit.yaml | 28 +++ .../measures/gov-17-backups_maken.yaml | 28 +++ ...18-richt_formeel_wijzigingenproces_in.yaml | 28 +++ .../gov-19-richt_gebruikersbeheer_in.yaml | 28 +++ .../gov-20-richt_wachtwoordbeheer_in.yaml | 28 +++ ...n_en_inrichten_vernietigingsprocedure.yaml | 38 ++++ ...oonsgegevens_welbepaald_en_omschreven.yaml | 29 +++ ...s_die_worden_verwerkt_zijn_beschreven.yaml | 28 +++ ...onsgegevens_die_mogen_worden_verwerkt.yaml | 28 +++ ...gb-05-vermelding_in_privacyverklaring.yaml | 28 +++ ...-06-vermelding_in_verwerkingsregister.yaml | 28 +++ ...oer_een_project_startarchitectuur_uit.yaml | 28 +++ ...ende_maatregelen_voor_privacyrisico's.yaml | 28 +++ ...in-01-bespreek_vereiste_met_aanbieder.yaml | 70 +++++-- ..._ruimte_voor_samenwerking_in_contract.yaml | 71 +++++-- ...onderdeel_beoordeling_inschrijving.md.yaml | 7 +- ...ste_onderdeel_van_programma_van_eisen.yaml | 115 ++++++------ ...te_onderdeel_van_contractovereenkomst.yaml | 115 ++++++------ ...onderdeel_van_service_level_agreement.yaml | 23 ++- ...ystemen_onder_van_contractvoorwaarden.yaml | 73 ++++++-- ...m_vereiste_op_als_subgunningscriteria.yaml | 32 +++- ...itvoeren_audit_voor_naleving_vereiste.yaml | 115 ++++++------ ...iteit_en_toegankelijkheidsanalyse_uit.yaml | 7 +- .../pin-11-stel_archiefbescheiden_vast.yaml | 30 +++ ...anbieder_onderdeel_beoordelingsmatrix.yaml | 53 ++++++ ...ractuele_afspraken_data_en_artefacten.yaml | 29 +++ ...er_voorkomen_schending_auteursrechten.yaml | 32 ++++ ...s_niet_schenden_auteursrechten_output.yaml | 32 ++++ ...schenden_auteursrechten_trainingsdata.yaml | 61 ++++++ ...anbiede_onderdeel_beoordelingsmaatrix.yaml | 34 ++++ ..._output_onderdeel_conceptovereenkomst.yaml | 51 +++++ ...ngsdata_onderdeel_conceptovereenkomst.yaml | 39 ++++ ..._of_AI-systeem_en_risicoclassificatie.yaml | 28 +++ ...nde_invloed_besluit_richting_personen.yaml | 32 ++++ ...rsovereenkomst_onderdeel_aanbesteding.yaml | 28 +++ ...yse_informatiebeveiliging_leverancier.yaml | 28 +++ ...ra-01-publiceren_in_algoritmeregister.yaml | 42 +++++ ...che_documentatie_in_algoritmeregister.yaml | 28 +++ .../aia-03-risicobeheersysteem.yaml | 2 +- .../aia-05-data-kwaliteitscriteria.yaml | 16 +- .../aia-07-automatische-logregistratie.yaml | 16 +- ...urigheid-robuustheid-cyberbeveiliging.yaml | 2 +- ...-bewaartermijn-voor-gegenereerde-logs.yaml | 10 +- ...ebruiksverantwoordelijken-maatregelen.yaml | 2 +- ...verantwoordelijken-menselijk-toezicht.yaml | 2 +- ...sverantwoordelijken-monitoren-werking.yaml | 2 +- .../aia-28-recht-op-uitleg-ai-besluiten.yaml | 11 +- ...a-29-beoordelen-gevolgen-grondrechten.yaml | 16 +- .../aia-35-verwerking-in-testomgeving.yaml | 9 +- ...-38-melding-inbreuk-op-ai-verordening.yaml | 9 +- .../requirements/arc-01-archiefwet.yaml | 15 +- .../requirements/aut-01-auteursrechten.yaml | 23 ++- ...nsgegevens-worden-rechtmatig-verwerkt.yaml | 11 +- ...imale-verwerking-van-persoonsgegevens.yaml | 12 +- ...4-proportionaliteit-en-subsidiariteit.yaml | 12 +- ...d-en-actualiteit-van-persoonsgegevens.yaml | 11 +- ...-verantwoordingsplicht-rechtmatigheid.yaml | 10 +- ...rantie-bij-verwerken-persoonsgegevens.yaml | 15 +- ...jke-verwerking-van-gevoelige-gegevens.yaml | 11 +- ...recht-bij-verwerking-persoonsgegevens.yaml | 11 +- ...-niet-geautomatiseerde-besluitvorming.yaml | 14 +- ...p-bij-verwerking-van-persoonsgegevens.yaml | 13 +- .../avg-12-beveiliging-van-verwerking.yaml | 14 +- .../requirements/avg-13-dpia-verplicht.yaml | 11 +- .../awb-01-zorgvuldigheidsbeginsel.yaml | 2 +- .../awb-02-motiveringsbeginsel.yaml | 2 +- ...ging-informatie-en-informatiesystemen.yaml | 2 +- .../bzk-01-algoritmeregister.yaml | 2 +- .../requirements/dat-01-databankenwet.yaml | 12 +- .../grw-01-fundamentele-rechten.yaml | 2 +- .../grw-02-non-discriminatie.yaml | 16 +- ...ht-op-toegang-tot-publieke-informatie.yaml | 12 +- example_system_card/measures/measures.yaml | 176 ++++++++++++++++++ pyproject.toml | 2 +- 108 files changed, 2879 insertions(+), 374 deletions(-) create mode 100644 amt/site/templates/projects/details_measure_modal.html.j2 create mode 100644 example_registry/measures/bnd-01-aselecte_steekproeven.yaml create mode 100644 example_registry/measures/bnd-02-voer_een_biasanalyse_uit.yaml create mode 100644 example_registry/measures/dat-01-controle_eigen_data_schending_auteursrechten.yaml create mode 100644 example_registry/measures/fur-01-afwegen_grondrechten.yaml create mode 100644 example_registry/measures/gov-04-logging.yaml create mode 100644 example_registry/measures/gov-05-stopzetten_gebruik.yaml create mode 100644 example_registry/measures/gov-06-menselijke_tussenkomst.yaml create mode 100644 example_registry/measures/gov-07-archiveren_beperkingen_openbaarheid.yaml create mode 100644 example_registry/measures/gov-08-archiveren_bewaartermijnen.yaml create mode 100644 example_registry/measures/gov-09-archiveren_vaststellen_documenten.yaml create mode 100644 example_registry/measures/gov-10-archiveren_duurzaam_toegankelijk.yaml create mode 100644 example_registry/measures/gov-11-beschrijf_rollen_en_verantwoordelijkheden.yaml create mode 100644 example_registry/measures/gov-12-menselijke_tussenkomst_projectplan_en_dchargedocument.yaml create mode 100644 example_registry/measures/gov-13-beveiliging_van_componenten.yaml create mode 100644 example_registry/measures/gov-14-informatiebeveiligingsincidenten.yaml create mode 100644 example_registry/measures/gov-15-security_by_design.yaml create mode 100644 example_registry/measures/gov-16-politiek-bestuurlijk_besluit.yaml create mode 100644 example_registry/measures/gov-17-backups_maken.yaml create mode 100644 example_registry/measures/gov-18-richt_formeel_wijzigingenproces_in.yaml create mode 100644 example_registry/measures/gov-19-richt_gebruikersbeheer_in.yaml create mode 100644 example_registry/measures/gov-20-richt_wachtwoordbeheer_in.yaml create mode 100644 example_registry/measures/pgb-01-bepaal_bewaartermijnen_en_inrichten_vernietigingsprocedure.yaml create mode 100644 example_registry/measures/pgb-02-doel_verwerken_persoonsgegevens_welbepaald_en_omschreven.yaml create mode 100644 example_registry/measures/pgb-03-persoonsgegevens_die_worden_verwerkt_zijn_beschreven.yaml create mode 100644 example_registry/measures/pgb-04-bescherm_persoonsgegevens_die_mogen_worden_verwerkt.yaml create mode 100644 example_registry/measures/pgb-05-vermelding_in_privacyverklaring.yaml create mode 100644 example_registry/measures/pgb-06-vermelding_in_verwerkingsregister.yaml create mode 100644 example_registry/measures/pgb-07-voer_een_project_startarchitectuur_uit.yaml create mode 100644 example_registry/measures/pgb-08-uitvoeren_risicoanalyse_en_formuleren_mitigerende_maatregelen_voor_privacyrisico's.yaml create mode 100644 example_registry/measures/pin-11-stel_archiefbescheiden_vast.yaml create mode 100644 example_registry/measures/pin-14-aansprakelijkheidsvoorwaarden_aanbieder_onderdeel_beoordelingsmatrix.yaml create mode 100644 example_registry/measures/pin-15-contractuele_afspraken_data_en_artefacten.yaml create mode 100644 example_registry/measures/pin-16-getroffen_maatregelen_van_aanbieder_voorkomen_schending_auteursrechten.yaml create mode 100644 example_registry/measures/pin-17-leveren_bewijs_niet_schenden_auteursrechten_output.yaml create mode 100644 example_registry/measures/pin-18-leveren_bewijs_niet_schenden_auteursrechten_trainingsdata.yaml create mode 100644 example_registry/measures/pin-19-omgaan_restrisico's_aanbiede_onderdeel_beoordelingsmaatrix.yaml create mode 100644 example_registry/measures/pin-20-schending_auteursrechten_output_onderdeel_conceptovereenkomst.yaml create mode 100644 example_registry/measures/pin-21-schending_auteursrechten_trainingsdata_onderdeel_conceptovereenkomst.yaml create mode 100644 example_registry/measures/pin-22-vaststellen_typen_algoritme_of_AI-systeem_en_risicoclassificatie.yaml create mode 100644 example_registry/measures/pin-23-bepalende_invloed_besluit_richting_personen.yaml create mode 100644 example_registry/measures/pin-24-model-verwerkersovereenkomst_onderdeel_aanbesteding.yaml create mode 100644 example_registry/measures/pin-25-risico-analyse_informatiebeveiliging_leverancier.yaml create mode 100644 example_registry/measures/tra-01-publiceren_in_algoritmeregister.yaml create mode 100644 example_registry/measures/tra-02-neem_technische_documentatie_in_algoritmeregister.yaml diff --git a/amt/api/routes/project.py b/amt/api/routes/project.py index e0f526614..652035451 100644 --- a/amt/api/routes/project.py +++ b/amt/api/routes/project.py @@ -5,6 +5,7 @@ from fastapi import APIRouter, Depends, Request from fastapi.responses import HTMLResponse +from pydantic import BaseModel, Field from amt.api.deps import templates from amt.api.lifecycles import get_lifecycle @@ -18,8 +19,11 @@ from amt.core.exceptions import AMTNotFound, AMTRepositoryError from amt.enums.status import Status from amt.models import Project +from amt.schema.measure import ExtendedMeasureTask, MeasureTask +from amt.schema.requirement import RequirementTask from amt.schema.system_card import SystemCard from amt.schema.task import MovedTask +from amt.services import task_registry from amt.services.instruments_and_requirements_state import InstrumentStateService, RequirementsStateService from amt.services.projects import ProjectsService from amt.services.storage import StorageFactory @@ -311,8 +315,27 @@ async def get_system_card_requirements( system_card = project.system_card requirements = fetch_requirements([requirement.urn for requirement in system_card.requirements]) - # Get measures that correspond to the requirements. - requirements_and_measures = [(requirement, fetch_measures(requirement.links)) for requirement in requirements] + # Get measures that correspond to the requirements and merge them with the measuretasks + requirements_and_measures = [] + for requirement in requirements: + completed_measures_count = 0 + linked_measures = fetch_measures(requirement.links) + extended_linked_measures: list[ExtendedMeasureTask] = [] + for measure in linked_measures: + measure_task = find_measure_task(system_card, measure.urn) + if measure_task: + ext_measure_task = ExtendedMeasureTask( + name=measure.name, + description=measure.description, + urn=measure.urn, + state=measure_task.state, + value=measure_task.value, + version=measure_task.version, + ) + if ext_measure_task.state == "done": + completed_measures_count += 1 + extended_linked_measures.append(ext_measure_task) + requirements_and_measures.append((requirement, completed_measures_count, extended_linked_measures)) # pyright: ignore [reportUnknownMemberType] context = { "instrument_state": instrument_state, @@ -327,6 +350,100 @@ async def get_system_card_requirements( return templates.TemplateResponse(request, "projects/details_requirements.html.j2", context) +def find_measure_task(system_card: SystemCard, urn: str) -> MeasureTask | None: + for measure in system_card.measures: + if measure.urn == urn: + return measure + return None + + +def find_requirement_task(system_card: SystemCard, requirement_urn: str) -> RequirementTask | None: + for requirement in system_card.requirements: + if requirement.urn == requirement_urn: + return requirement + return None + + +def find_requirement_tasks_by_measure_urn(system_card: SystemCard, measure_urn: str) -> list[RequirementTask]: + requirement_mapper: dict[str, RequirementTask] = {} + for requirement_task in system_card.requirements: + requirement_mapper[requirement_task.urn] = requirement_task + + requirement_tasks: list[RequirementTask] = [] + measure = fetch_measures([measure_urn]) + for requirement_urn in measure[0].links: + # TODO: This is because measure are linked to too many requirement not applicable in our use case + if len(fetch_requirements([requirement_urn])) > 0: + requirement_tasks.append(requirement_mapper[requirement_urn]) + + return requirement_tasks + + +@router.get("/{project_id}/measure/{measure_urn}") +async def get_measure( + request: Request, + project_id: int, + measure_urn: str, + projects_service: Annotated[ProjectsService, Depends(ProjectsService)], +) -> HTMLResponse: + project = get_project_or_error(project_id, projects_service, request) + measure = task_registry.fetch_measures([measure_urn]) + measure_task = find_measure_task(project.system_card, measure_urn) + + context = { + "measure": measure[0], + "measure_state": measure_task.state, # pyright: ignore [reportOptionalMemberAccess] + "measure_value": measure_task.value, # pyright: ignore [reportOptionalMemberAccess] + "project_id": project_id, + } + + return templates.TemplateResponse(request, "projects/details_measure_modal.html.j2", context) + + +class MeasureUpdate(BaseModel): + measure_state: str = Field(default=None) + measure_value: str = Field(default=None) + + +@router.post("/{project_id}/measure/{measure_urn}") +async def update_measure_value( + request: Request, + project_id: int, + measure_urn: str, + measure_update: MeasureUpdate, + projects_service: Annotated[ProjectsService, Depends(ProjectsService)], +) -> HTMLResponse: + project = get_project_or_error(project_id, projects_service, request) + + measure_task = find_measure_task(project.system_card, measure_urn) + measure_task.state = measure_update.measure_state # pyright: ignore [reportOptionalMemberAccess] + measure_task.value = measure_update.measure_value # pyright: ignore [reportOptionalMemberAccess] + + # update for the linked requirements the state based on all it's measures + requirement_tasks = find_requirement_tasks_by_measure_urn(project.system_card, measure_urn) + requirement_urns = [requirement_task.urn for requirement_task in requirement_tasks] + requirements = fetch_requirements(requirement_urns) + + for requirement in requirements: + count_completed = 0 + for link_measure_urn in requirement.links: + link_measure_task = find_measure_task(project.system_card, link_measure_urn) + if link_measure_task: # noqa: SIM102 + if link_measure_task.state == "done": + count_completed += 1 + requirement_task = find_requirement_task(project.system_card, requirement.urn) + if count_completed == len(requirement.links): + requirement_task.state = "done" # pyright: ignore [reportOptionalMemberAccess] + elif count_completed == 0 and len(requirement.links) > 0: + requirement_task.state = "to do" # pyright: ignore [reportOptionalMemberAccess] + else: + requirement_task.state = "in progress" # pyright: ignore [reportOptionalMemberAccess] + + projects_service.update(project) + # TODO: FIX THIS!! The page now reloads at the top, which is annoying + return templates.Redirect(request, f"/project/{project_id}/details/system_card/requirements") + + # !!! # Implementation of this endpoint is for now independent of the project ID, meaning # that the same system card is rendered for all project ID's. This is due to the fact diff --git a/amt/locale/base.pot b/amt/locale/base.pot index 1bab27312..546db2c6c 100644 --- a/amt/locale/base.pot +++ b/amt/locale/base.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-16 08:58+0200\n" +"POT-Creation-Date: 2024-10-16 09:55+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -66,6 +66,7 @@ msgid "Verification and Validation" msgstr "" #: amt/api/lifecycles.py:45 +#: amt/site/templates/projects/details_measure_modal.html.j2:66 msgid "Implementation" msgstr "" @@ -255,10 +256,10 @@ msgid "Reviewing" msgstr "" #: amt/site/templates/macros/tasks.html.j2:32 -#: amt/site/templates/projects/details_base.html.j2:20 -#: amt/site/templates/projects/details_base.html.j2:41 -#: amt/site/templates/projects/details_base.html.j2:67 -#: amt/site/templates/projects/details_base.html.j2:89 +#: amt/site/templates/projects/details_base.html.j2:27 +#: amt/site/templates/projects/details_base.html.j2:52 +#: amt/site/templates/projects/details_base.html.j2:78 +#: amt/site/templates/projects/details_base.html.j2:100 msgid "Done" msgstr "" @@ -337,24 +338,28 @@ msgstr "" msgid "Everyone is welcome to make comments and suggestions." msgstr "" -#: amt/site/templates/projects/details_base.html.j2:18 +#: amt/site/templates/projects/details_base.html.j2:24 msgid "Does the algorithm meet the requirements?" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:39 -#: amt/site/templates/projects/details_base.html.j2:87 +#: amt/site/templates/projects/details_base.html.j2:48 +#: amt/site/templates/projects/details_base.html.j2:98 msgid "To do" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:53 -msgid "Go to all requirements" +#: amt/site/templates/projects/details_base.html.j2:50 +msgid "In progress" msgstr "" #: amt/site/templates/projects/details_base.html.j2:64 +msgid "Go to all requirements" +msgstr "" + +#: amt/site/templates/projects/details_base.html.j2:75 msgid "Which instruments are executed?" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:101 +#: amt/site/templates/projects/details_base.html.j2:112 msgid "Go to all instruments" msgstr "" @@ -420,6 +425,7 @@ msgid "Failed to estimate WOZ value: " msgstr "" #: amt/site/templates/projects/details_info.html.j2:7 +#: amt/site/templates/projects/details_measure_modal.html.j2:19 msgid "Description" msgstr "" @@ -439,10 +445,51 @@ msgstr "" msgid "Labels" msgstr "" -#: amt/site/templates/projects/details_requirements.html.j2:19 +#: amt/site/templates/projects/details_measure_modal.html.j2:28 +msgid "Read more on the algoritmekader" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:37 +msgid "Status" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:44 +#: amt/site/templates/projects/details_measure_modal.html.j2:46 +msgid "to do" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:49 +#: amt/site/templates/projects/details_measure_modal.html.j2:51 +msgid "in progress" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:54 +#: amt/site/templates/projects/details_measure_modal.html.j2:56 +msgid "done" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:69 +msgid "" +"Describe how the measure has been implemented, including challenges and " +"solutions." +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:80 +msgid "Save" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:84 +msgid "Cancel" +msgstr "" + +#: amt/site/templates/projects/details_requirements.html.j2:25 msgid "measures executed" msgstr "" +#: amt/site/templates/projects/details_requirements.html.j2:54 +msgid "Edit measure" +msgstr "" + #: amt/site/templates/projects/index.html.j2:12 msgid "New project" msgstr "" @@ -518,7 +565,7 @@ msgstr "" msgid "Create Project" msgstr "" -#: amt/site/templates/projects/new.html.j2:191 +#: amt/site/templates/projects/new.html.j2:193 msgid "Copy results and close" msgstr "" diff --git a/amt/locale/en_US/LC_MESSAGES/messages.mo b/amt/locale/en_US/LC_MESSAGES/messages.mo index 332f50d134730b4e77ff78d7282ee9c1f0fb7a0d..70f66f28a176b69e8a7d474b3530f041e2ef8b16 100644 GIT binary patch delta 15 WcmX@ie3*H{6c$S>Q`3zzv>5>`RRsqC delta 15 WcmX@ie3*H{6c!6BQ;Ur=v>5>`Tm=aL diff --git a/amt/locale/en_US/LC_MESSAGES/messages.po b/amt/locale/en_US/LC_MESSAGES/messages.po index 28ae81ca1..b47b1e44c 100644 --- a/amt/locale/en_US/LC_MESSAGES/messages.po +++ b/amt/locale/en_US/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-16 08:58+0200\n" +"POT-Creation-Date: 2024-10-16 09:55+0200\n" "PO-Revision-Date: 2024-07-25 21:01+0200\n" "Last-Translator: FULL NAME \n" "Language: en_US\n" @@ -67,6 +67,7 @@ msgid "Verification and Validation" msgstr "" #: amt/api/lifecycles.py:45 +#: amt/site/templates/projects/details_measure_modal.html.j2:66 msgid "Implementation" msgstr "" @@ -256,10 +257,10 @@ msgid "Reviewing" msgstr "" #: amt/site/templates/macros/tasks.html.j2:32 -#: amt/site/templates/projects/details_base.html.j2:20 -#: amt/site/templates/projects/details_base.html.j2:41 -#: amt/site/templates/projects/details_base.html.j2:67 -#: amt/site/templates/projects/details_base.html.j2:89 +#: amt/site/templates/projects/details_base.html.j2:27 +#: amt/site/templates/projects/details_base.html.j2:52 +#: amt/site/templates/projects/details_base.html.j2:78 +#: amt/site/templates/projects/details_base.html.j2:100 msgid "Done" msgstr "" @@ -338,24 +339,28 @@ msgstr "" msgid "Everyone is welcome to make comments and suggestions." msgstr "" -#: amt/site/templates/projects/details_base.html.j2:18 +#: amt/site/templates/projects/details_base.html.j2:24 msgid "Does the algorithm meet the requirements?" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:39 -#: amt/site/templates/projects/details_base.html.j2:87 +#: amt/site/templates/projects/details_base.html.j2:48 +#: amt/site/templates/projects/details_base.html.j2:98 msgid "To do" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:53 -msgid "Go to all requirements" +#: amt/site/templates/projects/details_base.html.j2:50 +msgid "In progress" msgstr "" #: amt/site/templates/projects/details_base.html.j2:64 +msgid "Go to all requirements" +msgstr "" + +#: amt/site/templates/projects/details_base.html.j2:75 msgid "Which instruments are executed?" msgstr "" -#: amt/site/templates/projects/details_base.html.j2:101 +#: amt/site/templates/projects/details_base.html.j2:112 msgid "Go to all instruments" msgstr "" @@ -421,6 +426,7 @@ msgid "Failed to estimate WOZ value: " msgstr "" #: amt/site/templates/projects/details_info.html.j2:7 +#: amt/site/templates/projects/details_measure_modal.html.j2:19 msgid "Description" msgstr "" @@ -440,10 +446,51 @@ msgstr "" msgid "Labels" msgstr "" -#: amt/site/templates/projects/details_requirements.html.j2:19 +#: amt/site/templates/projects/details_measure_modal.html.j2:28 +msgid "Read more on the algoritmekader" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:37 +msgid "Status" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:44 +#: amt/site/templates/projects/details_measure_modal.html.j2:46 +msgid "to do" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:49 +#: amt/site/templates/projects/details_measure_modal.html.j2:51 +msgid "in progress" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:54 +#: amt/site/templates/projects/details_measure_modal.html.j2:56 +msgid "done" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:69 +msgid "" +"Describe how the measure has been implemented, including challenges and " +"solutions." +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:80 +msgid "Save" +msgstr "" + +#: amt/site/templates/projects/details_measure_modal.html.j2:84 +msgid "Cancel" +msgstr "" + +#: amt/site/templates/projects/details_requirements.html.j2:25 msgid "measures executed" msgstr "" +#: amt/site/templates/projects/details_requirements.html.j2:54 +msgid "Edit measure" +msgstr "" + #: amt/site/templates/projects/index.html.j2:12 msgid "New project" msgstr "" @@ -519,37 +566,7 @@ msgstr "" msgid "Create Project" msgstr "" -#: amt/site/templates/projects/new.html.j2:191 +#: amt/site/templates/projects/new.html.j2:193 msgid "Copy results and close" msgstr "" -#~ msgid "Algortime Management Toolkit" -#~ msgstr "" - -#~ msgid "Inference" -#~ msgstr "" - -#~ msgid "Sepal length:" -#~ msgstr "" - -#~ msgid "Sepal width:" -#~ msgstr "" - -#~ msgid "Petal length:" -#~ msgstr "" - -#~ msgid "Petal width:" -#~ msgstr "" - -#~ msgid "Run inference" -#~ msgstr "" - -#~ msgid "Output" -#~ msgstr "" - -#~ msgid "Output Probabilities" -#~ msgstr "" - -#~ msgid "Failed to run inference: " -#~ msgstr "" - diff --git a/amt/locale/nl_NL/LC_M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cp)$IEx3c7d3G)Cs&!xN4DLXP!()JZPj*EBD+xUcca!hfOit8 zr2cm@U_cX&xd$(~{@18TCsC*PDz3qssLyXHM_LQ)N6qs#p22?Hjw`71Ivhk*<|ZmI z{d1A|NuJ`%u{Z--pc+-`2GoDVM^LA=33V3QP^bAd)Mt1KmHBDZgrlg;K0yWkJ!+mG zl3_Hz*$djEeZiW7w(wj*Yb2w?Dk;cz1Uo|owKpHJ`Z^3y5*Rlj|A z#_zD5+k(E*UAc`bmp6uy#Oa)1xa??fbY6G3sC;iE7_PV+_E#?Rf|&(11yB1s{Pv9R bccn5xVe(iwl3eWtURC9sJ$_gEMc@7dXIj-X diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.po b/amt/locale/nl_NL/LC_MESSAGES/messages.po index 6bc7de8f5..1313bcc17 100644 --- a/amt/locale/nl_NL/LC_MESSAGES/messages.po +++ b/amt/locale/nl_NL/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-16 08:58+0200\n" +"POT-Creation-Date: 2024-10-16 09:55+0200\n" "PO-Revision-Date: 2024-07-25 21:01+0200\n" "Last-Translator: FULL NAME \n" "Language: nl_NL\n" @@ -67,6 +67,7 @@ msgid "Verification and Validation" msgstr "Verficatie en validatie" #: amt/api/lifecycles.py:45 +#: amt/site/templates/projects/details_measure_modal.html.j2:66 msgid "Implementation" msgstr "Implementeren" @@ -222,7 +223,7 @@ msgstr "Taal" #: amt/site/templates/auth/profile.html.j2:54 msgid "Select language" -msgstr "Selecteer taal" +msgstr "Taal" #: amt/site/templates/errors/AMTAuthorizationError_401.html.j2:5 msgid "Not logged in" @@ -264,10 +265,10 @@ msgid "Reviewing" msgstr "Beoordelen" #: amt/site/templates/macros/tasks.html.j2:32 -#: amt/site/templates/projects/details_base.html.j2:20 -#: amt/site/templates/projects/details_base.html.j2:41 -#: amt/site/templates/projects/details_base.html.j2:67 -#: amt/site/templates/projects/details_base.html.j2:89 +#: amt/site/templates/projects/details_base.html.j2:27 +#: amt/site/templates/projects/details_base.html.j2:52 +#: amt/site/templates/projects/details_base.html.j2:78 +#: amt/site/templates/projects/details_base.html.j2:100 msgid "Done" msgstr "Afgerond" @@ -346,24 +347,28 @@ msgstr "Deze website is in ontwikkeling. Alle versies ontstaan op een open manie msgid "Everyone is welcome to make comments and suggestions." msgstr "Iedereen mag opmerkingen en suggesties doen." -#: amt/site/templates/projects/details_base.html.j2:18 +#: amt/site/templates/projects/details_base.html.j2:24 msgid "Does the algorithm meet the requirements?" msgstr "Voldoet het algoritme aan de vereisten?" -#: amt/site/templates/projects/details_base.html.j2:39 -#: amt/site/templates/projects/details_base.html.j2:87 +#: amt/site/templates/projects/details_base.html.j2:48 +#: amt/site/templates/projects/details_base.html.j2:98 msgid "To do" msgstr "Te doen" -#: amt/site/templates/projects/details_base.html.j2:53 +#: amt/site/templates/projects/details_base.html.j2:50 +msgid "In progress" +msgstr "Onderhanden" + +#: amt/site/templates/projects/details_base.html.j2:64 msgid "Go to all requirements" msgstr "Ga naar alle Vereisten" -#: amt/site/templates/projects/details_base.html.j2:64 +#: amt/site/templates/projects/details_base.html.j2:75 msgid "Which instruments are executed?" msgstr "Welke instrumenten zijn uitgevoerd?" -#: amt/site/templates/projects/details_base.html.j2:101 +#: amt/site/templates/projects/details_base.html.j2:112 msgid "Go to all instruments" msgstr "Ga naar all instrumenten" @@ -429,6 +434,7 @@ msgid "Failed to estimate WOZ value: " msgstr "Fout bij het schatten van de WOZ-waarde: " #: amt/site/templates/projects/details_info.html.j2:7 +#: amt/site/templates/projects/details_measure_modal.html.j2:19 msgid "Description" msgstr "Omschrijving" @@ -448,10 +454,53 @@ msgstr "Levenscyclus" msgid "Labels" msgstr "Labels" -#: amt/site/templates/projects/details_requirements.html.j2:19 +#: amt/site/templates/projects/details_measure_modal.html.j2:28 +msgid "Read more on the algoritmekader" +msgstr "Lees meer op het algoritmekader" + +#: amt/site/templates/projects/details_measure_modal.html.j2:37 +msgid "Status" +msgstr "Status" + +#: amt/site/templates/projects/details_measure_modal.html.j2:44 +#: amt/site/templates/projects/details_measure_modal.html.j2:46 +msgid "to do" +msgstr "Te doen" + +#: amt/site/templates/projects/details_measure_modal.html.j2:49 +#: amt/site/templates/projects/details_measure_modal.html.j2:51 +msgid "in progress" +msgstr "Onderhanden" + +#: amt/site/templates/projects/details_measure_modal.html.j2:54 +#: amt/site/templates/projects/details_measure_modal.html.j2:56 +msgid "done" +msgstr "Afgerond" + +#: amt/site/templates/projects/details_measure_modal.html.j2:69 +msgid "" +"Describe how the measure has been implemented, including challenges and " +"solutions." +msgstr "" +"Beschrijf hoe de maatregel is geimplementeerd, inclusief uitdagingen " +"enoplossingen." + +#: amt/site/templates/projects/details_measure_modal.html.j2:80 +msgid "Save" +msgstr "Opslaan" + +#: amt/site/templates/projects/details_measure_modal.html.j2:84 +msgid "Cancel" +msgstr "Annuleren" + +#: amt/site/templates/projects/details_requirements.html.j2:25 msgid "measures executed" msgstr "maatregelen uitgevoerd" +#: amt/site/templates/projects/details_requirements.html.j2:54 +msgid "Edit measure" +msgstr "Maatregel aanpassen" + #: amt/site/templates/projects/index.html.j2:12 msgid "New project" msgstr "Nieuw project" @@ -532,7 +581,7 @@ msgstr "Kies één of meerdere instrumenten" msgid "Create Project" msgstr "Maak project" -#: amt/site/templates/projects/new.html.j2:191 +#: amt/site/templates/projects/new.html.j2:193 msgid "Copy results and close" msgstr "Resultaten overnemen en sluiten" diff --git a/amt/schema/measure.py b/amt/schema/measure.py index 35a1a6205..f5b0b4452 100644 --- a/amt/schema/measure.py +++ b/amt/schema/measure.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel +from pydantic import BaseModel, Field class MeasureBase(BaseModel): @@ -14,3 +14,9 @@ class MeasureTask(MeasureBase): class Measure(MeasureBase): name: str description: str + links: list[str] = Field(default=[]) + + +class ExtendedMeasureTask(MeasureTask): + name: str + description: str diff --git a/amt/services/projects.py b/amt/services/projects.py index d7941c973..26149c924 100644 --- a/amt/services/projects.py +++ b/amt/services/projects.py @@ -66,4 +66,6 @@ def paginate(self, skip: int, limit: int, search: str) -> list[Project]: return self.repository.paginate(skip=skip, limit=limit, search=search) def update(self, project: Project) -> Project: + # TODO: Is this the right place to sync system cards: system_card and system_card_json? + project.sync_system_card() return self.repository.save(project) diff --git a/amt/services/task_registry.py b/amt/services/task_registry.py index fa5b27cda..adb5dce25 100644 --- a/amt/services/task_registry.py +++ b/amt/services/task_registry.py @@ -1,5 +1,6 @@ import logging from collections.abc import Sequence +from functools import lru_cache from pathlib import Path from typing import Any @@ -36,38 +37,51 @@ def get_requirements_and_measures( return requirements_card, measure_card -def fetch_requirements(urns: Sequence[str]) -> list[Requirement]: +@lru_cache +def fetch_all_requirements() -> dict[str, Requirement]: """ Fetch requirements with URN in urns. """ - # TODO: make this cacheable (not use a sequence/list as input argument) mock_registry_path = Path("example_registry/requirements") - requirements: list[Requirement] = [] + requirements: dict[str, Requirement] = {} - required_urns: set[str] = set(urns) for requirement_path in mock_registry_path.glob("*.yaml"): requirement: Any = StorageFactory.init( storage_type="file", location=requirement_path.parent, filename=requirement_path.name ).read() - if requirement["urn"] in required_urns: - requirements.append(Requirement(**requirement)) + requirements[requirement["urn"]] = Requirement(**requirement) return requirements -def fetch_measures(urns: Sequence[str]) -> list[Measure]: +def fetch_requirements(urns: Sequence[str]) -> list[Requirement]: + """ + Fetch requirements with URN in urns. + """ + all_requirements = fetch_all_requirements() + return [all_requirements[urn] for urn in urns if urn in all_requirements] + + +@lru_cache +def fetch_all_measures() -> dict[str, Measure]: """ Fetch measures with URN in urns. """ mock_registry_path = Path("example_registry/measures") - measures: list[Measure] = [] + measures: dict[str, Measure] = {} - required_urns: set[str] = set(urns) for measure_path in mock_registry_path.glob("*.yaml"): measure: Any = StorageFactory.init( storage_type="file", location=measure_path.parent, filename=measure_path.name ).read() - if measure["urn"] in required_urns: - measures.append(Measure(**measure)) + measures[measure["urn"]] = Measure(**measure) return measures + + +def fetch_measures(urns: Sequence[str]) -> list[Measure]: + """ + Fetch measures with URN in urns. + """ + all_measures = fetch_all_measures() + return [all_measures[urn] for urn in urns if urn in all_measures] diff --git a/amt/site/static/scss/layout.scss b/amt/site/static/scss/layout.scss index e54db8d23..85bc99335 100644 --- a/amt/site/static/scss/layout.scss +++ b/amt/site/static/scss/layout.scss @@ -47,6 +47,10 @@ main { margin-top: 1em; } +.margin-top-middle { + margin-top: 0.5em; +} + .margin-bottom-small { margin-bottom: 0.5em; } diff --git a/amt/site/static/ts/amt.ts b/amt/site/static/ts/amt.ts index ae3754aa5..e316dd329 100644 --- a/amt/site/static/ts/amt.ts +++ b/amt/site/static/ts/amt.ts @@ -100,8 +100,8 @@ export function hideMobileMenu() { window.setCookie = setCookie; window.htmx = htmx; -export function openModal() { - const el: Element | null = document.getElementById("decision-tree-modal"); +export function openModal(id: string) { + const el: Element | null = document.getElementById(id); if (el != null) { el.classList.remove("display-none"); } @@ -118,16 +118,16 @@ class AiActProfile { ) {} } -export function closeModal() { +export function closeModal(id: string) { // Do not show modal. - const el: Element | null = document.getElementById("decision-tree-modal"); + const el: Element | null = document.getElementById(id); if (el != null) { el.classList.add("display-none"); } } -export function closeModalSave() { - closeModal(); +export function closeModalSave(id: string) { + closeModal(id); // Get decision tree state from local store. const decision_tree_state = localStorage?.getItem("labelsbycategory"); diff --git a/amt/site/templates/projects/details_base.html.j2 b/amt/site/templates/projects/details_base.html.j2 index 0189aef40..2a4aad872 100644 --- a/amt/site/templates/projects/details_base.html.j2 +++ b/amt/site/templates/projects/details_base.html.j2 @@ -1,6 +1,12 @@ {% extends 'layouts/base.html.j2' %} {% block title %}{{ project.name }} | AMT{% endblock %} {% block content %} +

{{ project.name }}

@@ -17,7 +23,8 @@ role="img" aria-label="">{% trans %}Does the algorithm meet the requirements?{% endtrans %} - {{ requirements_state.count_0 }}/{{ requirements_state.count_1 }} {% trans %}Done{% endtrans %} + {{ requirements_state.count_0 }}/{{ requirements_state.count_1 }} + {% trans %}Done{% endtrans %}
    {% for requirement in requirements_state.states %} @@ -27,8 +34,10 @@
    -
    +
    {% if requirement.state == "to do" %} +
    + {% elif requirement.state == "in progress" %}
    {% else %}
    @@ -37,6 +46,8 @@
    {% if requirement.state == "to do" %} {% trans %}To do{% endtrans %} + {% elif requirement.state == "in progress" %} + {% trans %}In progress{% endtrans %} {% else %} {% trans %}Done{% endtrans %} {% endif %} @@ -75,7 +86,7 @@
    -
    +
    {% if instrument.in_progress == 1 %}
    {% else %} diff --git a/amt/site/templates/projects/details_measure_modal.html.j2 b/amt/site/templates/projects/details_measure_modal.html.j2 new file mode 100644 index 000000000..3075fe8fc --- /dev/null +++ b/amt/site/templates/projects/details_measure_modal.html.j2 @@ -0,0 +1,89 @@ +
    +

    {{ measure.name }}

    +
    +
    +
    +
    +
    + {# Description #} +
    +
    + +
    {{ measure.description }}
    +
    + +
    + {# Status#} +
    +
    + +
    +
    + +
    +
    + {# Implementation#} +
    +
    + +
    + +
    +
    +
    +

    + + +

    + +
    +
    +
    diff --git a/amt/site/templates/projects/details_requirements.html.j2 b/amt/site/templates/projects/details_requirements.html.j2 index 28bfdc0ac..0ee802013 100644 --- a/amt/site/templates/projects/details_requirements.html.j2 +++ b/amt/site/templates/projects/details_requirements.html.j2 @@ -1,9 +1,9 @@ {% extends 'projects/details_base.html.j2' %} {% block detail_content %}
    - {% for (requirement, measures) in requirements_and_measures %} + {% for (requirement, completed_measures_count, measures) in requirements_and_measures %}
    - +

    -
    - 0 / {{ measures | length }} {% trans %}measures executed{% endtrans %} + {% if completed_measures_count == 0 %} +
    + {% elif completed_measures_count < measures | length %} +
    + {% else %} +
    + {% endif %} + {{ completed_measures_count }} / {{ measures | length }} {% trans %}measures executed{% endtrans %}

    {% for measure in measures %}
    -
    -
    -

    {{ measure.name }}

    +
    + {% if measure.state == "to do" %} +
    + {% elif measure.state == "in progress" %} +
    + {% elif measure.state == "done" %} +
    + {% else %} + {# This should not happen, red could be for overdue.#} +
    + {% endif %} +
    +

    {{ loop.index }}. {{ measure.name }}

    +

    {{ measure.value }}

    + + + {% trans %}Edit measure{% endtrans %} + +
    -

    {{ measure.description }}

    {% endfor %}
    diff --git a/amt/site/templates/projects/new.html.j2 b/amt/site/templates/projects/new.html.j2 index 15ef13784..124acf25f 100644 --- a/amt/site/templates/projects/new.html.j2 +++ b/amt/site/templates/projects/new.html.j2 @@ -65,7 +65,7 @@
    @@ -182,13 +182,16 @@
+ + + + +{% endmacro %} +{% if start > 0 %} + {% for project in projects %}{{ item(loop, project, search, filters) }}{% endfor %} +{% else %} +
+ 0 + + {% trans %}results{% endtrans %} + {% if search or filters %} + {% trans %}for{% endtrans %} + {% if search %}'{{ search }}'{% endif %} + {% endif %} +
+ + {% for key, localized_value in filters.items() %} + + + {{ localized_value.display_value }} + + + {% endfor %} + +
+ {% if projects|length ==0 %} +
+ {% trans %}No projects match your selected filters. Try adjusting your filters or clearing them to see more projects.{% endtrans %} +
+ {% else %} +
{% trans %}Sepal length:{% endtrans %}{% trans %}Floor area (m²):{% endtrans %} - +
{% trans %}Plot size (m²):{% endtrans %} + +
{% trans %}Building year:{% endtrans %} + +
{% trans %}Object type:{% endtrans %} +
{% trans %}Sepal width:{% endtrans %}{% trans %}Number of annexes:{% endtrans %} - + value="1" />
{% trans %}Petal length:{% endtrans %}{% trans %}Neighborhood code:{% endtrans %} - + value="1234" />
{% trans %}Petal width:{% endtrans %}{% trans %}Quality rating:{% endtrans %} - + value="4" + step="0.1" + min="1" + max="5" /> +
{% trans %}Maintenance rating:{% endtrans %} + +
{% trans %}Amenities rating:{% endtrans %} + +
{% trans %}Location rating:{% endtrans %} +
+ type="button">{% trans %}Estimate WOZ Value{% endtrans %}
{% trans %}Output{% endtrans %}{% trans %}Estimated WOZ Value{% endtrans %} - {% trans %}Undefined{% endtrans %} -
{% trans %}Output Probabilities{% endtrans %} -
+ {% trans %}Undefined{% endtrans %}
+ {{ project.name }} + + {{ project.lifecycle.name }} + + {{ project.last_edited | time_ago(language) }} {% trans %} ago{% endtrans %} +
+ + + + + + + + {% for project in projects %}{{ item(loop, project, search, filters) }}{% endfor %} +
{% trans %}Project name{% endtrans %}{% trans %}Phase{% endtrans %}{% trans %}Last updated{% endtrans %}
+ {% endif %} +{% endif %} + diff --git a/amt/site/templates/parts/project_search.html.j2 b/amt/site/templates/parts/project_search.html.j2 new file mode 100644 index 000000000..47a74c5b7 --- /dev/null +++ b/amt/site/templates/parts/project_search.html.j2 @@ -0,0 +1,75 @@ +

+
+
+

{% trans %}Projects{% endtrans %}

+
+ +
+
+
+
+
+
+
+ + +
+
+ +
+
+ +
+
+
+
+
+
+
+
{% include 'parts/filter_list.html.j2' %}
+
diff --git a/amt/site/templates/projects/_list.html.j2 b/amt/site/templates/projects/_list.html.j2 deleted file mode 100644 index a1e0d0015..000000000 --- a/amt/site/templates/projects/_list.html.j2 +++ /dev/null @@ -1,17 +0,0 @@ -{% for project in projects %} - {% if loop.last and projects|length == limit %} -
  • - {{ project.name }} -
  • - {% else %} -
  • - {{ project.name }} -
  • - {% endif %} -{% endfor %} diff --git a/amt/site/templates/projects/index.html.j2 b/amt/site/templates/projects/index.html.j2 index 7821509b5..8043b7478 100644 --- a/amt/site/templates/projects/index.html.j2 +++ b/amt/site/templates/projects/index.html.j2 @@ -1,57 +1,6 @@ {% extends 'layouts/base.html.j2' %} {% block content %}
    -
    -
    -
    -

    {% trans %}Projects{% endtrans %}

    -
    - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
      - {% include 'projects/_list.html.j2' %} -
    -
    +
    {% include 'parts/project_search.html.j2' %}
    -
    {% endblock %} diff --git a/tests/api/routes/test_projects.py b/tests/api/routes/test_projects.py index 3f6ea97e5..73c327881 100644 --- a/tests/api/routes/test_projects.py +++ b/tests/api/routes/test_projects.py @@ -31,21 +31,21 @@ def test_projects_get_root(client: TestClient) -> None: response = client.get("/projects/") assert response.status_code == 200 - assert b'
      ' in response.content + assert b'
      ' in response.content def test_projects_get_root_missing_slash(client: TestClient) -> None: response = client.get("/projects") assert response.status_code == 200 - assert b'
        ' in response.content + assert b'
        ' in response.content def test_projects_get_root_htmx(client: TestClient) -> None: response = client.get("/projects/", headers={"HX-Request": "true"}) assert response.status_code == 200 - assert b'
          ' not in response.content + assert b'' not in response.content def test_get_new_projects(client: TestClient, init_instruments: Generator[None, None, None]) -> None: diff --git a/tests/e2e/test_scroll_project.py b/tests/e2e/test_scroll_project.py index 0055c2cf2..304b6b84f 100644 --- a/tests/e2e/test_scroll_project.py +++ b/tests/e2e/test_scroll_project.py @@ -6,7 +6,7 @@ def test_e2e_scroll_projects(page: Page) -> None: page.goto("/projects/") - project_links = page.locator("#project-search-results > li").count() + project_links = page.locator("#search-results-table tr").count() - 1 assert project_links == 100 @@ -18,5 +18,5 @@ def test_e2e_scroll_projects(page: Page) -> None: response = response_info.value assert response.status == 200 - project_links = page.locator("#project-search-results > li").count() + project_links = page.locator("#search-results-table tr").count() assert project_links > 100 diff --git a/tests/e2e/test_search_project.py b/tests/e2e/test_search_project.py index 1b2dec430..ec8a5cf0e 100644 --- a/tests/e2e/test_search_project.py +++ b/tests/e2e/test_search_project.py @@ -6,13 +6,15 @@ def test_e2e_search_projects(page: Page) -> None: page.goto("/projects/") - project_links = page.locator("#project-search-results > li").count() + project_links = page.locator("#search-results-table tr").count() - 1 assert 90 <= project_links <= 101 page.locator("#project-search-input").fill("10") - with page.expect_response("/projects/?skip=0&search=10", timeout=3000) as response_info: + with page.expect_response( + "/projects/?skip=0&search=10&add-filter-lifecycle=&add-filter-publication-category=", timeout=3000 + ) as response_info: expect(page.get_by_text("Project 10", exact=True)).to_be_visible() expect(page.get_by_text("Project 100", exact=True)).to_be_visible() @@ -24,13 +26,15 @@ def test_e2e_search_projects(page: Page) -> None: def test_e2e_search_scroll_projects(page: Page) -> None: page.goto("/projects/") - project_links = page.locator("#project-search-results > li").count() + project_links = page.locator("#search-results-table tr").count() - 1 assert 90 <= project_links <= 101 page.locator("#project-search-input").fill("Project") - with page.expect_request("/projects/?skip=0&search=Project", timeout=3000) as _: - project_links = page.locator("#project-search-results > li").count() + with page.expect_request( + "/projects/?skip=0&search=Project&add-filter-lifecycle=&add-filter-publication-category=", timeout=3000 + ) as _: + project_links = page.locator("#search-results-table tr").count() - 1 expect(page.get_by_text("Project 100", exact=True)).to_be_visible() assert 90 <= project_links <= 101 diff --git a/tests/repositories/test_projects.py b/tests/repositories/test_projects.py index e820eb33d..83c79640f 100644 --- a/tests/repositories/test_projects.py +++ b/tests/repositories/test_projects.py @@ -1,5 +1,6 @@ import pytest from amt.core.exceptions import AMTRepositoryError +from amt.models import Project from amt.repositories.projects import ProjectsRepository from tests.constants import default_project from tests.database_test_utils import DatabaseTestUtils @@ -85,7 +86,7 @@ def test_paginate(db: DatabaseTestUtils): db.given([default_project()]) project_repository = ProjectsRepository(db.get_session()) - result = project_repository.paginate(skip=0, limit=3, search="") + result: list[Project] = project_repository.paginate(skip=0, limit=3, search="", filters={}) assert len(result) == 1 @@ -94,7 +95,7 @@ def test_paginate_more(db: DatabaseTestUtils): db.given([default_project(), default_project(), default_project(), default_project()]) project_repository = ProjectsRepository(db.get_session()) - result = project_repository.paginate(skip=0, limit=3, search="") + result: list[Project] = project_repository.paginate(skip=0, limit=3, search="", filters={}) assert len(result) == 3 @@ -110,7 +111,7 @@ def test_paginate_capitalize(db: DatabaseTestUtils): ) project_repository = ProjectsRepository(db.get_session()) - result = project_repository.paginate(skip=0, limit=4, search="") + result: list[Project] = project_repository.paginate(skip=0, limit=4, search="", filters={}) assert len(result) == 4 assert result[0].name == "Aaa" @@ -130,7 +131,7 @@ def test_search(db: DatabaseTestUtils): ) project_repository = ProjectsRepository(db.get_session()) - result = project_repository.paginate(skip=0, limit=4, search="bbb") + result: list[Project] = project_repository.paginate(skip=0, limit=4, search="bbb", filters={}) assert len(result) == 1 assert result[0].name == "bbb" @@ -147,7 +148,7 @@ def test_search_multiple(db: DatabaseTestUtils): ) project_repository = ProjectsRepository(db.get_session()) - result = project_repository.paginate(skip=0, limit=4, search="A") + result: list[Project] = project_repository.paginate(skip=0, limit=4, search="A", filters={}) assert len(result) == 2 assert result[0].name == "Aaa" @@ -156,7 +157,7 @@ def test_search_multiple(db: DatabaseTestUtils): def test_search_no_results(db: DatabaseTestUtils): project_repository = ProjectsRepository(db.get_session()) - result = project_repository.paginate(skip=0, limit=4, search="A") + result: list[Project] = project_repository.paginate(skip=0, limit=4, search="A", filters={}) assert len(result) == 0 @@ -165,4 +166,4 @@ def test_raises_exception(db: DatabaseTestUtils): project_repository = ProjectsRepository(db.get_session()) with pytest.raises(AMTRepositoryError): - project_repository.paginate(skip="a", limit=3, search="") # type: ignore + project_repository.paginate(skip="a", limit=3, search="", filters={}) # type: ignore