Skip to content

Commit 2500478

Browse files
committed
Merge branch 'develop'
2 parents 9748766 + d226b62 commit 2500478

30 files changed

Lines changed: 370 additions & 101 deletions

File tree

.github/workflows/django.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
uses: pre-commit/action@v3.0.1
4949

5050
- name: Run Pre-commit checks
51-
uses: pre-commit-ci/lite-action@v1.0.2
51+
uses: pre-commit-ci/lite-action@v1.1.0
5252
if: always()
5353

5454
- uses: borales/actions-yarn@v3.0.0

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ repos:
88
exclude_types: [sql]
99

1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.9.6
11+
rev: v0.11.0
1212
hooks:
1313
- id: ruff
1414
args: [--fix, --exit-non-zero-on-fix]
1515
- id: ruff-format
1616

1717
- repo: https://github.com/adamchainz/django-upgrade
18-
rev: "1.22.1"
18+
rev: "1.23.1"
1919
hooks:
2020
- id: django-upgrade
2121
args: [--target-version, "5.0"]
2222

2323
- repo: https://github.com/astral-sh/uv-pre-commit
24-
rev: 0.6.0
24+
rev: 0.6.6
2525
hooks:
2626
- id: uv-lock
2727
- id: uv-export

frontend_tests/cypress/e2e/auth/signupWithUi.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('The Signup Page', () => {
44
'[name=last_name]': 'Successful',
55
'[name=organization]': 'Signup Corp',
66
'[name=organization_position]': 'Tester',
7-
'[name=email]': 'signup@success.test',
7+
'[name=email]': 'signup3@success.test',
88
'[name=phone_no]': '0102030405',
99
'[name=password1]': 'derpderp',
1010
'[name=password2]': 'derpderp',
@@ -25,7 +25,7 @@ describe('The Signup Page', () => {
2525
var iframe = doc.getElementById('id_captcha').querySelector('iframe');
2626
var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
2727
innerDoc.querySelector('.recaptcha-checkbox').click();
28-
cy.wait(200);
28+
cy.wait(400);
2929
cy.get('[type=submit]').click();
3030

3131
cy.location().should((loc) => {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
describe('I can follow the external resource tutorial', () => {
2+
it('displays the launcher tutorial on the external resource', () => {
3+
cy.login('conseiller1');
4+
cy.visit('/project/27/actions');
5+
cy.get("[data-test-id='create-task-button']").click();
6+
cy.get("[data-cy='radio-push-reco-external-resource']").check({
7+
force: true,
8+
});
9+
cy.get('[data-test-id="tutorial-project-launcher"]').should.exist;
10+
});
11+
});

frontend_tests/cypress/fixtures/settings/challengeDefinition.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,18 @@
2424
"site_id": 1,
2525
"week_inactivity_repeat": 0
2626
}
27+
},
28+
{
29+
"model": "training.challengedefinition",
30+
"pk": 3,
31+
"fields": {
32+
"name": "external-resources-proper-functioning",
33+
"description": "external-resources-proper-functioning",
34+
"next_challenge": null,
35+
"code": "external-resources-proper-functioning",
36+
"icon_name": null,
37+
"site_id": 1,
38+
"week_inactivity_repeat": 0
39+
}
2740
}
2841
]

recoco/apps/home/static/home/css/home/home.scss

Lines changed: 124 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,6 @@ span.step {
9090
line-height: 1.7em;
9191
}
9292

93-
.custom-banner {
94-
background-color: white;
95-
border: 1px solid var(--background-action-high-blue-france);
96-
color: var(--background-action-high-blue-france);
97-
padding: 10px 20px;
98-
width: fit-content;
99-
position:absolute;
100-
top:25px;
101-
display: flex;
102-
align-items: center;
103-
border-radius: 1px;
104-
}
105-
106-
.custom-banner a {
107-
text-decoration: underline;
108-
}
109-
110-
.custom-banner.left-banner {
111-
left: -10px;
112-
right: inherit;
113-
}
114-
115-
.custom-banner.left-banner::after {
116-
left: 0;
117-
}
11893

11994
// .custom-banner::after {
12095
// content: '';
@@ -131,17 +106,6 @@ span.step {
131106
// border-top: 10px solid #3558a2;
132107
// }
133108

134-
@media (max-width: 48em) {
135-
.custom-banner {
136-
display: flex;
137-
flex-direction: column;
138-
align-items: start;
139-
}
140-
141-
.custom-banner a {
142-
margin-top: 15px;
143-
}
144-
}
145109

146110
.imiteH6 {
147111
font-size: 1rem;
@@ -165,7 +129,128 @@ span.step {
165129
text-decoration: underline;
166130
}
167131

168-
.dark-section {
169-
background: var(--dark-accent-green-archipel-125, #1F2C2E);
170-
color: white;
132+
133+
// design hero des portails
134+
135+
.hero-div {
136+
margin: .5rem;
137+
padding: .5rem;
138+
margin-top: 2rem;
139+
140+
&__sub-container {
141+
position: relative;
142+
}
143+
144+
&__text-part {
145+
width: 50%;
146+
padding-left: 6rem;
147+
padding-right: 1rem;
148+
margin-top: 6rem;
149+
}
150+
151+
&__dark-section {
152+
background: var(--light-background-alt-blue-france, #F5F5FE);
153+
padding-left: 120px;
154+
padding-right: 120px;
155+
padding-top: 80px;
156+
padding-bottom: 80px;
157+
margin-top: 40px;
158+
}
159+
160+
&__dark-section h2 {
161+
margin-bottom: 64px;
162+
}
163+
164+
&__custom-banner {
165+
background-color: white;
166+
border: 1px solid var(--background-action-high-blue-france);
167+
color: var(--background-action-high-blue-france);
168+
padding: 10px 20px;
169+
max-width: fit-content;
170+
position: absolute;
171+
top: 25px;
172+
display: flex;
173+
align-items: center;
174+
border-radius: 1px;
175+
margin-left: 6rem;
176+
}
177+
178+
&__custom-banner a {
179+
text-decoration: underline;
180+
}
181+
}
182+
183+
@media (max-width: 48em) {
184+
185+
.hero-div {
186+
&__custom-banner {
187+
display: flex;
188+
align-items: start;
189+
}
190+
}
191+
}
192+
193+
@media (min-width: 1100px) and (max-width: 1200px) {
194+
195+
.hero-div {
196+
&__img-div img {
197+
height: 450px;
198+
width: 450px;
199+
}
200+
}
201+
}
202+
203+
@media (max-width: 1100px) {
204+
205+
.hero-div {
206+
text-align: center;
207+
padding: 40px 40px 60px 40px;
208+
&__sub-container {
209+
position: static;
210+
}
211+
&__img-div {
212+
display: none;
213+
}
214+
&__text-part {
215+
width: 100%;
216+
padding: 0px;
217+
margin-top: 0px;
218+
}
219+
&__custom-banner {
220+
position: static;
221+
margin: auto;
222+
margin-bottom: 32px;
223+
}
224+
&__custom-banner p {
225+
white-space: nowrap;
226+
overflow: hidden;
227+
text-overflow: ellipsis;
228+
font-size: 14px;
229+
}
230+
&__custom-banner a {
231+
white-space: nowrap;
232+
font-size: 14px;
233+
}
234+
&__dark-section {
235+
margin-top: 0px;
236+
padding-left: 80px;
237+
padding-right: 80px;
238+
padding-top: 60px;
239+
padding-bottom: 60px;
240+
}
241+
}
242+
}
243+
244+
@media (max-width: 900px) {
245+
246+
.hero-div {
247+
&__dark-section {
248+
padding-left: 40px;
249+
padding-right: 40px;
250+
}
251+
&__dark-section h2 {
252+
text-align: center;
253+
}
254+
}
255+
171256
}

recoco/apps/invites/tests.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def test_invite_does_not_match_existing_account(request, client):
193193
def test_invite_matches_existing_account_for_logged_in_user(request, client):
194194
current_site = get_current_site(request)
195195
baker.make(home_models.SiteConfiguration, site=current_site)
196-
with login(client) as user:
196+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
197197
invite = Recipe(models.Invite, site=current_site, email=user.email).make()
198198
url = reverse("invites-invite-details", args=[invite.pk])
199199
response = client.get(url)
@@ -209,7 +209,7 @@ def test_invite_matches_existing_account_redirects_anonyous_user_to_login(
209209
current_site = get_current_site(request)
210210
baker.make(home_models.SiteConfiguration, site=current_site)
211211
invited = Recipe(
212-
auth_models.User, username="invited", email="invited@example.com"
212+
auth_models.User, username="invited@example.com", email="invited@example.com"
213213
).make()
214214

215215
invite = Recipe(models.Invite, site=current_site, email=invited.email).make()
@@ -239,7 +239,7 @@ def test_accept_invite_returns_to_details_if_get(request, client):
239239
def test_accept_invite_matches_existing_account(request, client, project):
240240
current_site = get_current_site(request)
241241
baker.make(home_models.SiteConfiguration, site=current_site)
242-
with login(client) as user:
242+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
243243
invite = Recipe(
244244
models.Invite, project=project, site=current_site, email=user.email
245245
).make()
@@ -261,7 +261,7 @@ def test_accept_invite_as_switchtender_triggers_notification(request, client, pr
261261
)
262262
project.projectmember_set.add(membership)
263263

264-
with login(client) as user:
264+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
265265
user.profile.sites.add(current_site)
266266
invite = Recipe(
267267
models.Invite,
@@ -288,7 +288,7 @@ def test_accept_invite_as_team_member_triggers_notification(request, client, pro
288288

289289
project.projectmember_set.add(membership)
290290

291-
with login(client) as user:
291+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
292292
invite = Recipe(
293293
models.Invite,
294294
project=project,
@@ -336,7 +336,7 @@ def test_logged_in_user_accepts_invite_advisor_with_matching_existing_account(
336336
current_site = get_current_site(request)
337337
baker.make(home_models.SiteConfiguration, site=current_site)
338338

339-
with login(client, email="invited@here.tld") as user:
339+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
340340
invite = Recipe(
341341
models.Invite,
342342
site=current_site,
@@ -365,7 +365,7 @@ def test_logged_in_user_accepts_invite_observer_with_matching_existing_account(
365365
current_site = get_current_site(request)
366366
baker.make(home_models.SiteConfiguration, site=current_site)
367367

368-
with login(client, email="invited@here.tld") as user:
368+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
369369
invite = Recipe(
370370
models.Invite,
371371
site=current_site,
@@ -424,7 +424,7 @@ def test_logged_in_user_accepts_invite_collaborator_with_matching_existing_accou
424424
):
425425
current_site = get_current_site(request)
426426
baker.make(home_models.SiteConfiguration, site=current_site)
427-
with login(client, email="invited@here.tld") as user:
427+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
428428
invite = Recipe(
429429
models.Invite,
430430
role="COLLABORATOR",
@@ -483,7 +483,7 @@ def test_anonymous_accepts_invite_with_existing_account_fails(
483483
baker.make(home_models.SiteConfiguration, site=current_site)
484484

485485
invited = Recipe(
486-
auth_models.User, username="invited", email="invited@example.com"
486+
auth_models.User, username="invited@example.com", email="invited@example.com"
487487
).make()
488488

489489
invite = Recipe(
@@ -642,7 +642,7 @@ def test_accepting_invitation_updates_organization_with_current_site(
642642
def test_logged_in_user_accepts_invite_but_is_already_member(request, client, project):
643643
current_site = get_current_site(request)
644644
baker.make(home_models.SiteConfiguration, site=current_site)
645-
with login(client, email="invited@here.tld") as user:
645+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
646646
invite = Recipe(
647647
models.Invite,
648648
role="COLLABORATOR",
@@ -670,7 +670,7 @@ def test_logged_in_user_accepts_invite_but_is_already_advisor(
670670
):
671671
current_site = get_current_site(request)
672672
baker.make(home_models.SiteConfiguration, site=current_site)
673-
with login(client, email="invited@here.tld") as user:
673+
with login(client, email="invited@here.tld", username="invited@here.tld") as user:
674674
invite = Recipe(
675675
models.Invite,
676676
role="OBSERVER",

recoco/apps/invites/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def invite_accept(request, invite_id):
2727
# Check if this email already exists as an account
2828
existing_account = None
2929
try:
30-
existing_account = auth_models.User.objects.get(email=invite.email)
30+
existing_account = auth_models.User.objects.get(username=invite.email)
3131
except auth_models.User.DoesNotExist:
3232
pass
3333

@@ -105,7 +105,7 @@ def invite_details(request, invite_id):
105105
# Check if this email already exists as an account
106106
existing_account = None
107107
try:
108-
existing_account = auth_models.User.objects.get(email=invite.email)
108+
existing_account = auth_models.User.objects.get(username=invite.email)
109109
except auth_models.User.DoesNotExist:
110110
pass
111111

recoco/apps/projects/templates/projects/project/administration_panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ <h6 class="text-uppercase fw-bold d-block fr-mb-2w font-small">informations gén
8383
for="input-project-description">
8484
{{ project_form.description.label }}
8585
</label>
86-
<textarea maxlength="500"
86+
<textarea
8787
class="placeholder-grey form-control {% if project_form.description.errors %}is-invalid{% endif %} textarea-size"
8888
id="input-project-description"
8989
name="{{ project_form.description.name }}"

0 commit comments

Comments
 (0)