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
a024a191
Commit
a024a191
authored
Jul 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
5ec69d2d
c61c3b68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
app/assets/javascripts/boards/components/board_blank_state.vue
...ssets/javascripts/boards/components/board_blank_state.vue
+7
-4
changelogs/unreleased/fe-delete-old-boardservice.yml
changelogs/unreleased/fe-delete-old-boardservice.yml
+6
-0
spec/javascripts/boards/board_blank_state_spec.js
spec/javascripts/boards/board_blank_state_spec.js
+12
-7
No files found.
app/assets/javascripts/boards/components/board_blank_state.vue
View file @
a024a191
<
script
>
import
{
__
}
from
'
~/locale
'
;
/* global ListLabel */
import
ListLabel
from
'
~/boards/models/label
'
;
import
Cookies
from
'
js-cookie
'
;
import
boardsStore
from
'
../stores/boards_store
'
;
...
...
@@ -30,13 +30,17 @@ export default {
});
// Save the labels
gl
.
boardServic
e
boardsStor
e
.
generateDefaultLists
()
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
{
data
.
forEach
(
listObj
=>
{
const
list
=
boardsStore
.
findList
(
'
title
'
,
listObj
.
title
);
if
(
!
list
)
{
return
;
}
list
.
id
=
listObj
.
id
;
list
.
label
.
id
=
listObj
.
label
.
id
;
list
.
getIssues
().
catch
(()
=>
{
...
...
@@ -69,8 +73,7 @@ export default {
<span
:style=
"
{ backgroundColor: label.color }"
class="label-color position-relative d-inline-block rounded"
>
</span>
>
</span>
{{
label
.
title
}}
</li>
</ul>
...
...
changelogs/unreleased/fe-delete-old-boardservice.yml
0 → 100644
View file @
a024a191
---
title
:
Change BoardService in favor of boardsStore on board blank state of the component
board
merge_request
:
30546
author
:
eduarmreyes
type
:
other
spec/javascripts/boards/board_blank_state_spec.js
View file @
a024a191
import
Vue
from
'
vue
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
BoardBlankState
from
'
~/boards/components/board_blank_state.vue
'
;
import
{
mockBoardService
}
from
'
./mock_data
'
;
describe
(
'
Boards blank state
'
,
()
=>
{
let
vm
;
...
...
@@ -11,9 +10,10 @@ describe('Boards blank state', () => {
const
Comp
=
Vue
.
extend
(
BoardBlankState
);
boardsStore
.
create
();
gl
.
boardService
=
mockBoardService
();
spyOn
(
gl
.
boardService
,
'
generateDefaultLists
'
).
and
.
callFake
(
spyOn
(
boardsStore
,
'
addList
'
).
and
.
stub
();
spyOn
(
boardsStore
,
'
removeList
'
).
and
.
stub
();
spyOn
(
boardsStore
,
'
generateDefaultLists
'
).
and
.
callFake
(
()
=>
new
Promise
((
resolve
,
reject
)
=>
{
if
(
fail
)
{
...
...
@@ -71,9 +71,14 @@ describe('Boards blank state', () => {
vm
.
$el
.
querySelector
(
'
.btn-success
'
).
click
();
setTimeout
(()
=>
{
expect
(
boardsStore
.
state
.
lists
.
length
).
toBe
(
2
);
expect
(
boardsStore
.
state
.
lists
[
0
].
title
).
toEqual
(
'
To Do
'
);
expect
(
boardsStore
.
state
.
lists
[
1
].
title
).
toEqual
(
'
Doing
'
);
expect
(
boardsStore
.
addList
).
toHaveBeenCalledTimes
(
2
);
expect
(
boardsStore
.
addList
).
toHaveBeenCalledWith
(
jasmine
.
objectContaining
({
title
:
'
To Do
'
}),
);
expect
(
boardsStore
.
addList
).
toHaveBeenCalledWith
(
jasmine
.
objectContaining
({
title
:
'
Doing
'
}),
);
done
();
});
...
...
@@ -86,7 +91,7 @@ describe('Boards blank state', () => {
setTimeout
(()
=>
{
expect
(
boardsStore
.
welcomeIsHidden
()).
toBeFalsy
();
expect
(
boardsStore
.
state
.
lists
.
length
).
toBe
(
1
);
expect
(
boardsStore
.
removeList
).
toHaveBeenCalledWith
(
undefined
,
'
label
'
);
done
();
});
...
...
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