Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ad5a8b2d
Commit
ad5a8b2d
authored
Jun 09, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Boards - Update Open column when adding list
Review feedback
parent
a08485ee
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
50 additions
and
9 deletions
+50
-9
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+3
-0
app/assets/javascripts/boards/stores/mutation_types.js
app/assets/javascripts/boards/stores/mutation_types.js
+1
-0
app/assets/javascripts/boards/stores/mutations.js
app/assets/javascripts/boards/stores/mutations.js
+6
-3
app/assets/javascripts/boards/stores/state.js
app/assets/javascripts/boards/stores/state.js
+1
-0
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+3
-0
ee/app/assets/javascripts/boards/stores/mutations.js
ee/app/assets/javascripts/boards/stores/mutations.js
+1
-0
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+5
-1
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+8
-0
spec/frontend/boards/stores/mutations_spec.js
spec/frontend/boards/stores/mutations_spec.js
+22
-5
No files found.
app/assets/javascripts/boards/stores/actions.js
View file @
ad5a8b2d
...
...
@@ -298,6 +298,9 @@ export default {
},
fetchItemsForList
:
({
state
,
commit
},
{
listId
,
fetchNext
=
false
})
=>
{
if
(
!
fetchNext
)
{
commit
(
types
.
RESET_ITEMS_FOR_LIST
,
listId
);
}
commit
(
types
.
REQUEST_ITEMS_FOR_LIST
,
{
listId
,
fetchNext
});
const
{
fullPath
,
fullBoardId
,
boardType
,
filterParams
}
=
state
;
...
...
app/assets/javascripts/boards/stores/mutation_types.js
View file @
ad5a8b2d
...
...
@@ -15,6 +15,7 @@ export const UPDATE_LIST_FAILURE = 'UPDATE_LIST_FAILURE';
export
const
TOGGLE_LIST_COLLAPSED
=
'
TOGGLE_LIST_COLLAPSED
'
;
export
const
REMOVE_LIST
=
'
REMOVE_LIST
'
;
export
const
REMOVE_LIST_FAILURE
=
'
REMOVE_LIST_FAILURE
'
;
export
const
RESET_ITEMS_FOR_LIST
=
'
RESET_ITEMS_FOR_LIST
'
;
export
const
REQUEST_ITEMS_FOR_LIST
=
'
REQUEST_ITEMS_FOR_LIST
'
;
export
const
RECEIVE_ITEMS_FOR_LIST_FAILURE
=
'
RECEIVE_ITEMS_FOR_LIST_FAILURE
'
;
export
const
RECEIVE_ITEMS_FOR_LIST_SUCCESS
=
'
RECEIVE_ITEMS_FOR_LIST_SUCCESS
'
;
...
...
app/assets/javascripts/boards/stores/mutations.js
View file @
ad5a8b2d
...
...
@@ -117,10 +117,12 @@ export default {
state
.
boardLists
=
listsBackup
;
},
[
mutationTypes
.
RE
QUEST_ITEMS_FOR_LIST
]:
(
state
,
{
listId
,
fetchNext
}
)
=>
{
if
(
!
fetchNext
&&
!
state
.
isShowingEpicsSwimlanes
)
{
[
mutationTypes
.
RE
SET_ITEMS_FOR_LIST
]:
(
state
,
listId
)
=>
{
Vue
.
set
(
state
,
'
backupItemsList
'
,
state
.
boardItemsByListId
[
listId
]);
Vue
.
set
(
state
.
boardItemsByListId
,
listId
,
[]);
}
},
[
mutationTypes
.
REQUEST_ITEMS_FOR_LIST
]:
(
state
,
{
listId
,
fetchNext
})
=>
{
Vue
.
set
(
state
.
listsFlags
,
listId
,
{
[
fetchNext
?
'
isLoadingMore
'
:
'
isLoading
'
]:
true
});
},
...
...
@@ -141,6 +143,7 @@ export default {
'
Boards|An error occurred while fetching the board issues. Please reload the page.
'
,
);
Vue
.
set
(
state
.
listsFlags
,
listId
,
{
isLoading
:
false
,
isLoadingMore
:
false
});
Vue
.
set
(
state
.
boardItemsByListId
,
listId
,
state
.
backupItemsList
);
},
[
mutationTypes
.
RESET_ISSUES
]:
(
state
)
=>
{
...
...
app/assets/javascripts/boards/stores/state.js
View file @
ad5a8b2d
...
...
@@ -11,6 +11,7 @@ export default () => ({
boardLists
:
{},
listsFlags
:
{},
boardItemsByListId
:
{},
backupItemsList
:
[],
isSettingAssignees
:
false
,
pageInfoByListId
:
{},
boardItems
:
{},
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
ad5a8b2d
...
...
@@ -245,6 +245,9 @@ export default {
{
state
,
commit
,
getters
},
{
listId
,
fetchNext
=
false
,
noEpicIssues
=
false
,
forSwimlanes
=
false
},
)
=>
{
if
(
!
fetchNext
&&
!
state
.
isShowingEpicsSwimlanes
)
{
commit
(
types
.
RESET_ITEMS_FOR_LIST
,
listId
);
}
commit
(
types
.
REQUEST_ITEMS_FOR_LIST
,
{
listId
,
fetchNext
});
const
{
epicId
,
...
filterParams
}
=
state
.
filterParams
;
...
...
ee/app/assets/javascripts/boards/stores/mutations.js
View file @
ad5a8b2d
...
...
@@ -46,6 +46,7 @@ export default {
?
ErrorMessages
.
fetchEpicsError
:
ErrorMessages
.
fetchIssueError
;
Vue
.
set
(
state
.
listsFlags
,
listId
,
{
isLoading
:
false
,
isLoadingMore
:
false
});
Vue
.
set
(
state
.
boardItemsByListId
,
listId
,
state
.
backupItemsList
);
},
[
mutationTypes
.
TOGGLE_EPICS_SWIMLANES
]:
(
state
)
=>
{
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
ad5a8b2d
...
...
@@ -288,7 +288,7 @@ describe('fetchEpicsSwimlanes', () => {
describe
(
'
fetchItemsForList
'
,
()
=>
{
const
listId
=
mockLists
[
0
].
id
;
cons
t
state
=
{
le
t
state
=
{
fullPath
:
'
gitlab-org
'
,
boardId
:
'
1
'
,
filterParams
:
{},
...
...
@@ -329,6 +329,10 @@ describe('fetchItemsForList', () => {
};
it
(
'
add epicWildcardId with ANY as value when forSwimlanes is true
'
,
()
=>
{
state
=
{
...
state
,
isShowingEpicsSwimlanes
:
true
,
};
jest
.
spyOn
(
gqlClient
,
'
query
'
).
mockResolvedValue
(
queryResponse
);
testAction
(
...
...
spec/frontend/boards/stores/actions_spec.js
View file @
ad5a8b2d
...
...
@@ -676,6 +676,10 @@ describe('fetchItemsForList', () => {
{
listId
},
state
,
[
{
type
:
types
.
RESET_ITEMS_FOR_LIST
,
payload
:
listId
,
},
{
type
:
types
.
REQUEST_ITEMS_FOR_LIST
,
payload
:
{
listId
,
fetchNext
:
false
},
...
...
@@ -698,6 +702,10 @@ describe('fetchItemsForList', () => {
{
listId
},
state
,
[
{
type
:
types
.
RESET_ITEMS_FOR_LIST
,
payload
:
listId
,
},
{
type
:
types
.
REQUEST_ITEMS_FOR_LIST
,
payload
:
{
listId
,
fetchNext
:
false
},
...
...
spec/frontend/boards/stores/mutations_spec.js
View file @
ad5a8b2d
...
...
@@ -273,6 +273,24 @@ describe('Board Store Mutations', () => {
});
});
describe
(
'
RESET_ITEMS_FOR_LIST
'
,
()
=>
{
it
(
'
should remove issues from boardItemsByListId state
'
,
()
=>
{
const
listId
=
'
gid://gitlab/List/1
'
;
const
boardItemsByListId
=
{
[
listId
]:
[
mockIssue
.
id
],
};
state
=
{
...
state
,
boardItemsByListId
,
};
mutations
[
types
.
RESET_ITEMS_FOR_LIST
](
state
,
listId
);
expect
(
state
.
boardItemsByListId
[
listId
]).
toEqual
([]);
});
});
describe
(
'
REQUEST_ITEMS_FOR_LIST
'
,
()
=>
{
const
listId
=
'
gid://gitlab/List/1
'
;
const
boardItemsByListId
=
{
...
...
@@ -280,12 +298,12 @@ describe('Board Store Mutations', () => {
};
it
.
each
`
fetchNext | isLoading | isLoadingMore
| listItems
${
true
}
|
${
undefined
}
|
${
true
}
|
${
boardItemsByListId
[
listId
]}
${
false
}
|
${
true
}
|
${
undefined
}
|
${[]}
fetchNext | isLoading | isLoadingMore
${
true
}
|
${
undefined
}
|
${
true
}
${
false
}
|
${
true
}
|
${
undefined
}
`
(
'
sets isLoading to $isLoading and isLoadingMore to $isLoadingMore when fetchNext is $fetchNext
'
,
({
fetchNext
,
isLoading
,
isLoadingMore
,
listItems
})
=>
{
({
fetchNext
,
isLoading
,
isLoadingMore
})
=>
{
state
=
{
...
state
,
boardItemsByListId
,
...
...
@@ -298,7 +316,6 @@ describe('Board Store Mutations', () => {
expect
(
state
.
listsFlags
[
listId
].
isLoading
).
toBe
(
isLoading
);
expect
(
state
.
listsFlags
[
listId
].
isLoadingMore
).
toBe
(
isLoadingMore
);
expect
(
state
.
boardItemsByListId
[
listId
]).
toEqual
(
listItems
);
},
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment