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

Check dir role on da generation #1224

Merged
merged 3 commits into from
Nov 21, 2024
Merged
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
7 changes: 2 additions & 5 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ def attributive_decisions_download_button
)
end

def attributive_decisions_reissue_button
def attributive_decisions_reissue_generation_form
return unless current_establishment.with_attributive_decisions?(selected_school_year)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quel est l'intérêt de garder cette condition alors qu'on l'a déjà dans la '_attributive_decisions_panel.html.haml' ?


button_to "Rééditer les décisions d'attribution",
school_year_establishment_reissue_attributive_decisions_path(selected_school_year, current_establishment),
method: :post,
class: "fr-btn fr-btn--tertiary"
render partial: "home/attributive_decision_reissue_form"
end

def attributive_decisions_generation_form
Expand Down
4 changes: 2 additions & 2 deletions app/views/classes/_attributive_decisions_panel.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
%p Les décisions d'attribution sont en train d'être éditées, veuillez rafraichir la page dans quelques minutes. Vous pouvez commencer à remplir des coordonnées bancaires ou des PFMPs pendant ce temps.
- else
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ce n'est pas mieux d'avoir la condition "current_user.director?" en faisant un "elsif" plutôt que de dupliquer la condition ?

.buttons-group
- if current_establishment.missing_attributive_decisions?(selected_school_year)
- if current_establishment.missing_attributive_decisions?(selected_school_year) && current_user.director?
= attributive_decisions_generation_form
= attributive_decisions_download_button
- if current_establishment.with_attributive_decisions?(selected_school_year) && current_user.director?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renommer 'with_attributive_decisions?' par 'some_attributive_decisions?' ne serait pas mieux ?

= attributive_decisions_reissue_button
= attributive_decisions_reissue_generation_form
12 changes: 12 additions & 0 deletions app/views/home/_attributive_decision_reissue_form.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
%section.fr-accordion
%h3.fr-accordion__title
%button.fr-accordion__btn{"aria-controls" => "accordion-106", "aria-expanded" => "false"}
Rééditer les décisions d'attribution précédemment éditées
.fr-collapse#accordion-106
= form_with method: :post, url: school_year_establishment_reissue_attributive_decisions_path(selected_school_year, current_establishment) do |form|
.fr-checkbox-group
= form.check_box :confirmed_director, checked: current_user.confirmed_director?
= form.label :confirmed_director, class: "fr-label" do
= t("panels.attributive_decisions.confirm_director").html_safe
.fr-text--sm.fr-mt-1w= confirmed_director_information
= form.submit "Rééditer les décisions d'attribution", class: "fr-btn fr-btn--secondary"
3 changes: 2 additions & 1 deletion features/step_definitions/web_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
end

Quand("je coche {string}") do |label|
check label
# TODO: prevent ambiguity match with reissue checkbox
first(:checkbox, label).set(true)
end

Quand("je clique sur {string} dans la rangée {string}") do |link, row|
Expand Down