Remove usage of Investment's internal_comments attr

This commit is contained in:
Bertocq
2018-01-29 21:15:28 +01:00
parent b5cb5e2563
commit d280c254c8
6 changed files with 2 additions and 21 deletions

View File

@@ -70,7 +70,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
def valuation_params def valuation_params
params.require(:budget_investment).permit(:price, :price_first_year, :price_explanation, params.require(:budget_investment).permit(:price, :price_first_year, :price_explanation,
:feasibility, :unfeasibility_explanation, :feasibility, :unfeasibility_explanation,
:duration, :valuation_finished, :internal_comments) :duration, :valuation_finished)
end end
def restrict_access_to_assigned_items def restrict_access_to_assigned_items

View File

@@ -47,7 +47,3 @@
</p> </p>
<% end %> <% end %>
<% if @investment.internal_comments.present? %>
<h2><%= t("valuation.budget_investments.show.internal_comments") %></h2>
<%= explanation_field @investment.internal_comments %>
<% end %>

View File

@@ -89,13 +89,6 @@
</div> </div>
</div> </div>
<div class="row">
<div class="small-12 column">
<%= f.label :internal_comments, t("valuation.budget_investments.edit.internal_comments_html") %>
<%= f.text_area :internal_comments, label: false, rows: 3 %>
</div>
</div>
<div class="row"> <div class="row">
<div class="actions small-12 medium-4 column"> <div class="actions small-12 medium-4 column">
<%= f.submit(class: "button expanded large", value: t("valuation.budget_investments.edit.save")) %> <%= f.submit(class: "button expanded large", value: t("valuation.budget_investments.edit.save")) %>

View File

@@ -53,7 +53,6 @@ en:
undefined: Undefined undefined: Undefined
valuation_finished: Valuation finished valuation_finished: Valuation finished
duration: Time scope duration: Time scope
internal_comments: Internal comments
responsibles: Responsibles responsibles: Responsibles
assigned_admin: Assigned admin assigned_admin: Assigned admin
assigned_valuators: Assigned valuators assigned_valuators: Assigned valuators
@@ -71,7 +70,6 @@ en:
valuation_finished_alert: "Are you sure you want to mark this report as completed? If you do it, it can no longer be modified." valuation_finished_alert: "Are you sure you want to mark this report as completed? If you do it, it can no longer be modified."
not_feasible_alert: "An email will be sent immediately to the author of the project with the report of unfeasibility." not_feasible_alert: "An email will be sent immediately to the author of the project with the report of unfeasibility."
duration_html: Time scope duration_html: Time scope
internal_comments_html: Internal comments
save: Save changes save: Save changes
notice: notice:
valuate: "Dossier updated" valuate: "Dossier updated"

View File

@@ -53,7 +53,6 @@ es:
undefined: Sin definir undefined: Sin definir
valuation_finished: Informe finalizado valuation_finished: Informe finalizado
duration: Plazo de ejecución duration: Plazo de ejecución
internal_comments: Comentarios internos
responsibles: Responsables responsibles: Responsables
assigned_admin: Administrador asignado assigned_admin: Administrador asignado
assigned_valuators: Evaluadores asignados assigned_valuators: Evaluadores asignados
@@ -71,7 +70,6 @@ es:
valuation_finished_alert: "¿Estás seguro/a de querer marcar este informe como completado? Una vez hecho, no se puede deshacer la acción." valuation_finished_alert: "¿Estás seguro/a de querer marcar este informe como completado? Una vez hecho, no se puede deshacer la acción."
not_feasible_alert: "Un email será enviado inmediatamente al autor del proyecto con el informe de inviabilidad." not_feasible_alert: "Un email será enviado inmediatamente al autor del proyecto con el informe de inviabilidad."
duration_html: Plazo de ejecución <small>(opcional, dato no público)</small> duration_html: Plazo de ejecución <small>(opcional, dato no público)</small>
internal_comments_html: Comentarios y observaciones <small>(para responsables internos, dato no público)</small>
save: Guardar Cambios save: Guardar Cambios
notice: notice:
valuate: "Dossier actualizado" valuate: "Dossier actualizado"

View File

@@ -235,7 +235,6 @@ feature 'Valuation budget investments' do
within('#duration') { expect(page).to have_content('Undefined') } within('#duration') { expect(page).to have_content('Undefined') }
within('#feasibility') { expect(page).to have_content('Undecided') } within('#feasibility') { expect(page).to have_content('Undecided') }
expect(page).not_to have_content('Valuation finished') expect(page).not_to have_content('Valuation finished')
expect(page).not_to have_content('Internal comments')
end end
scenario 'Edit dossier' do scenario 'Edit dossier' do
@@ -249,7 +248,6 @@ feature 'Valuation budget investments' do
fill_in 'budget_investment_price_explanation', with: 'Very cheap idea' fill_in 'budget_investment_price_explanation', with: 'Very cheap idea'
choose 'budget_investment_feasibility_feasible' choose 'budget_investment_feasibility_feasible'
fill_in 'budget_investment_duration', with: '19 months' fill_in 'budget_investment_duration', with: '19 months'
fill_in 'budget_investment_internal_comments', with: 'Should be double checked by the urbanism area'
click_button 'Save changes' click_button 'Save changes'
expect(page).to have_content "Dossier updated" expect(page).to have_content "Dossier updated"
@@ -263,8 +261,6 @@ feature 'Valuation budget investments' do
within('#duration') { expect(page).to have_content('19 months') } within('#duration') { expect(page).to have_content('19 months') }
within('#feasibility') { expect(page).to have_content('Feasible') } within('#feasibility') { expect(page).to have_content('Feasible') }
expect(page).not_to have_content('Valuation finished') expect(page).not_to have_content('Valuation finished')
expect(page).to have_content('Internal comments')
expect(page).to have_content('Should be double checked by the urbanism area')
end end
scenario 'Feasibility can be marked as pending' do scenario 'Feasibility can be marked as pending' do
@@ -290,7 +286,7 @@ feature 'Valuation budget investments' do
scenario 'Feasibility selection makes proper fields visible', :js do scenario 'Feasibility selection makes proper fields visible', :js do
feasible_fields = ['Price (€)', 'Cost during the first year (€)', 'Price explanation', 'Time scope'] feasible_fields = ['Price (€)', 'Cost during the first year (€)', 'Price explanation', 'Time scope']
unfeasible_fields = ['Feasibility explanation'] unfeasible_fields = ['Feasibility explanation']
any_feasibility_fields = ['Valuation finished', 'Internal comments'] any_feasibility_fields = ['Valuation finished']
undecided_fields = feasible_fields + unfeasible_fields + any_feasibility_fields undecided_fields = feasible_fields + unfeasible_fields + any_feasibility_fields
visit edit_valuation_budget_budget_investment_path(@budget, @investment) visit edit_valuation_budget_budget_investment_path(@budget, @investment)