-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Adds draft phase functionality in legislation processes #3048
Adds draft phase functionality in legislation processes #3048
Conversation
Hi @jaflutz, Thanks for the PR! 🙏 😌 I leave you some comments on the code 😉 |
</div> | ||
|
||
<div class="small-12 medium-3 column"> | ||
<%= f.label :draft_start_date, t("admin.legislation.processes.form.start") %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you delete this <%= f.label...
and use: 🙏
<%= f.text_field :draft_start_date,
label: t("admin.legislation.processes.form.start"),
value: format_date_for_calendar_form(@process.draft_start_date),
class: "js-calendar-full",
id: "draft_start_date" %>
</div> | ||
|
||
<div class="small-12 medium-3 column"> | ||
<%= f.label :draft_end_date, t("admin.legislation.processes.form.end") %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you delete this <%= f.label...
and use: 🙏
<%= f.text_field :draft_end_date,
label: t("admin.legislation.processes.form.end"),
value: format_date_for_calendar_form(@process.draft_end_date),
class: "js-calendar-full",
id: "draft_end_date" %>
@@ -46,6 +76,7 @@ | |||
<hr> | |||
</div> | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove unnecessary blank line 😉
spec/factories/legislations.rb
Outdated
draft_publication_date { Date.current - 1.day } | ||
allegations_start_date { Date.current } | ||
allegations_end_date { Date.current + 3.days } | ||
proposals_phase_start_date { Date.current } | ||
proposals_phase_end_date { Date.current + 2.days } | ||
result_publication_date { Date.current + 5.days } | ||
#draft_phase_enabled true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove the three commented lines on this file 😉
|
||
fill_in 'legislation_process_title_en', with: 'An example legislation process in draft phase' | ||
fill_in 'legislation_process_summary_en', with: 'Summary of the process' | ||
fill_in 'legislation_process_description_en', with: 'Describing the process' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spec it failing right now, could you change these lines to:
fill_in 'Process Title', with: 'An example legislation process in draft phase'
fill_in 'Summary', with: 'Summary of the process'
fill_in 'Description', with: 'Describing the process'
This change avoid spec fails 😉
@@ -340,6 +342,8 @@ en: | |||
invalid_date_range: must be on or after the start date | |||
debate_end_date: | |||
invalid_date_range: must be on or after the debate start date | |||
draft_end_date: | |||
invalid_date_range: must be on or after the draft start date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you include locales/es/activerecord.yml
file with this: 🙏
draft_start_date: Fecha de inicio del borrador
draft_end_date: Fecha de fin del borrador
draft_end_date:
invalid_date_range: tiene que ser igual o posterior a la fecha de inicio del borrador
@@ -373,6 +373,8 @@ en: | |||
enabled: Enabled | |||
process: Process | |||
debate_phase: Debate phase | |||
draft_phase: Draft phase | |||
draft_phase_description: If this phase is active, the process won't be listed on processes index. Allow to preview the process and create content before the start. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you include locales/es/admin.yml
file with this: 🙏
draft_phase: Fase de borrador
draft_phase_description: Si esta fase está activa, el proceso no aparecerá en la página de procesos. Permite previsualizar el proceso y crear contenido antes del inicio.
@@ -75,6 +77,48 @@ | |||
expect(page).to have_content 'Summary of the process' | |||
expect(page).not_to have_content 'Describing the process' | |||
end | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove unnecessary blank line 😉
5a6696f
to
34b58a5
Compare
@decabeza and @voodoorai2000, thanks for reviewing the PR! |
Thank you so much @jaflutz! Nice work 👌 |
References
#2930 - Legislation process draft phase
Objectives
Adds a draft phase to the legislation process, and hides processes in this phase when enabled
Visual Changes