Display milestone_tags input for investments, display milestone_tags on admin and tests
This commit is contained in:
@@ -83,7 +83,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
|
||||
params.require(:budget_investment)
|
||||
.permit(:title, :description, :external_url, :heading_id, :administrator_id, :tag_list,
|
||||
:valuation_tag_list, :incompatible, :visible_to_valuators, :selected,
|
||||
valuator_ids: [], valuator_group_ids: [])
|
||||
:milestone_tag_list, valuator_ids: [], valuator_group_ids: [])
|
||||
end
|
||||
|
||||
def load_budget
|
||||
|
||||
@@ -105,6 +105,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :milestone_tag_list, t("admin.budget_investments.edit.milestone_tags") %>
|
||||
<%= f.text_field :milestone_tag_list,
|
||||
value: @investment.milestone_tag_list.sort.join(", "),
|
||||
label: false %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.submit(class: "button", value: t("admin.budget_investments.edit.submit_button")) %>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
polymorphic_path([:admin, *resource_hierarchy_for(milestoneable.progress_bars.new)]),
|
||||
class: "button hollow float-right" %>
|
||||
|
||||
<% if milestoneable.milestone_tag_list.any? %>
|
||||
<div>
|
||||
<b><%= t("admin.milestones.index.milestone_tags") %>:</b> <%= milestoneable.milestone_tag_list.sort.join(", ") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if milestoneable.milestones.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
@@ -281,6 +281,7 @@ en:
|
||||
tags_placeholder: "Write the tags you want separated by commas (,)"
|
||||
undefined: Undefined
|
||||
user_groups: "Groups"
|
||||
milestone_tags: Milestone tags
|
||||
search_unfeasible: Search unfeasible
|
||||
milestones:
|
||||
index:
|
||||
|
||||
@@ -3,6 +3,7 @@ en:
|
||||
index:
|
||||
no_milestones: Don't have defined milestones
|
||||
progress: Progress
|
||||
milestone_tags: Milestone Tags
|
||||
show:
|
||||
publication_date: "Published %{publication_date}"
|
||||
status_changed: Status changed to
|
||||
|
||||
@@ -281,6 +281,7 @@ es:
|
||||
tags_placeholder: "Escribe las etiquetas que desees separadas por comas (,)"
|
||||
undefined: Sin definir
|
||||
user_groups: "Grupos"
|
||||
milestone_tags: Etiquetas de Seguimiento
|
||||
search_unfeasible: Buscar inviables
|
||||
milestones:
|
||||
index:
|
||||
|
||||
@@ -3,6 +3,7 @@ es:
|
||||
index:
|
||||
no_milestones: No hay hitos definidos
|
||||
progress: Progreso
|
||||
milestone_tags: Etiquetas de Seguimiento
|
||||
show:
|
||||
publication_date: "Publicado el %{publication_date}"
|
||||
status_changed: El proyecto ha cambiado al estado
|
||||
|
||||
@@ -1331,6 +1331,22 @@ describe "Admin budget investments" do
|
||||
expect(page).to have_content "can't be blank"
|
||||
end
|
||||
|
||||
scenario "Add milestone tags" do
|
||||
budget_investment = create(:budget_investment)
|
||||
|
||||
visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment)
|
||||
expect(page).not_to have_content("Milestone Tags:")
|
||||
|
||||
click_link "Edit classification"
|
||||
|
||||
fill_in "budget_investment_milestone_tag_list", with: "tag1, tag2"
|
||||
|
||||
click_button "Update"
|
||||
|
||||
expect(page).to have_content "Investment project updated succesfully."
|
||||
expect(page).to have_content("Milestone Tags: tag1, tag2")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "Selecting" do
|
||||
|
||||
Reference in New Issue
Block a user