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

Clean up board code

Review feedback
parent 3d34cea2
......@@ -446,7 +446,6 @@ export default {
class="no-drag"
:title="$options.i18n.listSettings"
icon="settings"
data-testid="board-settings-button"
@click="openSidebarSettings"
/>
<gl-tooltip :target="() => $refs.settingsBtn">{{ $options.i18n.listSettings }}</gl-tooltip>
......
......@@ -38,7 +38,6 @@ export default {
v-gl-tooltip
category="tertiary"
:icon="isFullscreen ? 'minimize' : 'maximize'"
data-testid="focus-mode-btn"
data-qa-selector="focus_mode_button"
:title="$options.i18n.toggleFocusMode"
:aria-label="$options.i18n.toggleFocusMode"
......
......@@ -43,8 +43,6 @@ class Groups::BoardsController < Groups::ApplicationController
def assign_endpoint_vars
@boards_endpoint = group_boards_path(group)
@namespace_path = group.to_param
@labels_endpoint = group_labels_path(group)
end
def authorize_read_board!
......
......@@ -44,8 +44,6 @@ class Projects::BoardsController < Projects::ApplicationController
def assign_endpoint_vars
@boards_endpoint = project_boards_path(project)
@bulk_issues_path = bulk_update_project_issues_path(project)
@namespace_path = project.namespace.full_path
@labels_endpoint = project_labels_path(project)
end
def authorize_read_board!
......
......@@ -127,20 +127,6 @@ module BoardsHelper
can?(current_user, :admin_issue, current_board_parent)
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
CurrentBoardSerializer.new
end
......
......@@ -63,8 +63,6 @@ class Groups::EpicBoardsController < Groups::ApplicationController
def assign_endpoint_vars
@boards_endpoint = group_epic_boards_path(group)
@namespace_path = group.to_param
@labels_endpoint = group_labels_path(group)
end
def authorize_read_board!
......
......@@ -4,12 +4,6 @@ module EE
module BoardsHelper
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
override :board_data
def board_data
......@@ -27,7 +21,6 @@ module EE
labels: board.labels.to_json(only: [:id, :title, :color, :text_color] ),
board_weight: board.weight,
show_promotion: show_feature_promotion,
disabled: board.disabled_for?(current_user).to_s,
emails_disabled: current_board_parent.emails_disabled?.to_s,
weights: ::Issue.weight_options
}
......
......@@ -207,7 +207,7 @@ RSpec.describe 'Project issue boards', :js do
end
it "sets max issue count to zero" do
page.find('[data-testid="remove-limit"]').click
click_button _('Remove limit')
wait_for_requests
......
......@@ -20,15 +20,13 @@ RSpec.describe 'Group Boards', :js do
wait_for_requests
click_button _('Delete board')
click_button s_('IssueBoards|Delete board')
find(:css, '.board-config-modal .js-modal-action-primary').click
click_boards_dropdown
page.within('[data-testid="boards-selector"]') do
expect(page).not_to have_content(board_dev.name)
expect(page).to have_content(board_ux.name)
end
expect(page).not_to have_content(board_dev.name)
expect(page).to have_content(board_ux.name)
end
def click_boards_dropdown
......
......@@ -27,10 +27,8 @@ RSpec.describe 'Multiple Issue Boards', :js do
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('Delete board')
end
expect(page).not_to have_content('Create new board')
expect(page).not_to have_content('Delete board')
end
it 'does not show license warning when there is one board created' do
......
......@@ -572,12 +572,10 @@ RSpec.describe 'Scoped issue boards', :js do
it "doesn't show the input when creating a board" do
click_on_create_new_board
page.within '[data-testid="board-form-wrapper"]' do
# To make sure the form is shown
expect(page).to have_field('board-new-name')
# To make sure the form is shown
expect(page).to have_field('board-new-name')
expect(page).not_to have_button('Expand')
end
expect(page).not_to have_button('Expand')
end
it "doesn't show the button to edit scope" do
......
......@@ -377,7 +377,7 @@ RSpec.describe 'Issue Boards', :js do
end
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
click_card(card1)
......
......@@ -8,17 +8,6 @@ RSpec.describe BoardsHelper do
let_it_be_with_refind(:project) { create(: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
let(:board_json) { helper.current_board_json }
let(:label1) { create(:label, name: "feijoa") }
......
......@@ -11936,9 +11936,6 @@ msgstr ""
msgid "Delete badge"
msgstr ""
msgid "Delete board"
msgstr ""
msgid "Delete column"
msgstr ""
......
......@@ -12,6 +12,6 @@ RSpec.describe 'Issue Boards focus mode', :js do
end
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
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