Commit 1a19552e authored by Florie Guibert's avatar Florie Guibert

Boards - Remove List model from GraphQL boards

Review feedback
parent 829d6edf
......@@ -13,11 +13,10 @@ export function updateListPosition(listObj) {
if (listType === ListType.closed) {
position = Infinity;
} else if (listType === ListType.backlog) {
position = -1;
position = -Infinity;
}
const list = { ...listObj, position };
return list;
return { ...listObj, position };
}
export function formatBoardLists(lists) {
......
......@@ -126,7 +126,7 @@ export default {
return (
label.id &&
!(
(this.list.type === ListType.label || this.list.listType === ListType.label) &&
(this.list.type || this.list.listType) === ListType.label &&
this.list.title === label.title
)
);
......
......@@ -54,10 +54,7 @@ export default {
this.loading = true;
const additionalAttrs = {};
if (
(this.list.type && this.list.type !== ListType.backlog) ||
(this.list.listType && this.list.listType !== ListType.backlog)
) {
if ((this.list.type || this.list.listType) !== ListType.backlog) {
additionalAttrs.min_access_level = featureAccessLevel.EVERYONE;
}
......
......@@ -73,6 +73,7 @@ describe('Board List Header Component', () => {
const isExpanded = () => !isCollapsed;
const findAddIssueButton = () => wrapper.find({ ref: 'newIssueBtn' });
const findTitle = () => wrapper.find('.board-title');
const findCaret = () => wrapper.find('.board-title-caret');
describe('Add issue button', () => {
......@@ -163,4 +164,24 @@ describe('Board List Header Component', () => {
expect(localStorage.getItem(`${wrapper.vm.uniqueKey}.expanded`)).toBe(String(isExpanded()));
});
});
describe('user can drag', () => {
const cannotDragList = [ListType.backlog, ListType.closed];
const canDragList = [ListType.label, ListType.milestone, ListType.assignee];
it.each(cannotDragList)(
'does not have user-can-drag-class so user cannot drag list',
listType => {
createComponent({ listType });
expect(findTitle().classes()).not.toContain('user-can-drag');
},
);
it.each(canDragList)('has user-can-drag-class so user can drag list', listType => {
createComponent({ listType });
expect(findTitle().classes()).toContain('user-can-drag');
});
});
});
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