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
5b348fb0
Commit
5b348fb0
authored
Jul 20, 2021
by
Scott Stern
Committed by
Simon Knox
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error when creating or deleting a board list
Changelog: fixed
parent
4cd1fc0a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
3 deletions
+34
-3
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+5
-2
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+2
-0
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+13
-0
spec/frontend/boards/mock_data.js
spec/frontend/boards/mock_data.js
+1
-1
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+13
-0
No files found.
app/assets/javascripts/boards/stores/actions.js
View file @
5b348fb0
...
...
@@ -173,8 +173,9 @@ export default {
addList
:
({
commit
,
dispatch
,
getters
},
list
)
=>
{
commit
(
types
.
RECEIVE_ADD_LIST_SUCCESS
,
updateListPosition
(
list
));
dispatch
(
'
fetchItemsForList
'
,
{
listId
:
getters
.
getListByTitle
(
ListTypeTitles
.
backlog
).
id
,
listId
:
getters
.
getListByTitle
(
ListTypeTitles
.
backlog
)
?
.
id
,
});
},
...
...
@@ -294,7 +295,7 @@ export default {
commit
(
types
.
REMOVE_LIST_FAILURE
,
listsBackup
);
}
else
{
dispatch
(
'
fetchItemsForList
'
,
{
listId
:
getters
.
getListByTitle
(
ListTypeTitles
.
backlog
).
id
,
listId
:
getters
.
getListByTitle
(
ListTypeTitles
.
backlog
)
?
.
id
,
});
}
},
...
...
@@ -305,6 +306,8 @@ export default {
},
fetchItemsForList
:
({
state
,
commit
},
{
listId
,
fetchNext
=
false
})
=>
{
if
(
!
listId
)
return
null
;
if
(
!
fetchNext
)
{
commit
(
types
.
RESET_ITEMS_FOR_LIST
,
listId
);
}
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
5b348fb0
...
...
@@ -262,6 +262,8 @@ export default {
{
state
,
commit
,
getters
},
{
listId
,
fetchNext
=
false
,
noEpicIssues
=
false
},
)
=>
{
if
(
!
listId
)
return
null
;
if
(
!
fetchNext
&&
!
state
.
isShowingEpicsSwimlanes
)
{
commit
(
types
.
RESET_ITEMS_FOR_LIST
,
listId
);
}
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
5b348fb0
...
...
@@ -345,6 +345,19 @@ describe('fetchItemsForList', () => {
[
listId
]:
pageInfo
,
};
describe
(
'
when listId is undefined
'
,
()
=>
{
it
(
'
does not call the query
'
,
async
()
=>
{
jest
.
spyOn
(
gqlClient
,
'
query
'
).
mockResolvedValue
(
queryResponse
);
await
actions
.
fetchItemsForList
(
{
state
,
getters
:
()
=>
{},
commit
:
()
=>
{}
},
{
listId
:
undefined
},
);
expect
(
gqlClient
.
query
).
toHaveBeenCalledTimes
(
0
);
});
});
it
(
'
add epicWildcardId with NONE as value when noEpicIssues is true
'
,
()
=>
{
state
=
{
...
state
,
...
...
spec/frontend/boards/mock_data.js
View file @
5b348fb0
...
...
@@ -291,7 +291,7 @@ export const setMockEndpoints = (opts = {}) => {
export
const
mockList
=
{
id
:
'
gid://gitlab/List/1
'
,
title
:
'
Backlog
'
,
title
:
'
Open
'
,
position
:
-
Infinity
,
listType
:
'
backlog
'
,
collapsed
:
false
,
...
...
spec/frontend/boards/stores/actions_spec.js
View file @
5b348fb0
...
...
@@ -715,6 +715,19 @@ describe('fetchItemsForList', () => {
[
listId
]:
pageInfo
,
};
describe
(
'
when list id is undefined
'
,
()
=>
{
it
(
'
does not call the query
'
,
async
()
=>
{
jest
.
spyOn
(
gqlClient
,
'
query
'
).
mockResolvedValue
(
queryResponse
);
await
actions
.
fetchItemsForList
(
{
state
,
getters
:
()
=>
{},
commit
:
()
=>
{}
},
{
listId
:
undefined
},
);
expect
(
gqlClient
.
query
).
toHaveBeenCalledTimes
(
0
);
});
});
it
(
'
should commit mutations REQUEST_ITEMS_FOR_LIST and RECEIVE_ITEMS_FOR_LIST_SUCCESS on success
'
,
(
done
)
=>
{
jest
.
spyOn
(
gqlClient
,
'
query
'
).
mockResolvedValue
(
queryResponse
);
...
...
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