From bc0f0407583b3697c4569451b4cfa2ded94a1c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 27 Jun 2021 23:40:04 +0200 Subject: [PATCH] Use order links in legislation proposals admin As mentioned in the previous commits, a ` - <% @valid_orders.each do |order| %> - <% value = current_path_with_query_params(order: order, page: 1) %> - - <% end %> - - - - -<% end %> diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index 87697fe2f..08a5bebff 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -157,7 +157,6 @@ ignore_unused: - "admin.legislation.processes.index.filter*" - "admin.legislation.processes.*.submit_button" - "admin.legislation.processes.proposals.orders.*" - - "admin.legislation.processes.proposals.select_order" - "admin.legislation.draft_versions.*.submit_button" - "admin.legislation.questions.*.submit_button" - "admin.hidden_comments.index.hidden_*" diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 564ef35dc..315641017 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -584,11 +584,10 @@ en: title: Create new collaborative legislation process submit_button: Create process proposals: - select_order: Sort by orders: - id: Id - title: Title - supports: Total supports + id: "Sort by ID" + title: "Sort by title" + supports: "Sort by total supports" process: title: Process comments: Comments diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 930343b95..bd53a4758 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -584,11 +584,10 @@ es: title: Crear nuevo proceso de legislación colaborativa submit_button: Crear proceso proposals: - select_order: Ordenar por orders: - id: Id - title: Título - supports: Apoyos totales + id: "Ordenar por ID" + title: "Ordenar por título" + supports: "Ordenar por apoyos totales" process: title: Proceso comments: Comentarios diff --git a/spec/system/admin/legislation/proposals_spec.rb b/spec/system/admin/legislation/proposals_spec.rb index ff8fad6b9..8653594f2 100644 --- a/spec/system/admin/legislation/proposals_spec.rb +++ b/spec/system/admin/legislation/proposals_spec.rb @@ -33,7 +33,7 @@ describe "Admin collaborative legislation", :admin do create(:legislation_proposal, title: "cccc", legislation_process_id: process.id) visit admin_legislation_process_proposals_path(process.id) - select "Title", from: "order-selector-participation" + click_link "Sort by title" within("#legislation_proposals_list") do within all(".legislation_proposal")[0] { expect(page).to have_content("aaaa") } @@ -49,7 +49,7 @@ describe "Admin collaborative legislation", :admin do create(:legislation_proposal, cached_votes_score: 20, legislation_process_id: process.id) visit admin_legislation_process_proposals_path(process.id) - select "Total supports", from: "order-selector-participation" + click_link "Sort by total supports" within("#legislation_proposals_list") do within all(".legislation_proposal")[0] { expect(page).to have_content("30") } @@ -65,7 +65,7 @@ describe "Admin collaborative legislation", :admin do proposal3 = create(:legislation_proposal, title: "cccc", legislation_process_id: process.id) visit admin_legislation_process_proposals_path(process.id, order: :title) - select "Id", from: "order-selector-participation" + click_link "Sort by ID" within("#legislation_proposals_list") do within all(".legislation_proposal")[0] { expect(page).to have_content(proposal1.id) }