Add notice when supporting an investment

It was hard to notice what was going on when supporting one investment
which was at the bottom of the investment index page.

I wonder whether we should add the title of the investment to this text;
I'm not doing so because we don't do that anywhere else.
This commit is contained in:
Javi Martín
2021-06-13 14:40:56 +02:00
parent 0214184b2d
commit 071da81be6
6 changed files with 17 additions and 2 deletions

View File

@@ -92,8 +92,13 @@ module Budgets
def vote def vote
@investment.register_selection(current_user) @investment.register_selection(current_user)
respond_to do |format| respond_to do |format|
format.html { redirect_to budget_investments_path(heading_id: @investment.heading.id) } format.html do
redirect_to budget_investments_path(heading_id: @investment.heading.id),
notice: t("flash.actions.create.support")
end
format.js format.js
end end
end end

View File

@@ -40,8 +40,13 @@ class Management::Budgets::InvestmentsController < Management::BaseController
def vote def vote
@investment.register_selection(managed_user) @investment.register_selection(managed_user)
respond_to do |format| respond_to do |format|
format.html { redirect_to management_budget_investments_path(heading_id: @investment.heading.id) } format.html do
redirect_to management_budget_investments_path(heading_id: @investment.heading.id),
notice: t("flash.actions.create.support")
end
format.js format.js
end end
end end

View File

@@ -14,6 +14,7 @@ en:
proposal_notification: "Your message has been sent correctly." proposal_notification: "Your message has been sent correctly."
budget_investment: "Budget Investment created successfully." budget_investment: "Budget Investment created successfully."
signature_sheet: "Signature sheet created successfully" signature_sheet: "Signature sheet created successfully"
support: "Investment supported successfully"
topic: "Topic created successfully." topic: "Topic created successfully."
valuator_group: "Valuator group created successfully" valuator_group: "Valuator group created successfully"
save_changes: save_changes:

View File

@@ -14,6 +14,7 @@ es:
proposal_notification: "Tu mensaje ha sido enviado correctamente." proposal_notification: "Tu mensaje ha sido enviado correctamente."
budget_investment: "Proyecto de gasto creado correctamente." budget_investment: "Proyecto de gasto creado correctamente."
signature_sheet: "Hoja de firmas creada correctamente" signature_sheet: "Hoja de firmas creada correctamente"
support: "Proyecto de gasto apoyado correctamente"
topic: "Tema creado correctamente." topic: "Tema creado correctamente."
valuator_group: "Grupo de evaluadores creado correctamente" valuator_group: "Grupo de evaluadores creado correctamente"
save_changes: save_changes:

View File

@@ -127,6 +127,8 @@ describe "Votes" do
"Share it!" "Share it!"
end end
expect(page).to have_content "Investment supported successfully"
visit budget_investments_path(budget, heading_id: san_francisco.id) visit budget_investments_path(budget, heading_id: san_francisco.id)
within("#budget_investment_#{san_francisco_investment.id}") do within("#budget_investment_#{san_francisco_investment.id}") do

View File

@@ -329,6 +329,7 @@ describe "Budget Investments" do
expect(page).to have_content "1 support" expect(page).to have_content "1 support"
expect(page).to have_content "You have already supported this investment project. Share it!" expect(page).to have_content "You have already supported this investment project. Share it!"
expect(page).to have_content "Investment supported successfully"
expect(page).to have_content "CONSUL\nMANAGEMENT" expect(page).to have_content "CONSUL\nMANAGEMENT"
end end