From 7fcd469e3eed8c83e6f944c8c8be24820ea2302d Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Mon, 31 Oct 2016 17:21:13 -0200 Subject: Add subscribable_project to ToggleSubscriptionAction concern --- app/controllers/projects/labels_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/controllers/projects/labels_controller.rb') diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index 42fd09e9b7e..93cfd8a7721 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -125,6 +125,10 @@ class Projects::LabelsController < Projects::ApplicationController end alias_method :subscribable_resource, :label + def subscribable_project + @project + end + def find_labels @available_labels ||= LabelsFinder.new(current_user, project_id: @project.id).execute end -- cgit v1.2.1 From 4a29fde577a7d5d7c46ffff7c5feb79be23cdaa8 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Tue, 1 Nov 2016 15:02:58 -0200 Subject: Allow users to subscribe to group labels at project-level --- app/controllers/projects/labels_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/controllers/projects/labels_controller.rb') diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index 93cfd8a7721..a65adf13568 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -3,7 +3,7 @@ class Projects::LabelsController < Projects::ApplicationController before_action :module_enabled before_action :label, only: [:edit, :update, :destroy] - before_action :find_labels, only: [:index, :set_priorities, :remove_priority] + before_action :find_labels, only: [:index, :set_priorities, :remove_priority, :toggle_subscription] before_action :authorize_read_label! before_action :authorize_admin_labels!, only: [:new, :create, :edit, :update, :generate, :destroy, :remove_priority, @@ -123,7 +123,10 @@ class Projects::LabelsController < Projects::ApplicationController def label @label ||= @project.labels.find(params[:id]) end - alias_method :subscribable_resource, :label + + def subscribable_resource + @available_labels.find(params[:id]) + end def subscribable_project @project -- cgit v1.2.1 From b3249bc28faecd1774558ec6f8ecc32f89c416ae Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Thu, 3 Nov 2016 11:09:38 -0200 Subject: Use @project as default on ToggleSubscriptionAction concern --- app/controllers/projects/labels_controller.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'app/controllers/projects/labels_controller.rb') diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index a65adf13568..824ed7be73e 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -128,10 +128,6 @@ class Projects::LabelsController < Projects::ApplicationController @available_labels.find(params[:id]) end - def subscribable_project - @project - end - def find_labels @available_labels ||= LabelsFinder.new(current_user, project_id: @project.id).execute end -- cgit v1.2.1