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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
f57b1323
Commit
f57b1323
authored
Nov 22, 2018
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failed tests and add extra test
parent
2dd84abf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
8 deletions
+26
-8
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+1
-3
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+3
-2
spec/javascripts/boards/boards_store_spec.js
spec/javascripts/boards/boards_store_spec.js
+7
-0
spec/javascripts/boards/issue_spec.js
spec/javascripts/boards/issue_spec.js
+15
-3
No files found.
app/assets/javascripts/boards/stores/boards_store.js
View file @
f57b1323
...
@@ -167,9 +167,7 @@ const boardsStore = {
...
@@ -167,9 +167,7 @@ const boardsStore = {
return
filteredList
[
0
];
return
filteredList
[
0
];
},
},
findListByLabelId
(
id
)
{
findListByLabelId
(
id
)
{
return
this
.
state
.
lists
.
find
(
list
=>
{
return
this
.
state
.
lists
.
find
(
list
=>
list
.
type
===
'
label
'
&&
list
.
label
.
id
===
id
);
return
list
.
type
===
'
label
'
&&
list
.
label
.
id
===
id
;
});
},
},
updateFiltersUrl
()
{
updateFiltersUrl
()
{
window
.
history
.
pushState
(
null
,
null
,
`?
${
this
.
filter
.
path
}
`
);
window
.
history
.
pushState
(
null
,
null
,
`?
${
this
.
filter
.
path
}
`
);
...
...
app/assets/javascripts/labels_select.js
View file @
f57b1323
...
@@ -170,7 +170,7 @@ export default class LabelsSelect {
...
@@ -170,7 +170,7 @@ export default class LabelsSelect {
axios
axios
.
get
(
labelUrl
)
.
get
(
labelUrl
)
.
then
(
res
=>
{
.
then
(
res
=>
{
let
data
=
res
.
data
;
let
{
data
}
=
res
;
if
(
$dropdown
.
hasClass
(
'
js-extra-options
'
))
{
if
(
$dropdown
.
hasClass
(
'
js-extra-options
'
))
{
var
extraData
=
[];
var
extraData
=
[];
if
(
showNo
)
{
if
(
showNo
)
{
...
@@ -256,7 +256,8 @@ export default class LabelsSelect {
...
@@ -256,7 +256,8 @@ export default class LabelsSelect {
}
}
}
}
if
(
label
.
color
)
{
if
(
label
.
color
)
{
colorEl
=
"
<span class='dropdown-label-box' style='background:
"
+
label
.
color
+
"
'></span>
"
;
colorEl
=
"
<span class='dropdown-label-box' style='background:
"
+
label
.
color
+
"
'></span>
"
;
}
else
{
}
else
{
colorEl
=
''
;
colorEl
=
''
;
}
}
...
...
spec/javascripts/boards/boards_store_spec.js
View file @
f57b1323
...
@@ -65,6 +65,13 @@ describe('Store', () => {
...
@@ -65,6 +65,13 @@ describe('Store', () => {
expect
(
list
).
toBeDefined
();
expect
(
list
).
toBeDefined
();
});
});
it
(
'
finds list by label ID
'
,
()
=>
{
boardsStore
.
addList
(
listObj
);
const
list
=
boardsStore
.
findListByLabelId
(
listObj
.
label
.
id
);
expect
(
list
.
id
).
toBe
(
listObj
.
id
);
});
it
(
'
gets issue when new list added
'
,
done
=>
{
it
(
'
gets issue when new list added
'
,
done
=>
{
boardsStore
.
addList
(
listObj
);
boardsStore
.
addList
(
listObj
);
const
list
=
boardsStore
.
findList
(
'
id
'
,
listObj
.
id
);
const
list
=
boardsStore
.
findList
(
'
id
'
,
listObj
.
id
);
...
...
spec/javascripts/boards/issue_spec.js
View file @
f57b1323
...
@@ -55,15 +55,27 @@ describe('Issue model', () => {
...
@@ -55,15 +55,27 @@ describe('Issue model', () => {
expect
(
issue
.
labels
.
length
).
toBe
(
2
);
expect
(
issue
.
labels
.
length
).
toBe
(
2
);
});
});
it
(
'
does not add existing label
'
,
()
=>
{
it
(
'
does not add label if label id exists
'
,
()
=>
{
issue
.
addLabel
({
id
:
1
,
title
:
'
test 2
'
,
color
:
'
blue
'
,
description
:
'
testing
'
,
});
expect
(
issue
.
labels
.
length
).
toBe
(
1
);
expect
(
issue
.
labels
[
0
].
color
).
toBe
(
'
red
'
);
});
it
(
'
adds other label with same title
'
,
()
=>
{
issue
.
addLabel
({
issue
.
addLabel
({
id
:
2
,
id
:
2
,
title
:
'
test
'
,
title
:
'
test
'
,
color
:
'
blue
'
,
color
:
'
blue
'
,
description
:
'
bugs!
'
,
description
:
'
other test
'
,
});
});
expect
(
issue
.
labels
.
length
).
toBe
(
1
);
expect
(
issue
.
labels
.
length
).
toBe
(
2
);
});
});
it
(
'
finds label
'
,
()
=>
{
it
(
'
finds label
'
,
()
=>
{
...
...
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