From 32a36add0309c1ef3b9b34a3025da20feb24f8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Fri, 6 Oct 2023 16:58:17 +0200 Subject: [PATCH] feat: satsifaction poll url is configurable --- web.env.example | 1 + web/flaskr/templates/meeting/list.html | 4 ++-- web/instance/config.py | 1 + web/tests/test_satisfaction_poll.py | 10 ++++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 web/tests/test_satisfaction_poll.py diff --git a/web.env.example b/web.env.example index 46584c25..fb61a312 100644 --- a/web.env.example +++ b/web.env.example @@ -14,6 +14,7 @@ SERVICE_TITLE=Webinaire SERVICE_TAGLINE=Le service de webinaire MEETING_LOGOUT_URL= +SATISFACTION_POLL_URL=https://dinum.evalandgo.com/s/index.php?id=JTk4ciU5Mm0lOTclQjE=&a=JTk2byU5NmglOUUlQUI= WORDING_MEETING_PRESENTATION=présentation WORDING_UPLOAD_FILE=envoyer diff --git a/web/flaskr/templates/meeting/list.html b/web/flaskr/templates/meeting/list.html index 096196e2..31b021eb 100644 --- a/web/flaskr/templates/meeting/list.html +++ b/web/flaskr/templates/meeting/list.html @@ -20,10 +20,10 @@

{{ meeting.name }}

{% include 'meeting/modals.html' %} {% endfor %} - {% if meetings|length %} + {% if meetings|length and config.get("SATISFACTION_POLL_URL") %} {% endif %} diff --git a/web/instance/config.py b/web/instance/config.py index 7dc596ca..b650ecec 100755 --- a/web/instance/config.py +++ b/web/instance/config.py @@ -96,6 +96,7 @@ SERVICE_TAGLINE = os.environ.get("SERVICE_TAGLINE") MEETING_LOGOUT_URL = os.environ.get("MEETING_LOGOUT_URL", "") +SATISFACTION_POLL_URL = os.environ.get("SATISFACTION_POLL_URL") # Database configuration SQLALCHEMY_DATABASE_URI = os.environ.get("SQLALCHEMY_DATABASE_URI") diff --git a/web/tests/test_satisfaction_poll.py b/web/tests/test_satisfaction_poll.py new file mode 100644 index 00000000..5ab91e4a --- /dev/null +++ b/web/tests/test_satisfaction_poll.py @@ -0,0 +1,10 @@ +def test_no_satisfaction_poll(client_app, authenticated_user, bbb_response): + res = client_app.get("/welcome") + res.mustcontain(no="iframe") + + +def test_satisfaction_poll_url(client_app, authenticated_user, meeting, bbb_response): + client_app.app.config["SATISFACTION_POLL_URL"] = "https://poll.example.org" + res = client_app.get("/welcome") + res.mustcontain("iframe") + res.mustcontain("https://poll.example.org")