-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #970 from betagouv/feat/add-info-collab
Feat/add info collab
- Loading branch information
Showing
11 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
frontend_tests/cypress/e2e/project/Role/canSeeIfAProjectManagerHasAcceptAnInvite.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
describe('I can go to a project and see if the main collaborator has accepted the invitation', () => { | ||
|
||
it('can see if the main colloborator has accepted the invitation or not', () => { | ||
cy.login('jean'); | ||
cy.visit('/project/27/presentation'); | ||
cy.get('[data-test-id="invite-not-accepted-banner"]').should('exist'); | ||
|
||
cy.visit('/project/23/presentation'); | ||
cy.get('[data-test-id="invite-not-accepted-banner"]').should('not.exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,19 @@ | |
"project_id": 26, | ||
"site_id": 1 | ||
} | ||
}, | ||
{ | ||
"model": "invites.invite", | ||
"pk": "e6f6e766-5e64-4bae-965d-1ce551cf659a", | ||
"fields": { | ||
"created_on": "2025-01-29T14:31:39Z", | ||
"accepted_on": null, | ||
"email": "[email protected]", | ||
"message": "viens donc référer ce projet", | ||
"role": "COLLABORATOR", | ||
"inviter_id": 2, | ||
"project_id": 28, | ||
"site_id": 1 | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -693,4 +693,33 @@ def test_logged_in_user_accepts_invite_but_is_already_advisor( | |
assert user not in invite.project.members.all() | ||
|
||
|
||
# Managers | ||
@pytest.mark.django_db | ||
def test_manager_active_filter(request, project): | ||
current_site = get_current_site(request) | ||
|
||
pending_invite = baker.make( | ||
models.Invite, | ||
role="COLLABORATOR", | ||
accepted_on=None, | ||
site=current_site, | ||
project=project, | ||
email="[email protected]", | ||
) | ||
|
||
baker.make( | ||
models.Invite, | ||
role="COLLABORATOR", | ||
accepted_on=timezone.now(), | ||
site=current_site, | ||
project=project, | ||
email="[email protected]", | ||
) | ||
|
||
assert models.Invite.objects.count() == 2 | ||
assert models.Invite.objects.pending().count() == 1 | ||
|
||
assert models.Invite.objects.pending().first() == pending_invite | ||
|
||
|
||
# eof |
6 changes: 6 additions & 0 deletions
6
recoco/apps/projects/static/projects/css/fragments/owner/invite-not-accepted-banner.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.invite-not-accepted-banner { | ||
background-color: #FFE8E5; | ||
&__span { | ||
color: #B34000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
.../apps/projects/templates/projects/project/fragments/owner/invite-not-accepted-banner.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% load sass_tags %} | ||
{% block css %} | ||
<link href="{% sass_src 'projects/css/fragments/owner/invite-not-accepted-banner.scss' %}" | ||
rel="stylesheet" | ||
type="text/css"> | ||
{% endblock css %} | ||
{% if project.owner != project.submitted_by %} | ||
{% for invite in invites %} | ||
{% if invite.role == "COLLABORATOR" and invite.email == project.owner.email %} | ||
<div class="invite-not-accepted-banner fr-p-2v" | ||
data-test-id="invite-not-accepted-banner"> | ||
<span class="fr-icon-warning-line invite-not-accepted-banner__span fr-mx-2v" | ||
aria-hidden="true"></span><span class="invite-not-accepted-banner__span">Cette personne n’a pas encore rejoint le projet</span> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters