Rename Legislation Process final_publication_date field to more descriptive result_publication_date

This commit is contained in:
Bertocq
2017-06-13 19:47:12 +02:00
parent e26072b08c
commit 0c27f1ffde
16 changed files with 37 additions and 32 deletions

View File

@@ -45,7 +45,7 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
:draft_publication_date, :draft_publication_date,
:allegations_start_date, :allegations_start_date,
:allegations_end_date, :allegations_end_date,
:final_publication_date :result_publication_date
) )
end end
end end

View File

@@ -135,14 +135,14 @@
<div class="row"> <div class="row">
<div class="small-12 medium-4 column"> <div class="small-12 medium-4 column">
<%= f.label :final_publication_date %> <%= f.label :result_publication_date %>
</div> </div>
<div class="small-12 medium-2 column end"> <div class="small-12 medium-2 column end">
<%= f.text_field :final_publication_date, <%= f.text_field :result_publication_date,
label: false, label: false,
value: format_date_for_calendar_form(@process.final_publication_date), value: format_date_for_calendar_form(@process.result_publication_date),
class: "js-calendar-full", class: "js-calendar-full",
id: "final_publication_date" %> id: "result_publication_date" %>
</div> </div>
<div class="small-12 medium-2 column"> <div class="small-12 medium-2 column">
<%= check_box_tag :final_version_publication_phase_active, @process.active_phase?(:final_version_publication), @process.new_record? || @process.active_phase?(:final_version_publication), data: {disable_date: "final_publication"} %> <%= check_box_tag :final_version_publication_phase_active, @process.active_phase?(:final_version_publication), @process.new_record? || @process.active_phase?(:final_version_publication), data: {disable_date: "final_publication"} %>

View File

@@ -37,8 +37,8 @@
<% if process.active_phase?(:final_version_publication) %> <% if process.active_phase?(:final_version_publication) %>
<li <%= "class=active" if phase == :final_version_publication %>> <li <%= "class=active" if phase == :final_version_publication %>>
<%= link_to legislation_process_final_version_publication_path(process) do %> <%= link_to legislation_process_final_version_publication_path(process) do %>
<h4><%= t('legislation.processes.shared.final_publication_date') %></h4> <h4><%= t('legislation.processes.shared.result_publication_date') %></h4>
<p><%= format_date(process.final_publication_date) %></p> <p><%= format_date(process.result_publication_date) %></p>
<% end %> <% end %>
</li> </li>
<% end %> <% end %>

View File

@@ -37,8 +37,8 @@
<p><%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %></p> <p><%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %></p>
</div> </div>
<div class="small-6 medium-3 column"> <div class="small-6 medium-3 column">
<h5><%= t('legislation.processes.shared.final_publication_date') %></h5> <h5><%= t('legislation.processes.shared.result_publication_date') %></h5>
<p><%= format_date(process.final_publication_date) %></p> <p><%= format_date(process.result_publication_date) %></p>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -71,10 +71,10 @@
</div> </div>
<div class="small-12 medium-4 column"> <div class="small-12 medium-4 column">
<label for="legislation_process_final_publication_date">Publicación de resultados</label> <label for="legislation_process_result_publication_date">Publicación de resultados</label>
</div> </div>
<div class="small-12 medium-2 column end"> <div class="small-12 medium-2 column end">
<input class="js-calendar-full" id="final_publication_date" type="text" value="2016-12-30" name="legislation_process[final_publication_date]" /> <input class="js-calendar-full" id="result_publication_date" type="text" value="2016-12-30" name="legislation_process[result_publication_date]" />
</div> </div>
</div> </div>

View File

@@ -176,7 +176,7 @@ en:
draft_publication_date: Draft publication date draft_publication_date: Draft publication date
allegations_start_date: Allegations start date allegations_start_date: Allegations start date
allegations_end_date: Allegations end date allegations_end_date: Allegations end date
final_publication_date: Final result publication date result_publication_date: Final result publication date
legislation/draft_version: legislation/draft_version:
title: Version title title: Version title
body: Text body: Text

View File

@@ -171,7 +171,7 @@ es:
draft_publication_date: Fecha de publicación del borrador draft_publication_date: Fecha de publicación del borrador
allegations_start_date: Fecha de inicio de alegaciones allegations_start_date: Fecha de inicio de alegaciones
allegations_end_date: Fecha de fin de alegaciones allegations_end_date: Fecha de fin de alegaciones
final_publication_date: Fecha de publicación del resultado final result_publication_date: Fecha de publicación del resultado final
legislation/draft_version: legislation/draft_version:
title: Título de la version title: Título de la version
body: Texto body: Texto

