Skip to content

Commit

Permalink
dashboard: Add maze survey to employer
Browse files Browse the repository at this point in the history
Only on first display each session
  • Loading branch information
tonial committed Nov 6, 2023
1 parent d8c1f37 commit 4c68bd7
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
8 changes: 8 additions & 0 deletions itou/static/css/itou.css
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,11 @@ _:-ms-fullscreen,
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
}


.maze-survey {
bottom: 60px !important;
width: 441px !important;
border-radius: .5rem;
padding-right: 1rem;
}
13 changes: 13 additions & 0 deletions itou/templates/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,19 @@ <h1 class="h1 mb-0">
{% include "dashboard/includes/siae_evaluation_campains_card.html" %}
{% endif %}

<div id="maze-survey" class="maze-survey bg-white shadow fixed-sm-bottom m-4 py-3 alert-dismissible alert-dismissible-once d-none">
<button type="button" class="btn-close" data-bs-dismiss="alert" data-bs-target="#maze-survey" aria-label="Fermer">
</button>
<p>
<strong>Les emplois de l’inclusion évoluent !</strong>
</p>
<p>Nous faisons évoluer l'interface des Emplois de l'inclusion et avons besoins de vos retours.</p>
<a href="https://t.maze.co/197820845" rel="noopener" target="_blank" class="btn btn-block btn-primary btn-ico">
<i class="ri-star-smile-line font-weight-medium" aria-hidden="true"></i>
<span>Accéder au test</span>
</a>
</div>

{% endif %}
{# end of if user.is_employer #}

Expand Down
17 changes: 17 additions & 0 deletions tests/www/dashboard/__snapshots__/tests.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# serializer version: 1
# name: test_maze_survey
'''
<div class="maze-survey bg-white shadow fixed-sm-bottom m-4 py-3 alert-dismissible alert-dismissible-once d-none" id="maze-survey">
<button aria-label="Fermer" class="btn-close" data-bs-dismiss="alert" data-bs-target="#maze-survey" type="button">
</button>
<p>
<strong>Les emplois de l’inclusion évoluent !</strong>
</p>
<p>Nous faisons évoluer l'interface des Emplois de l'inclusion et avons besoins de vos retours.</p>
<a class="btn btn-block btn-primary btn-ico" href="https://t.maze.co/197820845" rel="noopener" target="_blank">
<i aria-hidden="true" class="ri-star-smile-line font-weight-medium"></i>
<span>Accéder au test</span>
</a>
</div>
'''
# ---
20 changes: 20 additions & 0 deletions tests/www/dashboard/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1865,3 +1865,23 @@ def test_prolongation_requests_badge(client):
f"""a[href^='{reverse("approvals:prolongation_requests_list")}'] + .badge""",
)
assert soup.text == "3"


def test_maze_survey(client, snapshot):
maze_link = "https://t.maze.co/197820845"

for user in [
JobSeekerFactory(),
PrescriberFactory(),
LaborInspectorFactory(membership=True),
]:
client.force_login(user)
client.session.clear()
response = client.get(reverse("dashboard:index"))
assertNotContains(response, maze_link)

employer = EmployerFactory(with_siae=True)
client.force_login(employer)
client.session.clear()
response = client.get(reverse("dashboard:index"))
assert str(parse_response_to_soup(response, ".maze-survey")) == snapshot

0 comments on commit 4c68bd7

Please sign in to comment.