From 849ffd2d6a43f331cd0f7d9de9e7860d49147ca1 Mon Sep 17 00:00:00 2001 From: levi-cloudflare Date: Thu, 3 Oct 2024 13:46:18 +0100 Subject: [PATCH] [hma] Check dev mode functionality on page load (#1643) --- .../src/OpenMediaMatch/blueprints/ui.py | 6 ++++++ .../templates/components/dev_mode_bar.html.j2 | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/hasher-matcher-actioner/src/OpenMediaMatch/blueprints/ui.py b/hasher-matcher-actioner/src/OpenMediaMatch/blueprints/ui.py index 38bbda286..464fec312 100644 --- a/hasher-matcher-actioner/src/OpenMediaMatch/blueprints/ui.py +++ b/hasher-matcher-actioner/src/OpenMediaMatch/blueprints/ui.py @@ -107,6 +107,11 @@ def home(): UI Landing page """ + # Check if SEED_BANK_0 and SEED_BANK_1 exist yet + bank_list = curation.banks_index() + contains_seed_bank_0 = any(bank.name == "SEED_BANK_0" for bank in bank_list) + contains_seed_bank_1 = any(bank.name == "SEED_BANK_1" for bank in bank_list) + template_vars = { "signal": curation.get_all_signal_types(), "content": curation.get_all_content_types(), @@ -114,6 +119,7 @@ def home(): "production": current_app.config.get("PRODUCTION", True), "index": _index_info(), "collabs": _collab_info(), + "is_banks_seeded": contains_seed_bank_0 and contains_seed_bank_1, } return render_template("bootstrap.html.j2", page="home", **template_vars) diff --git a/hasher-matcher-actioner/src/OpenMediaMatch/templates/components/dev_mode_bar.html.j2 b/hasher-matcher-actioner/src/OpenMediaMatch/templates/components/dev_mode_bar.html.j2 index c3549cc09..aef35cb10 100644 --- a/hasher-matcher-actioner/src/OpenMediaMatch/templates/components/dev_mode_bar.html.j2 +++ b/hasher-matcher-actioner/src/OpenMediaMatch/templates/components/dev_mode_bar.html.j2 @@ -5,13 +5,31 @@
Running server in development mode!
+ {% if 'SEED_SAMPLE' in collabs %} + + {% else %} + {% endif %}
+ {% if is_banks_seeded %} + + {% else %} + {% endif %}
+ {% if 'TX_EXAMPLE_COLLAB' in collabs %} + + {% else %} + {% endif %}