Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
remove issue auto watch, because it is a feature of Redmine 5
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Apr 1, 2022
1 parent 5cdba29 commit e411d3f
Show file tree
Hide file tree
Showing 25 changed files with 20 additions and 168 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
+++++

- D3 7.4.0 support
- Remove issue autowatch (this feature comes with Redmine 5)

3.0.5.2
+++++++
Expand Down
2 changes: 0 additions & 2 deletions app/views/additionals/settings/_issues.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ p
= additionals_settings_checkbox :issue_assign_to_me
p
= additionals_settings_checkbox :issue_change_status_in_sidebar
p
= additionals_settings_checkbox :issue_autowatch_involved
p
= additionals_settings_checkbox :issue_freezed_with_close
em.info = t :rule_issue_freezed_with_close_info
Expand Down
4 changes: 0 additions & 4 deletions app/views/users/_autowatch_involved_issue.html.slim

This file was deleted.

2 changes: 0 additions & 2 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ cs:
error_query_statement_invalid: "Při provádění dotazu došlo k chybě a bylo zaznamenáno. Nahlaste tuto chybu administrátorovi Redmine."
errors_no_or_invalid_arguments: "Žádné nebo neplatné argumenty"
field_always_expose: "Vždy zobrazit název palubní desky"
field_autowatch_involved_issue: "Problémy s automatickým sledováním"
field_color: Barva
field_enable_sidebar: Enable sidebar
field_hide: "Skrýt"
Expand Down Expand Up @@ -96,7 +95,6 @@ cs:
label_invalid_feed_data: "Neplatná data zdroje nebo adresa URL"
label_issue_assign_to_me: Show "Assign to me" on issue
label_issue_auto_assign: "If \"Assigned to\" is not assigned to a user and the new issue status is x then the issue is auto assigned to the first group with users of the pre-defined role."
label_issue_autowatch_involved: "Automaticky přidejte zúčastněné uživatele jako sledovatele"
label_issue_change_status_in_sidebar: "Stav vydání na postranním panelu"
label_issue_change_status: "Změnit stav"
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ de:
error_query_statement_invalid: Beim Ausführen der Query ist ein Fehler aufgetreten und wurde protokolliert. Bitte melden Sie diesen Fehler Ihrem Redmine-Administrator.
errors_no_or_invalid_arguments: Kein oder ungültiger Parameter
field_always_expose: Dashboard Name immer anzeigen
field_autowatch_involved_issue: Involvierte Tickets automatisch beobachten
field_color: Farbe
field_enable_sidebar: Sidebar aktivieren
field_hide: Verstecken
Expand Down Expand Up @@ -96,7 +95,6 @@ de:
label_invalid_feed_data: Ungültige Feed Daten oder URL
label_issue_assign_to_me: Ticket "Mir zuweisen" anzeigen
label_issue_auto_assign: "Wird \"Zugewiesen an\" nicht zugewiesen und der neue Ticketstatus ist x, dann wird die ersten Gruppe mit Benutzern der festgelegten Rolle das Ticket zugewiesen."
label_issue_autowatch_involved: Involvierte Benutzer automatisch als Beobachter hinzufügen
label_issue_change_status_in_sidebar: Ticketstatus über Sidebar
label_issue_change_status: Status ändern
label_issue_current_user_status: "Der Ticketstatus x ist nur erlaubt, wenn \"Zugewiesen an\" der aktuelle Benutzer zugewiesen wird."
Expand Down
4 changes: 1 addition & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ en:
error_query_statement_invalid: An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator.
errors_no_or_invalid_arguments: No or invalid arguments
field_always_expose: Always show dashboard name
field_autowatch_involved_issue: Autowatch involved issues
field_color: Color
field_enable_sidebar: Enable sidebar
field_hide: Hide
Expand Down Expand Up @@ -96,7 +95,6 @@ en:
label_invalid_feed_data: "Invalid feed data or URL"
label_issue_assign_to_me: Show "Assign to me" on issue
label_issue_auto_assign: "If \"Assigned to\" is not assigned to a user and the new issue status is x then the issue is auto assigned to the first group with users of the pre-defined role."
label_issue_autowatch_involved: Add involved users as watcher automatically
label_issue_change_status_in_sidebar: Issue status on sidebar
label_issue_change_status: Change status
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
Expand Down Expand Up @@ -194,4 +192,4 @@ en:
label_show_closed_issues: Show closed issues
max_live_search_results_info: "Number of maximum search results for LiveSearch. Note: Setting only affects plugins that support LiveSearch."
label_max_live_search_results: "Maximum number of LiveSearch results"
info_live_search_result_restriction: "LiveSearch results are limited to %{value} entries. Try to filter your search a better way."
info_live_search_result_restriction: "LiveSearch results are limited to %{value} entries. Try to filter your search a better way."
2 changes: 0 additions & 2 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ es:
error_query_statement_invalid: Ocurrió un error ejecutando la consulta y fue registrado. Por favor informe este error al administrador de Redmine.
errors_no_or_invalid_arguments: Parámetros inválidos
field_always_expose: "Mostrar siempre el nombre del salpicadero"
field_autowatch_involved_issue: Automonitorear las peticiones en las que estoy involucrado
field_color: Color
field_enable_sidebar: Enable sidebar
field_hide: "Ocultar"
Expand Down Expand Up @@ -96,7 +95,6 @@ es:
label_invalid_feed_data: "Datos o URL de alimentación inválidos"
label_issue_assign_to_me: Mostrar "Asignar a mi mismo" en las peticiones
label_issue_auto_assign: "Si \"Asignado a\" no es asignado a un usuario y el estado de la nueva petición es x, entonces la petición es auto asignada al primer grupo con usuarios del rol predefinido."
label_issue_autowatch_involved: Agregar a los usuarios involucrados como Monitorizadores automáticamente
label_issue_change_status_in_sidebar: Estado de las peticiones en la barra lateral
label_issue_change_status: Cambiar estado
label_issue_current_user_status: "Estado de la petición actual x solo está permitido si la petición está asignada al usuario actual."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ fr:
error_query_statement_invalid: "Une erreur s'est produite lors de l'exécution de la requête et a été enregistrée. Veuillez signaler cette erreur à votre administrateur Redmine."
errors_no_or_invalid_arguments: "Pas d'arguments ou arguments invalides"
field_always_expose: "Toujours afficher le nom du tableau de bord"
field_autowatch_involved_issue: "Problèmes liés à la surveillance automatique"
field_color: Couleur
field_enable_sidebar: Activer le menu latéral
field_hide: "Cacher"
Expand Down Expand Up @@ -96,7 +95,6 @@ fr:
label_invalid_feed_data: "Données d'alimentation ou URL invalides"
label_issue_assign_to_me: Voir "M'affecter" sur les tâches
label_issue_auto_assign: "If \"Assigned to\" is not assigned to a user and the new issue status is x then the issue is auto assigned to the first group with users of the pre-defined role."
label_issue_autowatch_involved: "Ajout automatique des utilisateurs impliqués en tant qu'observateurs"
label_issue_change_status_in_sidebar: Statuts des tâches dans la bare latérale
label_issue_change_status: Modifier le statut
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ it:
error_query_statement_invalid: An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator.
errors_no_or_invalid_arguments: No o non valido argomenti
field_always_expose: "Mostra sempre il nome del portale"
field_autowatch_involved_issue: Autowatch involved issues
field_color: Colore
field_enable_sidebar: Enable sidebar
field_hide: "Nascondi"
Expand Down Expand Up @@ -96,7 +95,6 @@ it:
label_invalid_feed_data: "Dati di alimentazione o URL non validi"
label_issue_assign_to_me: Show "Assign to me" on issue
label_issue_auto_assign: "If \"Assigned to\" is not assigned to a user and the new issue status is x then the issue is auto assigned to the first group with users of the pre-defined role."
label_issue_autowatch_involved: Add involved users as watcher automatically
label_issue_change_status_in_sidebar: Issue status on sidebar
label_issue_change_status: Modifica issue stato
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ ja:
error_query_statement_invalid: "クエリの実行中にエラーが発生し、ログに記録されました。このエラーをRedmine管理者に報告してください。"
errors_no_or_invalid_arguments: "引数がない、または無効な引数"
field_always_expose: "ダッシュボード名を常に表示する"
field_autowatch_involved_issue: Autowatch involved issues
field_color: Color
field_enable_sidebar: Enable sidebar
field_hide: Hide
Expand Down Expand Up @@ -96,7 +95,6 @@ ja:
label_invalid_feed_data: "無効なフィードデータまたはURL"
label_issue_assign_to_me: Show "Assign to me" on issue
label_issue_auto_assign: "If \"Assigned to\" is not assigned to a user and the new issue status is x then the issue is auto assigned to the first group with users of the pre-defined role."
label_issue_autowatch_involved: Add involved users as watcher automatically
label_issue_change_status_in_sidebar: Issue status on sidebar
label_issue_change_status: Change status
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ ko:
error_query_statement_invalid: "쿼리를 실행하는 동안 오류가 발생하여 기록되었습니다. 이 오류를 Redmine 관리자에게보고하십시오."
errors_no_or_invalid_arguments: "인수가 없거나 유효하지 않습니다"
field_always_expose: "항상 대시보드 이름 표시"
field_autowatch_involved_issue: "오토 워치 관련 문제"
field_color: 색깔
field_enable_sidebar: 사이드바 표시
field_hide: 숨는 장소
Expand Down Expand Up @@ -96,7 +95,6 @@ ko:
label_invalid_feed_data: "Invalid feed data or URL"
label_issue_assign_to_me: Show "Assign to me" on issue
label_issue_auto_assign: "If \"Assigned to\" is not assigned to a user and the new issue status is x then the issue is auto assigned to the first group with users of the pre-defined role."
label_issue_autowatch_involved: 관련 사용자를 감시자로 자동 추가
label_issue_change_status_in_sidebar: 사이드 바의 발행 상태
label_issue_change_status: 상태 변경
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pl:
error_query_statement_invalid: "Wystąpił błąd podczas wykonywania zapytania i został zarejestrowany. Proszę zgłosić ten błąd administratorowi Redmine."
errors_no_or_invalid_arguments: "Brak lub nieważne argumenty"
field_always_expose: "Zawsze pokazuj nazwę pulpitu"
field_autowatch_involved_issue: Autowatch involved issues
field_color: Kolor
field_enable_sidebar: Enable sidebar
field_hide: "Ukryć się"
Expand Down Expand Up @@ -96,7 +95,6 @@ pl:
label_invalid_feed_data: "Invalid feed data or URL"
label_issue_assign_to_me: Show "Assign to me" on issue
label_issue_auto_assign: "If \"Assigned to\" is not assigned to a user and the new issue status is x then the issue is auto assigned to the first group with users of the pre-defined role."
label_issue_autowatch_involved: "Dodawanie zaangażowanych użytkowników jako obserwatorów automatycznie"
label_issue_change_status_in_sidebar: "Status Issue na pasku bocznym"
label_issue_change_status: "Zmiana statusu"
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pt-BR:
error_query_statement_invalid: "Ocorreu um erro durante a execução da consulta e foi registrado. Favor reportar este erro ao seu administrador Redmine."
errors_no_or_invalid_arguments: "Nenhum argumento ou argumentos inválidos"
field_always_expose: "Mostrar sempre o nome do painel de bordo"
field_autowatch_involved_issue: "Tarefa envolvida no Autowatch"
field_color: "Cor"
field_enable_sidebar: "Habilitar barra lateral"
field_hide: "Esconder"
Expand Down Expand Up @@ -96,7 +95,6 @@ pt-BR:
label_invalid_feed_data: "Dados de alimentação inválidos ou URL"
label_issue_assign_to_me: "Mostrar \"Designar para mim\" em questão"
label_issue_auto_assign: "Se \"Atribuído a\" não é atribuído a um usuário e o novo status de emissão é x então a emissão é automaticamente atribuída ao primeiro grupo com usuários da função pré-definida."
label_issue_autowatch_involved: "Adicionar automaticamente os usuários envolvidos como observadores"
label_issue_change_status_in_sidebar: "Status da tarefa na barra lateral"
label_issue_change_status: "Mudança de status"
label_issue_current_user_status: "O status atual de tarifa x só é permitido se \"Assignee\" for o usuário atual."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ ru:
error_query_statement_invalid: "Во время выполнения запроса возникла ошибка, которая была зарегистрирована в журнале. Пожалуйста, сообщите об этой ошибке своему администратору Redmine."
errors_no_or_invalid_arguments: "Нет или недействительные аргументы"
field_always_expose: "Всегда показать название приборной панели"
field_autowatch_involved_issue: "Автонаблюдение включало в себя задачу"
field_color: Color
field_enable_sidebar: Enable sidebar
field_hide: "Спрятать"
Expand Down Expand Up @@ -96,7 +95,6 @@ ru:
label_invalid_feed_data: "Недействительные данные корма или URL-адрес"
label_issue_assign_to_me: Show "Assign to me" on issue
label_issue_auto_assign: "If \"Assigned to\" is not assigned to a user and the new issue status is x then the issue is auto assigned to the first group with users of the pre-defined role."
label_issue_autowatch_involved: "Автоматическое добавление привлеченных пользователей в качестве наблюдателя"
label_issue_change_status_in_sidebar: Issue status on sidebar
label_issue_change_status: "Изменить статус"
label_issue_current_user_status: "Current issue status x is only allowed if \"Assignee\" is the current user."
Expand Down
2 changes: 0 additions & 2 deletions config/locales/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
error_query_statement_invalid: An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator.
errors_no_or_invalid_arguments: "參數無效或不存在。"
field_always_expose: "始终显示仪表盘名称"
field_autowatch_involved_issue: "自動監看參與的議題"
field_color: 顏色
field_enable_sidebar: Enable sidebar
field_hide: Hide
Expand Down Expand Up @@ -96,7 +95,6 @@
label_invalid_feed_data: "Invalid feed data or URL"
label_issue_assign_to_me: Show "Assign to me" on issue
label_issue_auto_assign: "若建立新議題的 \"被分派者\" 未設定,且狀態為 X 時,將被自動分派給指定角色。"
label_issue_autowatch_involved: "自動設定參與者為監看者"
label_issue_change_status_in_sidebar: Issue status on sidebar
label_issue_change_status: Change status
label_issue_current_user_status: " \"被分派者\"為目前用戶時,議題狀態只能被設定為 X 。"
Expand Down
2 changes: 0 additions & 2 deletions config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ zh:
error_query_statement_invalid: 执行查询时出错且已被记录。请向你的 Redmine 管理员报告此错误。
errors_no_or_invalid_arguments: 参数无效或不存在。
field_always_expose: 始终显示仪表盘名称
field_autowatch_involved_issue: 自动关注参与的问题
field_color: 颜色
field_enable_sidebar: 启用侧边栏
field_hide: 隐藏
Expand Down Expand Up @@ -96,7 +95,6 @@ zh:
label_invalid_feed_data: "无效的 feed 数据或 URL"
label_issue_assign_to_me: 在问题页显示“指派给我”
label_issue_auto_assign: "\"指派给\" 的值未设置为具体用户,且新建问题的状态为 X, 那么问题将自动指派给预定义角色用户的对应组。"
label_issue_autowatch_involved: 自动添加涉及到的用户为关注者
label_issue_change_status_in_sidebar: 在侧边栏显示更新问题状态
label_issue_change_status: 更新问题状态
label_issue_current_user_status: "当前问题状态 X 仅在 \"指派给\" 的值设置为当前用户时生效。"
Expand Down
1 change: 0 additions & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ issue_assign_to_x: ''
issue_auto_assign_role: ''
issue_auto_assign_status: ''
issue_auto_assign: 0
issue_autowatch_involved: 0
issue_change_status_in_sidebar: 0
issue_current_user_status: 0
issue_freezed_with_close: 0
Expand Down
7 changes: 7 additions & 0 deletions db/migrate/007_remove_autowatch_involved_issue_from_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class RemoveAutowatchInvolvedIssueFromUser < ActiveRecord::Migration[5.2]
def change
remove_column :user_preferences, :autowatch_involved_issue, :boolean, default: false, null: false
end
end
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ Features
* anonymize referrer for external urls
* hide role in project memberbox
* change issue author
* add involved issue users as watcher automatically
* create issue on user profile
* "assign to me" link on issue
* change issue state on sidebar
Expand Down
3 changes: 1 addition & 2 deletions lib/additionals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ def setup
RenderAsync.configuration.jquery = true

