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
3179bdcc
Commit
3179bdcc
authored
Apr 22, 2020
by
Eugenia Grieff
Committed by
Mike Greiling
Apr 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include none and 0 values for board weight
Add specs for new weight values Change None persisted value to -2
parent
f0cfb07c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
16 deletions
+46
-16
ee/app/assets/javascripts/boards/components/weight_select.vue
...pp/assets/javascripts/boards/components/weight_select.vue
+7
-6
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
+6
-1
ee/changelogs/unreleased/11529-board-weight-scope-none-and-0.yml
...gelogs/unreleased/11529-board-weight-scope-none-and-0.yml
+5
-0
ee/spec/features/boards/scoped_issue_board_spec.rb
ee/spec/features/boards/scoped_issue_board_spec.rb
+21
-2
ee/spec/frontend/boards/components/weight_select_spec.js
ee/spec/frontend/boards/components/weight_select_spec.js
+7
-7
No files found.
ee/app/assets/javascripts/boards/components/weight_select.vue
View file @
3179bdcc
...
...
@@ -2,7 +2,7 @@
import
{
GlDeprecatedButton
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
const
ANY_WEIGHT
=
'
Any Weight
'
;
const
NO_WEIGHT
=
'
No
Weight
'
;
const
NO_WEIGHT
=
'
No
ne
'
;
export
default
{
components
:
{
...
...
@@ -39,8 +39,8 @@ export default {
},
valueText
()
{
const
{
weight
}
=
this
.
board
;
if
(
weight
>
0
)
return
weight
.
toString
();
if
(
weight
===
0
||
weight
===
NO_WEIGHT
)
return
NO_WEIGHT
;
if
(
weight
>
0
||
weight
===
0
)
return
weight
.
toString
();
if
(
weight
===
-
2
)
return
NO_WEIGHT
;
return
ANY_WEIGHT
;
},
},
...
...
@@ -55,9 +55,10 @@ export default {
},
weightInt
(
weight
)
{
if
(
weight
>
0
)
{
return
weight
;
}
if
(
weight
===
NO_WEIGHT
)
{
return
parseInt
(
weight
,
10
);
}
else
if
(
weight
===
NO_WEIGHT
)
{
return
-
2
;
}
else
if
(
weight
===
'
0
'
)
{
return
0
;
}
return
-
1
;
...
...
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
View file @
3179bdcc
...
...
@@ -109,11 +109,16 @@ class BoardsStoreEE {
let
{
weight
}
=
this
.
store
.
boardConfig
;
if
(
weight
!==
-
1
)
{
if
(
weight
===
0
)
{
weight
=
'
0
'
;
}
if
(
weight
===
-
2
)
{
/* eslint-disable-next-line @gitlab/require-i18n-strings */
weight
=
'
No
+Weight
'
;
weight
=
'
No
ne
'
;
}
updateFilterPath
(
'
weight
'
,
weight
);
}
updateFilterPath
(
'
assignee_username
'
,
this
.
store
.
boardConfig
.
assigneeUsername
);
if
(
this
.
store
.
boardConfig
.
assigneeUsername
)
{
this
.
store
.
cantEdit
.
push
(
'
assignee
'
);
...
...
ee/changelogs/unreleased/11529-board-weight-scope-none-and-0.yml
0 → 100644
View file @
3179bdcc
---
title
:
Fix board edit weight values 0 or None
merge_request
:
29606
author
:
type
:
fixed
ee/spec/features/boards/scoped_issue_board_spec.rb
View file @
3179bdcc
...
...
@@ -153,6 +153,8 @@ describe 'Scoped issue boards', :js do
context
'weight'
do
let!
(
:issue_weight_1
)
{
create
(
:issue
,
project:
project
,
weight:
1
)
}
let!
(
:issue_weight_0
)
{
create
(
:issue
,
project:
project
,
weight:
0
)
}
let!
(
:issue_weight_none
)
{
create
(
:issue
,
project:
project
,
weight:
nil
)
}
it
'creates board filtering by weight'
do
create_board_weight
(
1
)
...
...
@@ -172,9 +174,21 @@ describe 'Scoped issue boards', :js do
it
'creates board filtering by "Any" weight'
do
create_board_weight
(
'Any'
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
6
)
end
it
'creates board filtering by "None" weight'
do
create_board_weight
(
'None'
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
4
)
end
it
'creates board filtering by "0" weight'
do
create_board_weight
(
0
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
1
)
end
it
'displays dot highlight and tooltip'
do
create_board_weight
(
1
)
...
...
@@ -509,7 +523,9 @@ describe 'Scoped issue boards', :js do
if
value
.
is_a?
(
Array
)
value
.
each
{
|
value
|
click_link
value
}
elsif
filter
==
'weight'
click_button
value
page
.
within
(
".dropdown-menu"
)
do
click_button
value
end
else
click_link
value
end
...
...
@@ -538,7 +554,10 @@ describe 'Scoped issue boards', :js do
page
.
within
(
".
#{
filter
}
"
)
do
click_button
'Edit'
filter
==
'weight'
?
click_button
(
value
)
:
click_link
(
value
)
page
.
within
(
".dropdown-menu"
)
do
filter
==
'weight'
?
click_button
(
value
)
:
click_link
(
value
)
end
end
click_on_board_modal
...
...
ee/spec/frontend/boards/components/weight_select_spec.js
View file @
3179bdcc
...
...
@@ -11,7 +11,7 @@ describe('WeightSelect', () => {
const
weightSelect
=
()
=>
wrapper
.
find
({
ref
:
'
weight-select
'
});
const
defaultProps
=
{
weights
:
[
'
Any
Weight
'
,
'
No Weight
'
,
1
,
2
,
3
],
weights
:
[
'
Any
'
,
'
None
'
,
0
,
1
,
2
,
3
],
board
:
{
weight
:
null
,
},
...
...
@@ -97,12 +97,12 @@ describe('WeightSelect', () => {
describe
(
'
when a new weight value is selected
'
,
()
=>
{
it
.
each
`
weight
| text
${
'
Any Weight
'
}
|
${
'
Any Weight
'
}
${
'
No Weight
'
}
|
${
'
No Weight
'
}
${
0
}
|
${
'
No Weight
'
}
${
-
1
}
|
${
'
Any Weight
'
}
${
1
}
|
${
'
1
'
}
weight | text
${
null
}
|
${
'
Any Weight
'
}
${
0
}
|
${
'
0
'
}
${
1
}
|
${
'
1
'
}
${
-
1
}
|
${
'
Any Weight
'
}
${
-
2
}
|
${
'
None
'
}
`
(
'
$weight displays as "$text"
'
,
({
weight
,
text
})
=>
{
createComponent
({
board
:
{
weight
}
});
expect
(
valueContainer
().
text
()).
toEqual
(
text
);
...
...
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