Commit c896ae7b authored by Luke Bennett's avatar Luke Bennett

BE review

parent d400c94e
......@@ -2,17 +2,16 @@ class Groups::LabelsController < Groups::ApplicationController
include ToggleSubscriptionAction
before_action :label, only: [:edit, :update, :destroy]
before_action :find_labels, only: [:index]
before_action :available_labels, only: [:index]
before_action :authorize_admin_labels!, only: [:new, :create, :edit, :update, :destroy]
before_action :save_previous_label_path, only: [:edit]
respond_to :html
def index
@labels = @group.labels.page(params[:page])
respond_to do |format|
format.html do
@labels = @group.labels.page(params[:page])
end
format.json do
render json: LabelSerializer.new.represent_appearance(@available_labels)
......@@ -107,7 +106,7 @@ class Groups::LabelsController < Groups::ApplicationController
session[:previous_labels_path] = URI(request.referer || '').path
end
def find_labels
def available_labels
@available_labels ||=
LabelsFinder.new(
current_user,
......
......@@ -2,7 +2,7 @@
- status = label_subscription_status(label, @project).inquiry if current_user
- subject = local_assigns[:subject]
- use_label_priority = local_assigns.fetch(:use_label_priority, false)
- force_priority = local_assigns.fetch(:force_priority, use_label_priority ? label.priority? : false)
- force_priority = local_assigns.fetch(:force_priority, use_label_priority ? label.priority.present? : false)
- toggle_subscription_path = toggle_subscription_label_path(label, @project) if current_user
- show_label_merge_requests_link = show_label_issuables_link?(label, :merge_requests, project: @project)
- show_label_issues_link = show_label_issuables_link?(label, :issues, project: @project)
......
......@@ -23,8 +23,10 @@ feature 'Prioritize labels' do
expect(page).to have_content('Star labels to start sorting by priority')
page.within('.other-labels') do
screenshot_and_open_image
all('.js-toggle-priority')[1].click
wait_for_requests
screenshot_and_open_image
expect(page).not_to have_content('feature')
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment