Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 52b296cf authored by Nicolas Ferre's avatar Nicolas Ferre
Browse files

Merge branch 'AITED-256_improve_lawfulness_ui' into 'main'

AITED-256: improve lawfulness UI

See merge request !9
parents 6f7ff832 e84cd9b7
Branches
Tags v0.0.9
1 merge request!9AITED-256: improve lawfulness UI
Pipeline #105583 passed
......@@ -35,13 +35,11 @@ def display_tab():
status_table = gr.Dataframe(row_count=(3, "dynamic"),
col_count=(len(STATUS_COLUMNS), "fixed"),
headers=STATUS_COLUMNS,
label="Status",
height=200)
label="Status")
flags_table = gr.Dataframe(row_count=(3, "dynamic"),
col_count=(len(FLAGS_COLUMNS), "fixed"),
headers=FLAGS_COLUMNS,
label="Notices to review",
height=200)
label="Notices to review")
show_raw_checkbox = gr.Checkbox(label="Show raw response")
details_block = gr.JSON(label="Raw response", visible=False)
run_button.click(_run, inputs=files, outputs=[status_table, flags_table, details_block])
......@@ -75,16 +73,20 @@ def _format_flags(files: list, response: Response):
continue
results.append([
result['notice_id'],
result['flags']['has_test_word'],
result['flags']['has_sale_word'],
result['flags']['has_incoherent_text'],
result['flags']['is_forbidden_country'],
result['flags']['has_non_eu_country_and_not_funded_by_eu'],
result['flags']['is_contracting_body_private_and_not_funded_by_eu'],
result['flags']['has_not_whitelisted_international_contracting_body'],
_beautify_boolean(result['flags']['has_test_word']),
_beautify_boolean(result['flags']['has_sale_word']),
_beautify_boolean(result['flags']['has_incoherent_text']),
_beautify_boolean(result['flags']['is_forbidden_country']),
_beautify_boolean(result['flags']['has_non_eu_country_and_not_funded_by_eu']),
_beautify_boolean(result['flags']['is_contracting_body_private_and_not_funded_by_eu']),
_beautify_boolean(result['flags']['has_not_whitelisted_international_contracting_body']),
])
return results
def _beautify_boolean(boolean: bool) -> str:
return "Yes" if boolean else ""
def _show_raw(is_shown: bool) -> gr.JSON:
return gr.JSON(visible=is_shown)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment