From: Andy Allan Date: Wed, 28 Feb 2018 06:39:40 +0000 (+0800) Subject: Remove reporting of changesets X-Git-Tag: live~3651^2~49 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/3006ce9713da119ecbe9e0e1f915df53ff1a898f Remove reporting of changesets --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index dc04606f7..90fd0306d 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -88,7 +88,7 @@ class IssuesController < ApplicationController def set_issues @admin_issues = %w[DiaryEntry DiaryComment User] - @moderator_issues = %w[Changeset Note] + @moderator_issues = %w[Note] end def check_if_updated diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 36837d228..3c13c6536 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -7,8 +7,6 @@ module IssuesHelper url_for(:controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name) when DiaryComment url_for(:controller => reportable.diary_entry.class.name.underscore, :action => :view, :display_name => reportable.diary_entry.user.display_name, :id => reportable.diary_entry.id, :anchor => "comment#{reportable.id}") - when Changeset - url_for(:controller => :browse, :action => :changeset, :id => reportable.id) when Note url_for(:controller => :browse, :action => :note, :id => reportable.id) end @@ -22,8 +20,6 @@ module IssuesHelper reportable.display_name when DiaryComment "#{reportable.diary_entry.title}, Comment id ##{reportable.id}" - when Changeset - "Changeset ##{reportable.id}" when Note "Note ##{reportable.id}" end diff --git a/app/models/issue.rb b/app/models/issue.rb index 9eb6aac4c..d13f297a9 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -93,7 +93,7 @@ class Issue < ActiveRecord::Base end def set_default_assigned_role - role = %w[Changeset Note].include?(reportable.class.name) ? "moderator" : "administrator" + role = %w[Note].include?(reportable.class.name) ? "moderator" : "administrator" self.assigned_role = role if assigned_role.blank? end end diff --git a/app/models/report.rb b/app/models/report.rb index eda70f865..fcfa61b98 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -33,7 +33,6 @@ class Report < ActiveRecord::Base when "DiaryEntry" then %w[spam offensive threat other] when "DiaryComment" then %w[spam offensive threat other] when "User" then %w[spam offensive threat vandal other] - when "Changeset" then %w[undiscussed_import mechanical_edit edit_error spam vandalism other] when "Note" then %w[spam vandalism personal abusive other] else %w[other] end diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index afc3fc16c..6a3e85680 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -3,11 +3,6 @@

<%= t('browse.changeset.title', :id => @changeset.id) %> - <% if current_user and current_user.id != @changeset.user.id %> - <%= link_to new_report_url(reportable_id: @changeset.id, reportable_type: @changeset.class.name), :title => t('browse.changeset.report') do %> -  ⚐ - <% end %> - <% end %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 3e8af685c..3ff6b8c12 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -131,7 +131,6 @@ en: title_comment: "Changeset %{id} - %{comment}" join_discussion: "Log in to join the discussion" discussion: Discussion - report: Report this changeset? still_open: "Changeset still open - discussion will open once the changeset is closed." node: title: "Node: %{name}" @@ -1000,13 +999,6 @@ en: threat: This User profile contains a threat vandal: This User is a vandal other: Other - Changeset: - undiscussed_import: This changeset is an undiscussed import - mechanical_edit: This changeset is a mechanical edit - edit_error: This changeset contains a newbie or an editor error - spam: This changeset is/contains spam - vandalism: This changeset is/contains vandalism - other: Other Note: spam: This note is spam vandalism: This note is vandalism diff --git a/test/models/issue_test.rb b/test/models/issue_test.rb index 49649eede..5af3779b5 100644 --- a/test/models/issue_test.rb +++ b/test/models/issue_test.rb @@ -25,7 +25,7 @@ class IssueTest < ActiveSupport::TestCase def test_default_assigned_role create(:language, :code => "en") diary_entry = create(:diary_entry) - changeset = create(:changeset) + note = create(:note_with_comments) issue = Issue.new issue.reportable = diary_entry @@ -33,7 +33,7 @@ class IssueTest < ActiveSupport::TestCase assert_equal "administrator", issue.assigned_role issue = Issue.new - issue.reportable = changeset + issue.reportable = note issue.save! assert_equal "moderator", issue.assigned_role