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

Adds draft phase functionality in legislation processes #3048

Merged

Conversation

jaflutz
Copy link
Collaborator

@jaflutz jaflutz commented Nov 19, 2018

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

screenshot-draft-phase

@decabeza
Copy link
Collaborator

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") %>
Copy link
Collaborator

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") %>
Copy link
Collaborator

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>


Copy link
Collaborator

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 😉

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
Copy link
Collaborator

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'
Copy link
Collaborator

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
Copy link
Collaborator

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.
Copy link
Collaborator

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

Copy link
Collaborator

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 😉

@jaflutz
Copy link
Collaborator Author

jaflutz commented Nov 20, 2018

@decabeza and @voodoorai2000, thanks for reviewing the PR!

@voodoorai2000
Copy link
Member

Thank you so much @jaflutz! Nice work 👌

@voodoorai2000 voodoorai2000 merged commit 2ef8361 into consuldemocracy:master Nov 27, 2018
@voodoorai2000 voodoorai2000 added this to Release 0.18 in Roadmap Nov 27, 2018
@jaflutz jaflutz deleted the 2930-draft-phase-processes branch December 4, 2018 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants