-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Première version de la prise de rdv par intégration (#5006)
* wip: trying to add radio buttons * wip * fix * nicer radio buttons, still need proper field name * wip * Add location type * wip * wip * wip * wip * fix * Extend integration spec for rdv_plan * fix user update * wip * anonymizer fix * update brakeman ignore * fix * remove unused css * Add policy call for lieux * fix * wip * Vérifie dans les specs qu'on envoie les bons mails --------- Co-authored-by: François Ferrandis <[email protected]>
- Loading branch information
1 parent
b4751b8
commit b978726
Showing
23 changed files
with
458 additions
and
17 deletions.
There are no files selected for viewing
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
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,48 @@ | ||
- available_location_types = rdv_plan.rdv_agent.motifs.individuel.active.where(organisation_id: rdv_plan.rdv_agent.roles.select(:organisation_id)).pluck(:location_type) | ||
|
||
fieldset[class="fr-fieldset" id="rdv_plan[modalite]" aria-labelledby="radio-rich-no-pictogram-inline-legend radio-rich-no-pictogram-inline-messages"] | ||
legend[class="fr-fieldset__legend--regular fr-fieldset__legend" id="radio-rich-no-pictogram-inline-legend"] | ||
| Comment souhaitez-vous faire le rendez-vous ? | ||
|
||
- if available_location_types.include?("public_office") | ||
- lieux = policy_scope(Lieu.enabled, policy_scope_class: Agent::LieuPolicy::Scope) | ||
- lieux.each do |lieu| | ||
.fr-fieldset__element | ||
.fr-radio-group.fr-radio-rich | ||
input[value="public_office-#{lieu.id}" type="radio" id="public_office-#{lieu.id}" name="rdv_plan[modalite]" required] | ||
label.fr-label[for="public_office-#{lieu.id}"] | ||
span | ||
= lieu_icon | ||
= " Sur place à #{lieu.name}" | ||
span.fr-hint-text = lieu.address | ||
|
||
- if available_location_types.include?("phone") | ||
.fr-fieldset__element | ||
.fr-radio-group.fr-radio-rich | ||
input[value="phone" type="radio" id="rdv_plan_modalite_phone" name="rdv_plan[modalite]" required] | ||
label.fr-label[for="rdv_plan_modalite_phone"] | ||
span | ||
= phone_icon | ||
= " Par téléphone" | ||
|
||
- if available_location_types.include?("visio") | ||
.fr-fieldset__element | ||
.fr-radio-group.fr-radio-rich | ||
input[value="visio" type="radio" id="rdv_plan_modalite_visio" name="rdv_plan[modalite]" required] | ||
label.fr-label[for="rdv_plan_modalite_visio"] | ||
span | ||
= visio_icon | ||
= " Par visioconférence" | ||
span.fr-hint-text | ||
| Nous vous fournirons un lien de visio | ||
|
||
- if available_location_types.include?("home") | ||
.fr-fieldset__element | ||
.fr-radio-group.fr-radio-rich | ||
input[value="home" type="radio" id="rdv_plan_modalite_home" name="rdv_plan[modalite]" required] | ||
label.fr-label[for="rdv_plan_modalite_home"] | ||
span | ||
= home_icon | ||
| Au domicile de l'usager | ||
|
||
div[class="fr-messages-group" id="radio-rich-no-pictogram-inline-messages" aria-live="polite"] |
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,18 @@ | ||
.fr-row | ||
.fr-col-12 | ||
= render "agents/rdv_plans/header", rdv_plan: @rdv_plan, current_step: 1, step_title: "Créneau", next_step_title: "Motif" | ||
.row.fr-mb-16w | ||
.col-12.col-md-4 | ||
= render "agents/rdv_plans/calendar", rdv_plan: @rdv_plan, single_day: true | ||
= link_to edit_starts_at_agents_rdv_plan_path(@rdv_plan) do | ||
= "retour" | ||
|
||
.col-12.col-md-4 | ||
= simple_form_for @rdv_plan, url: update_modalites_agents_rdv_plan_path(@rdv_plan) do |f| | ||
.fr-mb-4w | ||
.input-group | ||
= datetime_input(f, :starts_at, options: { label_html: { style: "flex-shrink: 0;", class: "fr-mr-2w" }, wrapper_html: { class: "d-flex", style: "align-items: baseline;" }}) | ||
|
||
= render "agents/rdv_plans/modalites_field", rdv_plan: @rdv_plan | ||
|
||
= f.submit "Continuer", class: "fr-btn float-right" |
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,23 @@ | ||
.fr-row | ||
.fr-col-12 | ||
= render "agents/rdv_plans/header", rdv_plan: @rdv_plan, current_step: 2, step_title: "Motif", next_step_title: "Usager" | ||
.row.fr-mb-16w | ||
.col-4 | ||
= render "agents/rdv_plans/calendar", rdv_plan: @rdv_plan, single_day: true | ||
= link_to edit_modalites_agents_rdv_plan_path(@rdv_plan) do | ||
= back_icon(class: "fr-mr-1w") | ||
= "retour" | ||
|
||
.col-12.col-md-6 | ||
= render "agents/rdv_plans/summary/starts_at", rdv_plan: @rdv_plan | ||
= render "agents/rdv_plans/summary/location_type", rdv_plan: @rdv_plan | ||
hr.fr-mt-2w.fr-mb-4w | ||
|
||
= simple_form_for @rdv_plan, url: update_motif_agents_rdv_plan_path(@rdv_plan) do |f| | ||
= render "model_errors", model: @rdv_plan | ||
|
||
.input-group.fr-mb-3w | ||
= f.input :motif_id, label: "Motif du rendez-vous", required: true, collection: @motifs, label_method: :name, label_html: { class: "fr-mr-2w" }, include_blank: true | ||
|
||
= f.input :duration_in_minutes, label: "Durée en minutes" | ||
= f.submit "Continuer", class: "fr-btn float-right" |
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,31 @@ | ||
.row.justify-content-md-center | ||
.col-12 | ||
= render "agents/rdv_plans/header", rdv_plan: @rdv_plan, current_step: 3, step_title: "Usager", next_step_title: "" | ||
.row.fr-mb-16w | ||
.col-12.col-md-4 | ||
= render "agents/rdv_plans/calendar", rdv_plan: @rdv_plan, single_day: true | ||
= link_to edit_motif_agents_rdv_plan_path(@rdv_plan) do | ||
= back_icon(class: "fr-mr-1w") | ||
= "retour" | ||
.col-12.col-md-8 | ||
= render "agents/rdv_plans/summary/starts_at", rdv_plan: @rdv_plan | ||
= render "agents/rdv_plans/summary/location_type", rdv_plan: @rdv_plan | ||
= render "agents/rdv_plans/summary/motif", rdv_plan: @rdv_plan | ||
|
||
hr.fr-mt-2w | ||
h3= @rdv_plan.user.full_name | ||
= simple_form_for @rdv_plan, url: create_rdv_agents_rdv_plan_path(@rdv_plan), method: :post do |f| | ||
= f.fields_for :user, @rdv_plan.user do |ff| | ||
.row | ||
.col-6 | ||
/ TODO: gérer le cas des users confirmed (et gérer ce cas dans l'interface principale aussi) : leur nouvelle adresse mail ne sera pas prise en compte tant qu'ils ne la confirment pas | ||
= ff.input :email | ||
.col-6 | ||
= ff.input :phone_number | ||
- if @rdv_plan.motif.visible_and_notified? | ||
= f.fields_for :participation, (Participation.new(send_lifecycle_notifications: true, send_reminder_notification: true)) do |ff| | ||
= ff.input :send_lifecycle_notifications, label: "Envoyer une notification de confirmation" | ||
= ff.input :send_reminder_notification, label: "Envoyer une notification de rappel 48h avant le rendez-vous" | ||
- else | ||
| Les notifications ne sont pas envoyées pour ce motif de rendez-vous. | ||
= f.submit "Confirmer le rendez-vous", class: "fr-btn float-right fr-btn--lg" |
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,33 @@ | ||
.fr-grid-row.justify-content-md-center.fr-mb-16w | ||
.fr-col-8 | ||
h1.fr-h2 Rendez-vous confirmé | ||
.card | ||
.card-body | ||
div | ||
span.fr-icon-calendar-fill.fr-mr-1w[aria-hidden="true"] | ||
= "#{l(@rdv.starts_at, format: :human)} (#{@rdv.duration_in_min} minutes)" | ||
= " " | ||
= dsfr_link_to "voir dans l'agenda", admin_organisation_agent_agenda_path(@rdv.organisation, @rdv.agents.first, selected_event_id: @rdv.id, date: @rdv.starts_at.to_date), target: :blank | ||
|
||
.fr-mt-2w | ||
- if @rdv.lieu | ||
= lieu_icon(class: "fr-mr-1w") | ||
= @rdv.lieu.name | ||
br | ||
.fr-ml-4w= @rdv.lieu.address | ||
/ TODO: gérer les autres location types | ||
.fr-mt-2w | ||
= motif_icon(class: "fr-mr-1w") | ||
= "Motif : #{@rdv.motif.name}" | ||
|
||
.fr-mt-2w | ||
span.fr-icon-user-fill.fr-mr-1w[aria-hidden="true"] | ||
= @rdv_plan.user.full_name | ||
.fr-ml-4w= @rdv_plan.user.email | ||
.fr-ml-4w= @rdv_plan.user.phone_number | ||
|
||
.fr-mt-4w | ||
= link_to "Modifier", edit_admin_organisation_rdv_path(@rdv.organisation, @rdv), class: "fr-btn fr-btn--secondary", target: :blank | ||
- if @rdv_plan.return_url | ||
= link_to "Retour sur Mon Suivi Social", @rdv_plan.return_url, class: "float-right" |
12 changes: 12 additions & 0 deletions
12
app/views/agents/rdv_plans/summary/_location_type.html.slim
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,12 @@ | ||
/ locals(rdv_plan:) | ||
br | ||
- if rdv_plan.public_office? | ||
= lieu_icon(class: "fr-mr-1w") | ||
= rdv_plan.lieu.name | ||
- elsif rdv_plan.phone? | ||
= phone_icon(class: "fr-mr-1w") | ||
= "Par téléphone" | ||
- elsif rdv_plan.visio? | ||
= visio_icon(class: "fr-mr-1w") | ||
= "Par visio" | ||
= link_to "modifier", edit_modalites_agents_rdv_plan_path(rdv_plan), class: "fr-ml-2w" |
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,5 @@ | ||
/ locals(rdv_plan:) | ||
br | ||
= motif_icon(class: "fr-mr-1w") | ||
= rdv_plan.motif.name | ||
= link_to "modifier", edit_motif_agents_rdv_plan_path(rdv_plan), class: "fr-ml-2w" |
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,4 @@ | ||
/ locals(rdv_plan:) | ||
span.fr-icon-calendar-fill.fr-mr-1w[aria-hidden="true"] | ||
= "#{l(rdv_plan.starts_at, format: :human)} (#{rdv_plan.duration_in_minutes} minutes)" | ||
= link_to "modifier", edit_starts_at_agents_rdv_plan_path(rdv_plan), class: "fr-ml-2w" |
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 |
---|---|---|
|
@@ -457,3 +457,4 @@ tables: | |
- starts_at | ||
- created_at | ||
- updated_at | ||
- location_type |
Oops, something went wrong.