From 7a8aa5c37bb6f6c46b679c6e55cba5efa6133cb5 Mon Sep 17 00:00:00 2001 From: Berry den Hartog <38954346+berrydenhartog@users.noreply.github.com> Date: Tue, 10 Dec 2024 08:52:04 +0000 Subject: [PATCH] Fix beslisboom integratie --- amt/api/ai_act_profile.py | 4 ++-- amt/locale/en_US/LC_MESSAGES/messages.mo | Bin 989 -> 989 bytes amt/locale/nl_NL/LC_MESSAGES/messages.mo | Bin 14051 -> 14043 bytes amt/locale/nl_NL/LC_MESSAGES/messages.po | 4 ++-- amt/site/static/ts/amt.ts | 1 + .../system_card_templates/AMT_Template_1.json | 2 +- tests/api/routes/test_algorithms.py | 4 ++-- tests/e2e/test_create_algorithm.py | 4 ++-- tests/schema/test_schema_ai_act_profile.py | 18 +++++++++--------- tests/schema/test_schema_algorithm.py | 8 ++++---- 10 files changed, 23 insertions(+), 22 deletions(-) diff --git a/amt/api/ai_act_profile.py b/amt/api/ai_act_profile.py index 1e5f8132..c4f69378 100644 --- a/amt/api/ai_act_profile.py +++ b/amt/api/ai_act_profile.py @@ -101,8 +101,8 @@ def get_ai_act_profile_selector(request: Request) -> AiActProfileSelector: systemic_risk_options = ("systeemrisico", "geen systeemrisico", "niet van toepassing") transparency_obligations_options = ( - "transparantieverplichtingen", - "geen transparantieverplichtingen", + "transparantieverplichting", + "geen transparantieverplichting", "niet van toepassing", ) open_source_options = ("open-source", "geen open-source", "niet van toepassing") diff --git a/amt/locale/en_US/LC_MESSAGES/messages.mo b/amt/locale/en_US/LC_MESSAGES/messages.mo index 87254830e02c90fb046c96308b5fb86381f9599b..738f59d744c7bbb468cf5ea758aea138d08b66f8 100644 GIT binary patch delta 16 Ycmcc1ewTg28OF(97{xX}V*Jer074%Jb^rhX delta 32 ocmcc1ewTg28Af3v10xe%LnB>70|i3^D`Nv~1H;Yt8UHZ?0HBQtdjJ3c diff --git a/amt/locale/nl_NL/LC_MESSAGES/messages.mo b/amt/locale/nl_NL/LC_MESSAGES/messages.mo index 359c1d3a739de33eddaeacacb778720f1b8461b3..0c989e45444285e722bbcb8b7d174c83395b4363 100644 GIT binary patch delta 880 zcmXZaPe@cz6vy$Cf5tyElmEtXQPzVDbD`tts3hbjS|pJOtrSIq5g|qt-N>MCBZ_Vm z6-1()K{A`-ZGwV!xiXEA#AuVb5M78UF52|{@g5BGxqsfh=iGDeQRY|X{oi8uo|z3b zn$_Vf*5Ve1a2pHo8&=>CjNma=;RWiuP?K3PMzI9r7)J*Su_N#ihUq`XQtW9m*P=A~ z7>MBrD$q14@Di5c8rI+@YT;+p#@oUC4p!3tjrn+vb9jl`Kb!CqUO*-A2AQ(0glkq# z;~I8FGgo~(3te{H1jtY=NRqRtRzlSRMJ}Qy3U_P(K>`eH_74e1I=f+#^n-=6A3HkMIs&VGLt!{(%|-lUPZ7 zdr0FZA3Q^ytRMB5UZFCaM3pX!dIPUfkJiIH{E4d6A!_{})cOn5iT~kKw06IO-Kcnj z7`86642?JgQ&@$|s4Lh+1$c)Fki%Q(q3&=OR|g|)UT>r&wwiO|-iC7!38&Me&cxKj UWICPkW*R#SZj5GD7{~F4)Y{y&Rd=(XKRc8`5v%i#x}ikop+lF#=(t27#wP4(><}nJL>AN~ z45?FxsEY-{oI(hpOP&-$ibRA8f;?4{6a;>M%)rim-aqrc&+|U-tk%EQ=e}j4V`g@> zY}ScWcnD{4CoWMyYL~Z5|2?Oe~Jq98db4(>HH^D$=A~P&2+vwpxlg?Q2UJH1sp?NUG#>}Pp&97h^Zs1}3k3~G#mmJ8Y_G3Ho zZHUGmUbu`Z-3aPq3Q-wOph|ZK^$k47qd1Q{a2-{tFR1lDQ0xDpPTWv2JC7MG;3ZVN z>zK7OW;bbcFmN07!V}aLyg~(-Lj{QO0M4WC@FPxN$@Rs { el_ids.forEach((el_id: string) => { diff --git a/resources/system_card_templates/AMT_Template_1.json b/resources/system_card_templates/AMT_Template_1.json index 14cc36c6..34e36199 100644 --- a/resources/system_card_templates/AMT_Template_1.json +++ b/resources/system_card_templates/AMT_Template_1.json @@ -13,7 +13,7 @@ "risk_group": "hoog-risico AI", "conformity_assessment_body": "niet van toepassing", "systemic_risk": "geen systeemrisico", - "transparency_obligations": "geen transparantieverplichtingen", + "transparency_obligations": "geen transparantieverplichting", "role": "gebruiksverantwoordelijke" }, "instruments": [ diff --git a/tests/api/routes/test_algorithms.py b/tests/api/routes/test_algorithms.py index ddbe0fbb..c45228b7 100644 --- a/tests/api/routes/test_algorithms.py +++ b/tests/api/routes/test_algorithms.py @@ -131,7 +131,7 @@ async def test_post_new_algorithms(client: AsyncClient, mocker: MockFixture, db: risk_group="hoog-risico AI", conformity_assessment_body="beoordeling door derde partij", systemic_risk="geen systeemrisico", - transparency_obligations="geen transparantieverplichtingen", + transparency_obligations="geen transparantieverplichting", role="gebruiksverantwoordelijke", template_id="0", organization_id=1, @@ -179,7 +179,7 @@ async def test_post_new_algorithms_write_system_card( risk_group="hoog-risico AI", conformity_assessment_body="beoordeling door derde partij", systemic_risk="geen systeemrisico", - transparency_obligations="geen transparantieverplichtingen", + transparency_obligations="geen transparantieverplichting", role="gebruiksverantwoordelijke", template_id="", organization_id=1, diff --git a/tests/e2e/test_create_algorithm.py b/tests/e2e/test_create_algorithm.py index b8e95aa0..1a85f369 100644 --- a/tests/e2e/test_create_algorithm.py +++ b/tests/e2e/test_create_algorithm.py @@ -26,7 +26,7 @@ def test_e2e_create_algorithm(page: Page) -> None: page.locator("#role-aanbieder").check() page.locator("#type").select_option("AI-systeem voor algemene doeleinden") page.locator("#risk_group").select_option("verboden AI") - page.locator("#transparency_obligations").select_option("geen transparantieverplichtingen") + page.locator("#transparency_obligations").select_option("geen transparantieverplichting") page.locator("#systemic_risk").select_option("geen systeemrisico") page.locator("#open_source").select_option("geen open-source") page.locator("#conformity_assessment_body").select_option("niet van toepassing") @@ -45,7 +45,7 @@ def test_e2e_create_algorithm_invalid(page: Page): page.goto("/algorithms/new") - page.locator("#transparency_obligations").select_option("geen transparantieverplichtingen") + page.locator("#transparency_obligations").select_option("geen transparantieverplichting") page.locator("#open_source").select_option("geen open-source") diff --git a/tests/schema/test_schema_ai_act_profile.py b/tests/schema/test_schema_ai_act_profile.py index a853415e..77f57c50 100644 --- a/tests/schema/test_schema_ai_act_profile.py +++ b/tests/schema/test_schema_ai_act_profile.py @@ -8,14 +8,14 @@ def test_ai_act_profile_schema_create_new(): open_source="open-source", risk_group="hoog-risico AI", systemic_risk="systeemrisico", - transparency_obligations="transparantieverplichtingen", + transparency_obligations="transparantieverplichting", role="aanbieder", ) assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" - assert algorithm_new.transparency_obligations == "transparantieverplichtingen" + assert algorithm_new.transparency_obligations == "transparantieverplichting" assert algorithm_new.role == "aanbieder" @@ -25,14 +25,14 @@ def test_ai_act_profile_schema_create_new_no_role(): open_source="open-source", risk_group="hoog-risico AI", systemic_risk="systeemrisico", - transparency_obligations="transparantieverplichtingen", + transparency_obligations="transparantieverplichting", role=None, ) assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" - assert algorithm_new.transparency_obligations == "transparantieverplichtingen" + assert algorithm_new.transparency_obligations == "transparantieverplichting" assert algorithm_new.role is None @@ -42,14 +42,14 @@ def test_ai_act_profile_schema_create_new_empty_role_list(): open_source="open-source", risk_group="hoog-risico AI", systemic_risk="systeemrisico", - transparency_obligations="transparantieverplichtingen", + transparency_obligations="transparantieverplichting", role=[], ) assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" - assert algorithm_new.transparency_obligations == "transparantieverplichtingen" + assert algorithm_new.transparency_obligations == "transparantieverplichting" assert algorithm_new.role is None @@ -59,14 +59,14 @@ def test_ai_act_profile_schema_create_new_double_role(): open_source="open-source", risk_group="hoog-risico AI", systemic_risk="systeemrisico", - transparency_obligations="transparantieverplichtingen", + transparency_obligations="transparantieverplichting", role=["aanbieder", "gebruiksverantwoordelijke"], ) assert algorithm_new.type == "AI-systeem" assert algorithm_new.open_source == "open-source" assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" - assert algorithm_new.transparency_obligations == "transparantieverplichtingen" + assert algorithm_new.transparency_obligations == "transparantieverplichting" assert algorithm_new.role == "aanbieder + gebruiksverantwoordelijke" @@ -77,6 +77,6 @@ def test_ai_act_profile_schema_create_new_too_many_roles(): open_source="open-source", risk_group="hoog-risico AI", systemic_risk="systeemrisico", - transparency_obligations="transparantieverplichtingen", + transparency_obligations="transparantieverplichting", role=["aanbieder", "gebruiksverantwoordelijke", "I am too much of a role"], ) diff --git a/tests/schema/test_schema_algorithm.py b/tests/schema/test_schema_algorithm.py index b9b241bc..3d1b875f 100644 --- a/tests/schema/test_schema_algorithm.py +++ b/tests/schema/test_schema_algorithm.py @@ -10,7 +10,7 @@ def test_algorithm_schema_create_new(): open_source="open-source", risk_group="hoog-risico AI", systemic_risk="systeemrisico", - transparency_obligations="transparantieverplichtingen", + transparency_obligations="transparantieverplichting", role=["aanbieder", "gebruiksverantwoordelijke"], organization_id=1, ) @@ -20,7 +20,7 @@ def test_algorithm_schema_create_new(): assert algorithm_new.open_source == "open-source" assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" - assert algorithm_new.transparency_obligations == "transparantieverplichtingen" + assert algorithm_new.transparency_obligations == "transparantieverplichting" assert algorithm_new.role == ["aanbieder", "gebruiksverantwoordelijke"] assert algorithm_new.organization_id == 1 @@ -34,7 +34,7 @@ def test_algorithm_schema_create_new_one_instrument(): open_source="open-source", risk_group="hoog-risico AI", systemic_risk="systeemrisico", - transparency_obligations="transparantieverplichtingen", + transparency_obligations="transparantieverplichting", role="aanbieder", organization_id=1, ) @@ -44,6 +44,6 @@ def test_algorithm_schema_create_new_one_instrument(): assert algorithm_new.open_source == "open-source" assert algorithm_new.risk_group == "hoog-risico AI" assert algorithm_new.systemic_risk == "systeemrisico" - assert algorithm_new.transparency_obligations == "transparantieverplichtingen" + assert algorithm_new.transparency_obligations == "transparantieverplichting" assert algorithm_new.role == ["aanbieder"] assert algorithm_new.organization_id == 1