Commit 6aead966 authored by Florie Guibert's avatar Florie Guibert

Clean up board code

Review feedback
parent 3d34cea2
...@@ -446,7 +446,6 @@ export default { ...@@ -446,7 +446,6 @@ export default {
class="no-drag" class="no-drag"
:title="$options.i18n.listSettings" :title="$options.i18n.listSettings"
icon="settings" icon="settings"
data-testid="board-settings-button"
@click="openSidebarSettings" @click="openSidebarSettings"
/> />
<gl-tooltip :target="() => $refs.settingsBtn">{{ $options.i18n.listSettings }}</gl-tooltip> <gl-tooltip :target="() => $refs.settingsBtn">{{ $options.i18n.listSettings }}</gl-tooltip>
......
...@@ -38,7 +38,6 @@ export default { ...@@ -38,7 +38,6 @@ export default {
v-gl-tooltip v-gl-tooltip
category="tertiary" category="tertiary"
:icon="isFullscreen ? 'minimize' : 'maximize'" :icon="isFullscreen ? 'minimize' : 'maximize'"
data-testid="focus-mode-btn"
data-qa-selector="focus_mode_button" data-qa-selector="focus_mode_button"
:title="$options.i18n.toggleFocusMode" :title="$options.i18n.toggleFocusMode"
:aria-label="$options.i18n.toggleFocusMode" :aria-label="$options.i18n.toggleFocusMode"
......
...@@ -43,8 +43,6 @@ class Groups::BoardsController < Groups::ApplicationController ...@@ -43,8 +43,6 @@ class Groups::BoardsController < Groups::ApplicationController
def assign_endpoint_vars def assign_endpoint_vars
@boards_endpoint = group_boards_path(group) @boards_endpoint = group_boards_path(group)
@namespace_path = group.to_param
@labels_endpoint = group_labels_path(group)
end end
def authorize_read_board! def authorize_read_board!
......
...@@ -44,8 +44,6 @@ class Projects::BoardsController < Projects::ApplicationController ...@@ -44,8 +44,6 @@ class Projects::BoardsController < Projects::ApplicationController
def assign_endpoint_vars def assign_endpoint_vars
@boards_endpoint = project_boards_path(project) @boards_endpoint = project_boards_path(project)
@bulk_issues_path = bulk_update_project_issues_path(project) @bulk_issues_path = bulk_update_project_issues_path(project)
@namespace_path = project.namespace.full_path
@labels_endpoint = project_labels_path(project)
end end
def authorize_read_board! def authorize_read_board!
......
...@@ -127,20 +127,6 @@ module BoardsHelper ...@@ -127,20 +127,6 @@ module BoardsHelper
can?(current_user, :admin_issue, current_board_parent) can?(current_user, :admin_issue, current_board_parent)
end end
def board_list_data
include_descendant_groups = @group&.present?
{
toggle: "dropdown",
list_labels_path: labels_filter_path_with_defaults(only_group_labels: true, include_ancestor_groups: true),
labels: labels_filter_path_with_defaults(only_group_labels: true, include_descendant_groups: include_descendant_groups),
labels_endpoint: @labels_endpoint,
namespace_path: @namespace_path,
project_path: @project&.path,
group_path: @group&.path
}
end
def serializer def serializer
CurrentBoardSerializer.new CurrentBoardSerializer.new
end end
......
...@@ -63,8 +63,6 @@ class Groups::EpicBoardsController < Groups::ApplicationController ...@@ -63,8 +63,6 @@ class Groups::EpicBoardsController < Groups::ApplicationController
def assign_endpoint_vars def assign_endpoint_vars
@boards_endpoint = group_epic_boards_path(group) @boards_endpoint = group_epic_boards_path(group)
@namespace_path = group.to_param
@labels_endpoint = group_labels_path(group)
end end
def authorize_read_board! def authorize_read_board!
......
...@@ -4,12 +4,6 @@ module EE ...@@ -4,12 +4,6 @@ module EE
module BoardsHelper module BoardsHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
override :board_list_data
def board_list_data
super.merge(list_milestone_path: board_milestones_path(board, :json),
list_assignees_path: board_users_path(board, :json))
end
# rubocop:disable Metrics/AbcSize # rubocop:disable Metrics/AbcSize
override :board_data override :board_data
def board_data def board_data
...@@ -27,7 +21,6 @@ module EE ...@@ -27,7 +21,6 @@ module EE
labels: board.labels.to_json(only: [:id, :title, :color, :text_color] ), labels: board.labels.to_json(only: [:id, :title, :color, :text_color] ),
board_weight: board.weight, board_weight: board.weight,
show_promotion: show_feature_promotion, show_promotion: show_feature_promotion,
disabled: board.disabled_for?(current_user).to_s,
emails_disabled: current_board_parent.emails_disabled?.to_s, emails_disabled: current_board_parent.emails_disabled?.to_s,
weights: ::Issue.weight_options weights: ::Issue.weight_options
} }
......
...@@ -207,7 +207,7 @@ RSpec.describe 'Project issue boards', :js do ...@@ -207,7 +207,7 @@ RSpec.describe 'Project issue boards', :js do
end end
it "sets max issue count to zero" do it "sets max issue count to zero" do
page.find('[data-testid="remove-limit"]').click click_button _('Remove limit')
wait_for_requests wait_for_requests
......
...@@ -20,16 +20,14 @@ RSpec.describe 'Group Boards', :js do ...@@ -20,16 +20,14 @@ RSpec.describe 'Group Boards', :js do
wait_for_requests wait_for_requests
click_button _('Delete board') click_button s_('IssueBoards|Delete board')
find(:css, '.board-config-modal .js-modal-action-primary').click find(:css, '.board-config-modal .js-modal-action-primary').click
click_boards_dropdown click_boards_dropdown
page.within('[data-testid="boards-selector"]') do
expect(page).not_to have_content(board_dev.name) expect(page).not_to have_content(board_dev.name)
expect(page).to have_content(board_ux.name) expect(page).to have_content(board_ux.name)
end end
end
def click_boards_dropdown def click_boards_dropdown
find('[data-testid="boards-dropdown"]').click find('[data-testid="boards-dropdown"]').click
......
...@@ -27,11 +27,9 @@ RSpec.describe 'Multiple Issue Boards', :js do ...@@ -27,11 +27,9 @@ RSpec.describe 'Multiple Issue Boards', :js do
click_button board.name click_button board.name
page.within('[data-testid="boards-selector"] .dropdown-menu') do
expect(page).not_to have_content('Create new board') expect(page).not_to have_content('Create new board')
expect(page).not_to have_content('Delete board') expect(page).not_to have_content('Delete board')
end end
end
it 'does not show license warning when there is one board created' do it 'does not show license warning when there is one board created' do
visit boards_path visit boards_path
......
...@@ -572,13 +572,11 @@ RSpec.describe 'Scoped issue boards', :js do ...@@ -572,13 +572,11 @@ RSpec.describe 'Scoped issue boards', :js do
it "doesn't show the input when creating a board" do it "doesn't show the input when creating a board" do
click_on_create_new_board click_on_create_new_board
page.within '[data-testid="board-form-wrapper"]' do
# To make sure the form is shown # To make sure the form is shown
expect(page).to have_field('board-new-name') expect(page).to have_field('board-new-name')
expect(page).not_to have_button('Expand') expect(page).not_to have_button('Expand')
end end
end
it "doesn't show the button to edit scope" do it "doesn't show the button to edit scope" do
expect(page).not_to have_button('View Scope') expect(page).not_to have_button('View Scope')
......
...@@ -377,7 +377,7 @@ RSpec.describe 'Issue Boards', :js do ...@@ -377,7 +377,7 @@ RSpec.describe 'Issue Boards', :js do
end end
context 'when opening sidebars' do context 'when opening sidebars' do
let(:settings_button) { find('[data-testid="board-settings-button"]') } let(:settings_button) { find_button _('List settings') }
it 'closes card sidebar when opening settings sidebar' do it 'closes card sidebar when opening settings sidebar' do
click_card(card1) click_card(card1)
......
...@@ -8,17 +8,6 @@ RSpec.describe BoardsHelper do ...@@ -8,17 +8,6 @@ RSpec.describe BoardsHelper do
let_it_be_with_refind(:project) { create(:project) } let_it_be_with_refind(:project) { create(:project) }
let_it_be(:project_board) { create(:board, project: project) } let_it_be(:project_board) { create(:board, project: project) }
describe '#board_list_data' do
let(:results) { helper.board_list_data }
it 'contains an endpoint to get users list' do
assign(:board, project_board)
assign(:project, project)
expect(results).to include(list_assignees_path: "/-/boards/#{project_board.id}/users.json")
end
end
describe '#current_board_json' do describe '#current_board_json' do
let(:board_json) { helper.current_board_json } let(:board_json) { helper.current_board_json }
let(:label1) { create(:label, name: "feijoa") } let(:label1) { create(:label, name: "feijoa") }
......
...@@ -11936,9 +11936,6 @@ msgstr "" ...@@ -11936,9 +11936,6 @@ msgstr ""
msgid "Delete badge" msgid "Delete badge"
msgstr "" msgstr ""
msgid "Delete board"
msgstr ""
msgid "Delete column" msgid "Delete column"
msgstr "" msgstr ""
......
...@@ -12,6 +12,6 @@ RSpec.describe 'Issue Boards focus mode', :js do ...@@ -12,6 +12,6 @@ RSpec.describe 'Issue Boards focus mode', :js do
end end
it 'shows focus mode button to anonymous users' do it 'shows focus mode button to anonymous users' do
expect(page).to have_selector('[data-testid="focus-mode-btn"]') expect(page).to have_button _('Toggle focus mode')
end 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