Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ne pas merger] Plateforme demo temporaire #3388

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,5 @@ REDIS_URL=redis://histologe_redis:6379
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###

### demo ###
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ modalsElement.forEach(modalElement => {
})
})

document.querySelectorAll('button[data-cloture-type]').forEach(button => {
button.addEventListener('click', (e) => {
const element = e.target;
if (element && element?.dataset) {
document.getElementById('cloture_type').value = element.dataset.clotureType
}
});
});

document?.getElementById('signalement-add-suivi-notify-usager')?.addEventListeners('change', (e) => {
document.getElementById('signalement-add-suivi-submit').textContent = (e.target.checked) ? 'Envoyer le suivi à l\'usager' : 'Enregistrer le suivi interne'
})
Expand Down
28 changes: 19 additions & 9 deletions templates/_partials/_modal_cloture.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{{ form_label(clotureForm.motif) }}
{{ form_help(clotureForm.motif) }}
{{ form_widget(clotureForm.motif) }}
{{ form_widget(clotureForm.type) }}
<div class="fr-input-group fr-mt-2v">
<label for="cloture_suivi" class="fr-label required">Détails de la clôture</label>
<p class="fr-hint-text">Précisez le contexte et les raisons de la clôture <em>(10 caractères
Expand Down Expand Up @@ -66,23 +67,32 @@
{% if is_granted('ROLE_ADMIN_TERRITORY') %}
<li>
<button class="fr-btn fr-icon-check-line"
form="cloture_form" name="cloture[type]" value="all" type="submit" disabled>
Cloturer pour tous les partenaires
form="cloture_form"
type="submit"
data-cloture-type="all"
disabled>
Clôturer pour tous les partenaires
</button>
</li>
{% if isAffected and isAccepted %}
<li>
<button class="fr-btn fr-icon-check-line" form="cloture_form"
name="cloture[type]" value="partner" type="submit" disabled>
Cloturer pour {{ app.user.partner ? app.user.partner.nom }}
<button class="fr-btn fr-icon-check-line"
form="cloture_form"
type="submit"
data-cloture-type="partner"
disabled>
Clôturer pour {{ app.user.partner ? app.user.partner.nom }}
</button>
</li>
{% endif %}
{% else %}
<li>
<button class="fr-btn fr-icon-check-line" form="cloture_form"
name="cloture[type]" value="partner" type="submit" disabled>
Cloturer pour {{ app.user.partner ? app.user.partner.nom }}
<button class="fr-btn fr-icon-check-line"
form="cloture_form"
data-cloture-type="partner"
type="submit"
disabled>
Clôturer pour {{ app.user.partner ? app.user.partner.nom }}
</button>
</li>
{% endif %}
Expand All @@ -97,4 +107,4 @@
</div>
</div>
</div>
</dialog>
</dialog>
10 changes: 5 additions & 5 deletions tests/Functional/Controller/Back/SignalementControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testAdminSubmitClotureSignalementWithEmailSentToPartners(): void

$client->request('GET', $route);
$client->submitForm(
'Cloturer pour tous les partenaires',
'Clôturer pour tous les partenaires',
[
'cloture[motif]' => 'INSALUBRITE',
'cloture[suivi]' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
Expand Down Expand Up @@ -153,7 +153,7 @@ public function testAdminTerritorySubmitClotureSignalementWithEmailSentToPartner

$client->request('GET', $route);
$client->submitForm(
'Cloturer pour tous les partenaires',
'Clôturer pour tous les partenaires',
[
'cloture[motif]' => 'INSALUBRITE',
'cloture[suivi]' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
Expand Down Expand Up @@ -194,7 +194,7 @@ public function testAdminPartnerSubmitClotureSignalementWithEmailSentToPartners(

$client->request('GET', $route);
$client->submitForm(
'Cloturer pour Partenaire 13-01',
'Clôturer pour Partenaire 13-01',
[
'cloture[motif]' => 'INSALUBRITE',
'cloture[suivi]' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
Expand Down Expand Up @@ -231,7 +231,7 @@ public function testUserPartnerSubmitClotureSignalementWithEmailSentToPartners()

$client->request('GET', $route);
$client->submitForm(
'Cloturer pour Partenaire 13-02',
'Clôturer pour Partenaire 13-02',
[
'cloture[motif]' => 'RSD',
'cloture[suivi]' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
Expand Down Expand Up @@ -271,7 +271,7 @@ public function testUserPartnerSubmitClotureSignalementWithoutMotifSuivi(): void

$client->request('GET', $route);
$client->submitForm(
'Cloturer pour Partenaire 13-02',
'Clôturer pour Partenaire 13-02',
[
'cloture[motif]' => 'RSD',
'cloture[type]' => 'partner',
Expand Down
Loading