View File

@@ -76,7 +76,7 @@ en:
debate_dates: Debate debate_dates: Debate
draft_publication_date: Draft publication draft_publication_date: Draft publication
allegations_dates: Allegations allegations_dates: Allegations
final_publication_date: Final result publication result_publication_date: Final result publication
questions: questions:
comments: comments:
comment_button: Publish answer comment_button: Publish answer

View File

@@ -76,7 +76,7 @@ es:
debate_dates: Debate previo debate_dates: Debate previo
draft_publication_date: Publicación borrador draft_publication_date: Publicación borrador
allegations_dates: Alegaciones allegations_dates: Alegaciones
final_publication_date: Publicación resultados result_publication_date: Publicación resultados
questions: questions:
comments: comments:
comment_button: Publicar respuesta comment_button: Publicar respuesta

View File

@@ -643,7 +643,7 @@ print "Creating legislation processes"
draft_publication_date: Date.current + 1.day, draft_publication_date: Date.current + 1.day,
allegations_start_date: Date.current + 2.days, allegations_start_date: Date.current + 2.days,
allegations_end_date: Date.current + 3.days, allegations_end_date: Date.current + 3.days,
final_publication_date: Date.current + 4.days result_publication_date: Date.current + 4.days
) )
end end

View File

@@ -0,0 +1,5 @@
class RenameLegislationProcessFinalPubToResultPub < ActiveRecord::Migration
def change
rename_column :legislation_processes, :final_publication_date, :result_publication_date
end
end

View File

@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170610211027) do ActiveRecord::Schema.define(version: 20170613174317) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@@ -412,7 +412,7 @@ ActiveRecord::Schema.define(version: 20170610211027) do
t.date "draft_publication_date" t.date "draft_publication_date"
t.date "allegations_start_date" t.date "allegations_start_date"
t.date "allegations_end_date" t.date "allegations_end_date"
t.date "final_publication_date" t.date "result_publication_date"
t.datetime "hidden_at" t.datetime "hidden_at"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
@@ -425,8 +425,8 @@ ActiveRecord::Schema.define(version: 20170610211027) do
add_index "legislation_processes", ["debate_start_date"], name: "index_legislation_processes_on_debate_start_date", using: :btree add_index "legislation_processes", ["debate_start_date"], name: "index_legislation_processes_on_debate_start_date", using: :btree
add_index "legislation_processes", ["draft_publication_date"], name: "index_legislation_processes_on_draft_publication_date", using: :btree add_index "legislation_processes", ["draft_publication_date"], name: "index_legislation_processes_on_draft_publication_date", using: :btree
add_index "legislation_processes", ["end_date"], name: "index_legislation_processes_on_end_date", using: :btree add_index "legislation_processes", ["end_date"], name: "index_legislation_processes_on_end_date", using: :btree
add_index "legislation_processes", ["final_publication_date"], name: "index_legislation_processes_on_final_publication_date", using: :btree
add_index "legislation_processes", ["hidden_at"], name: "index_legislation_processes_on_hidden_at", using: :btree add_index "legislation_processes", ["hidden_at"], name: "index_legislation_processes_on_hidden_at", using: :btree
add_index "legislation_processes", ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date", using: :btree
add_index "legislation_processes", ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree add_index "legislation_processes", ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree
create_table "legislation_question_options", force: :cascade do |t| create_table "legislation_question_options", force: :cascade do |t|

View File

@@ -611,7 +611,7 @@ FactoryGirl.define do
draft_publication_date Date.current - 1.day draft_publication_date Date.current - 1.day
allegations_start_date Date.current allegations_start_date Date.current
allegations_end_date Date.current + 3.days allegations_end_date Date.current + 3.days
final_publication_date Date.current + 5.days result_publication_date Date.current + 5.days
trait :next do trait :next do
start_date Date.current + 2.days start_date Date.current + 2.days
@@ -621,7 +621,7 @@ FactoryGirl.define do
draft_publication_date Date.current + 5.day draft_publication_date Date.current + 5.day
allegations_start_date Date.current + 5.days allegations_start_date Date.current + 5.days
allegations_end_date Date.current + 7.days allegations_end_date Date.current + 7.days
final_publication_date Date.current + 8.days result_publication_date Date.current + 8.days
end end
trait :past do trait :past do
@@ -632,7 +632,7 @@ FactoryGirl.define do
draft_publication_date Date.current - 8.day draft_publication_date Date.current - 8.day
allegations_start_date Date.current - 8.days allegations_start_date Date.current - 8.days
allegations_end_date Date.current - 4.days allegations_end_date Date.current - 4.days
final_publication_date Date.current - 2.days result_publication_date Date.current - 2.days
end end
trait :in_debate_phase do trait :in_debate_phase do
@@ -643,7 +643,7 @@ FactoryGirl.define do
draft_publication_date Date.current + 1.day draft_publication_date Date.current + 1.day
allegations_start_date Date.current + 2.days allegations_start_date Date.current + 2.days
allegations_end_date Date.current + 3.days allegations_end_date Date.current + 3.days
final_publication_date Date.current + 5.days result_publication_date Date.current + 5.days
end end
end end

