Commit 8383b1b1 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix issue rebalance banner

Fixes the rebalance alert being shown twice in issue boards. This also
only shows the banner in issue lists if the sort order is set to Manual

Changelog: fixed
parent 2d65f45b
= render 'shared/alerts/positioning_disabled'
= render "shared/boards/show", board: @board, group: true = render "shared/boards/show", board: @board, group: true
- is_project_overview = local_assigns.fetch(:is_project_overview, false) - is_project_overview = local_assigns.fetch(:is_project_overview, false)
= render 'shared/alerts/positioning_disabled' = render 'shared/alerts/positioning_disabled' if @sort == 'relative_position'
- if Feature.enabled?(:vue_issuables_list, @project) && !is_project_overview - if Feature.enabled?(:vue_issuables_list, @project) && !is_project_overview
- data_endpoint = local_assigns.fetch(:data_endpoint, expose_path(api_v4_projects_issues_path(id: @project.id))) - data_endpoint = local_assigns.fetch(:data_endpoint, expose_path(api_v4_projects_issues_path(id: @project.id)))
......
= render 'shared/alerts/positioning_disabled' = render 'shared/alerts/positioning_disabled' if @sort == 'relative_position'
- if @issues.to_a.any? - if @issues.to_a.any?
%ul.content-list.issues-list.issuable-list{ class: issue_manual_ordering_class, data: { group_full_path: @group&.full_path } } %ul.content-list.issues-list.issuable-list{ class: issue_manual_ordering_class, data: { group_full_path: @group&.full_path } }
......
- if issue_repositioning_disabled? - if issue_repositioning_disabled?
= render 'shared/alert_info', body: _('Issues manual ordering is temporarily disabled for technical reasons.') = render 'shared/alert_info', body: _('Issues are being rebalanced at the moment, so manual reordering is disabled.')
...@@ -19244,6 +19244,9 @@ msgstr "" ...@@ -19244,6 +19244,9 @@ msgstr ""
msgid "Issues and merge requests" msgid "Issues and merge requests"
msgstr "" msgstr ""
msgid "Issues are being rebalanced at the moment, so manual reordering is disabled."
msgstr ""
msgid "Issues assigned to me" msgid "Issues assigned to me"
msgstr "" msgstr ""
...@@ -19253,9 +19256,6 @@ msgstr "" ...@@ -19253,9 +19256,6 @@ msgstr ""
msgid "Issues closed" msgid "Issues closed"
msgstr "" msgstr ""
msgid "Issues manual ordering is temporarily disabled for technical reasons."
msgstr ""
msgid "Issues must match this scope to appear in this list." msgid "Issues must match this scope to appear in this list."
msgstr "" msgstr ""
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Issue rebalancing' do
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
let_it_be(:user) { create(:user) }
let(:alert_message_regex) { /Issues are being rebalanced at the moment/ }
before_all do
create(:issue, project: project)
group.add_developer(user)
end
context 'when issue rebalancing is in progress' do
before do
sign_in(user)
stub_feature_flags(block_issue_repositioning: true)
end
it 'shows an alert in project boards' do
board = create(:board, project: project)
visit project_board_path(project, board)
expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1)
end
it 'shows an alert in group boards' do
board = create(:board, group: group)
visit group_board_path(group, board)
expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1)
end
it 'shows an alert in project issues list with manual sort' do
visit project_issues_path(project, sort: 'relative_position')
expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1)
end
it 'shows an alert in group issues list with manual sort' do
visit issues_group_path(group, sort: 'relative_position')
expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1)
end
it 'does not show an alert in project issues list with other sorts' do
visit project_issues_path(project, sort: 'created_date')
expect(page).not_to have_selector('.gl-alert-info', text: alert_message_regex)
end
it 'does not show an alert in group issues list with other sorts' do
visit issues_group_path(group, sort: 'created_date')
expect(page).not_to have_selector('.gl-alert-info', text: alert_message_regex)
end
end
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