loader.incompatible? %w[redmine_editauthor
redmine_changeauthor
redmine_auto_watch]
redmine_changeauthor]

loader.add_patch %w[ApplicationController
AutoCompletesController
Expand Down
2 changes: 0 additions & 2 deletions lib/additionals/hooks/view_hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class ViewHook < Redmine::Hook::ViewListener
render_on :view_issues_new_top, partial: 'new_ticket_message'
render_on :view_issues_sidebar_issues_bottom, partial: 'issues/additionals_sidebar_issues'
render_on :view_issues_sidebar_queries_bottom, partial: 'issues/additionals_sidebar_queries'
render_on :view_my_account_preferences, partial: 'users/autowatch_involved_issue'
render_on :view_users_form_preferences, partial: 'users/autowatch_involved_issue'
render_on :view_users_show_contextual, partial: 'users/additionals_contextual'
render_on :view_wiki_show_sidebar_bottom, partial: 'wiki/additionals_sidebar'

Expand Down
18 changes: 1 addition & 17 deletions lib/additionals/patches/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ module IssuePatch
validate :validate_timelog_required
validate :validate_current_user_status
before_validation :auto_assigned_to
before_save :change_status_with_assigned_to_change,
:autowatch_involved
before_save :change_status_with_assigned_to_change

safe_attributes 'author_id',
if: proc { |issue, user|
Expand Down Expand Up @@ -64,21 +63,6 @@ def add_autowatcher(user)
add_watcher user
end

def autowatch_involved
return unless Additionals.setting?(:issue_autowatch_involved) &&
User.current.pref.autowatch_involved_issue
return if AdditionalsPlugin.active_automation? && author_id == RedmineAutomation.bot_user_id

add_autowatcher User.current
add_autowatcher author if (new_record? || author_id != author_id_was) && author != User.current

if !assigned_to_id.nil? && assigned_to_id != User.current.id && (new_record? || assigned_to_id != assigned_to_id_was)
add_autowatcher assigned_to
end

true
end

def log_time_allowed?(user = User.current)
!status_was.is_closed || user.allowed_to?(:log_time_on_closed_issues, project)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/additionals/patches/user_preference_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module UserPreferencePatch

included do
include InstanceMethods
safe_attributes 'autowatch_involved_issue', 'recently_used_dashboards'
safe_attributes 'recently_used_dashboards'
end

module InstanceMethods
Expand Down
Loading

0 comments on commit e411d3f

Please sign in to comment.