Commit 57fd8151 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch...

Merge branch '296976-the-open-list-in-boards-with-swimlanes-applied-is-mislabeled-as-backlog' into 'master'

Rename Backlog list to Open for Swimlanes

See merge request gitlab-org/gitlab!51539
parents 0e126969 2be89e25
import { sortBy } from 'lodash'; import { sortBy } from 'lodash';
import { __ } from '~/locale';
import { ListType } from './constants'; import { ListType } from './constants';
import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { getIdFromGraphQLId } from '~/graphql_shared/utils';
...@@ -8,14 +9,15 @@ export function getMilestone() { ...@@ -8,14 +9,15 @@ export function getMilestone() {
export function updateListPosition(listObj) { export function updateListPosition(listObj) {
const { listType } = listObj; const { listType } = listObj;
let { position } = listObj; let { position, title } = listObj;
if (listType === ListType.closed) { if (listType === ListType.closed) {
position = Infinity; position = Infinity;
} else if (listType === ListType.backlog) { } else if (listType === ListType.backlog) {
position = -Infinity; position = -Infinity;
title = __('Open');
} }
return { ...listObj, position }; return { ...listObj, title, position };
} }
export function formatBoardLists(lists) { export function formatBoardLists(lists) {
......
...@@ -12,6 +12,7 @@ import { ...@@ -12,6 +12,7 @@ import {
fullBoardId, fullBoardId,
formatListsPageInfo, formatListsPageInfo,
formatIssue, formatIssue,
updateListPosition,
} from '../boards_util'; } from '../boards_util';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { __ } from '~/locale'; import { __ } from '~/locale';
...@@ -131,7 +132,7 @@ export default { ...@@ -131,7 +132,7 @@ export default {
}, },
addList: ({ commit }, list) => { addList: ({ commit }, list) => {
commit(types.RECEIVE_ADD_LIST_SUCCESS, list); commit(types.RECEIVE_ADD_LIST_SUCCESS, updateListPosition(list));
}, },
fetchLabels: ({ state, commit }, searchTerm) => { fetchLabels: ({ state, commit }, searchTerm) => {
......
---
title: Rename Backlog list to Open for Swimlanes
merge_request: 51539
author:
type: fixed
...@@ -8,7 +8,7 @@ RSpec.describe 'epics swimlanes', :js do ...@@ -8,7 +8,7 @@ RSpec.describe 'epics swimlanes', :js do
let_it_be(:project) { create(:project, :public, group: group) } let_it_be(:project) { create(:project, :public, group: group) }
let_it_be(:board) { create(:board, project: project) } let_it_be(:board) { create(:board, project: project) }
let_it_be(:label) { create(:label, project: project, name: 'Label 1') } let_it_be(:label) { create(:label, project: project, name: 'Label1') }
let_it_be(:list) { create(:list, board: board, label: label, position: 0) } let_it_be(:list) { create(:list, board: board, label: label, position: 0) }
let_it_be(:issue1) { create(:issue, project: project, labels: [label]) } let_it_be(:issue1) { create(:issue, project: project, labels: [label]) }
...@@ -40,6 +40,18 @@ RSpec.describe 'epics swimlanes', :js do ...@@ -40,6 +40,18 @@ RSpec.describe 'epics swimlanes', :js do
expect(page.find('span[data-testid="issues-lane-issue-count"]')).to have_content('1') expect(page.find('span[data-testid="issues-lane-issue-count"]')).to have_content('1')
end end
end end
it 'displays default lists and a label list' do
lists = %w[Open Label1 Closed]
wait_for_requests
expect(page).to have_selector('.board-header', count: 3)
page.all('.board-header').each_with_index do |list, i|
expect(list.find('.board-title')).to have_content(lists[i])
end
end
end end
before do before do
......
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