View File

@@ -51,7 +51,7 @@ feature 'Admin legislation processes' do
fill_in 'legislation_process[draft_publication_date]', with: (base_date + 3.days).strftime("%d/%m/%Y") fill_in 'legislation_process[draft_publication_date]', with: (base_date + 3.days).strftime("%d/%m/%Y")
fill_in 'legislation_process[allegations_start_date]', with: (base_date + 3.days).strftime("%d/%m/%Y") fill_in 'legislation_process[allegations_start_date]', with: (base_date + 3.days).strftime("%d/%m/%Y")
fill_in 'legislation_process[allegations_end_date]', with: (base_date + 5.days).strftime("%d/%m/%Y") fill_in 'legislation_process[allegations_end_date]', with: (base_date + 5.days).strftime("%d/%m/%Y")
fill_in 'legislation_process[final_publication_date]', with: (base_date + 7.days).strftime("%d/%m/%Y") fill_in 'legislation_process[result_publication_date]', with: (base_date + 7.days).strftime("%d/%m/%Y")
click_button 'Create process' click_button 'Create process'

View File

@@ -104,7 +104,7 @@ feature 'Legislation' do
context 'final version publication phase' do context 'final version publication phase' do
scenario 'not open' do scenario 'not open' do
process = create(:legislation_process, final_publication_date: Date.current + 1.day) process = create(:legislation_process, result_publication_date: Date.current + 1.day)
visit legislation_process_final_version_publication_path(process) visit legislation_process_final_version_publication_path(process)
@@ -112,7 +112,7 @@ feature 'Legislation' do
end end
scenario 'open' do scenario 'open' do
process = create(:legislation_process, final_publication_date: Date.current) process = create(:legislation_process, result_publication_date: Date.current)
visit legislation_process_final_version_publication_path(process) visit legislation_process_final_version_publication_path(process)

View File

@@ -154,15 +154,15 @@ RSpec.describe Legislation::Process, type: :model do
it "checks final version publication phase" do it "checks final version publication phase" do
# future # future
process.update_attributes(final_publication_date: Date.current + 2.days) process.update_attributes(result_publication_date: Date.current + 2.days)
expect(process.open_phase?(:final_version_publication)).to be false expect(process.open_phase?(:final_version_publication)).to be false
# past # past
process.update_attributes(final_publication_date: Date.current - 2.days) process.update_attributes(result_publication_date: Date.current - 2.days)
expect(process.open_phase?(:final_version_publication)).to be true expect(process.open_phase?(:final_version_publication)).to be true
# starts today # starts today
process.update_attributes(final_publication_date: Date.current) process.update_attributes(result_publication_date: Date.current)
expect(process.open_phase?(:final_version_publication)).to be true expect(process.open_phase?(:final_version_publication)).to be true
end end
end end
@@ -220,15 +220,15 @@ RSpec.describe Legislation::Process, type: :model do
it "checks final version publication phase" do it "checks final version publication phase" do
# future # future
process.update_attributes(final_publication_date: Date.current + 2.days) process.update_attributes(result_publication_date: Date.current + 2.days)
expect(process.show_phase?(:final_version_publication)).to be false expect(process.show_phase?(:final_version_publication)).to be false
# past # past
process.update_attributes(final_publication_date: Date.current - 2.days) process.update_attributes(result_publication_date: Date.current - 2.days)
expect(process.show_phase?(:final_version_publication)).to be true expect(process.show_phase?(:final_version_publication)).to be true
# starts today # starts today
process.update_attributes(final_publication_date: Date.current) process.update_attributes(result_publication_date: Date.current)
expect(process.show_phase?(:final_version_publication)).to be true expect(process.show_phase?(:final_version_publication)).to be true
end end
end end