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
Show 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 @@
...
@@ -2,7 +2,7 @@
import
{
GlDeprecatedButton
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlDeprecatedButton
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
const
ANY_WEIGHT
=
'
Any Weight
'
;
const
ANY_WEIGHT
=
'
Any Weight
'
;
const
NO_WEIGHT
=
'
No
Weight
'
;
const
NO_WEIGHT
=
'
No
ne
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -39,8 +39,8 @@ export default {
...
@@ -39,8 +39,8 @@ export default {
},
},
valueText
()
{
valueText
()
{
const
{
weight
}
=
this
.
board
;
const
{
weight
}
=
this
.
board
;
if
(
weight
>
0
)
return
weight
.
toString
();
if
(
weight
>
0
||
weight
===
0
)
return
weight
.
toString
();
if
(
weight
===
0
||
weight
===
NO_WEIGHT
)
return
NO_WEIGHT
;
if
(
weight
===
-
2
)
return
NO_WEIGHT
;
return
ANY_WEIGHT
;
return
ANY_WEIGHT
;
},
},
},
},
...
@@ -55,9 +55,10 @@ export default {
...
@@ -55,9 +55,10 @@ export default {
},
},
weightInt
(
weight
)
{
weightInt
(
weight
)
{
if
(
weight
>
0
)
{
if
(
weight
>
0
)
{
return
weight
;
return
parseInt
(
weight
,
10
);
}
}
else
if
(
weight
===
NO_WEIGHT
)
{
if
(
weight
===
NO_WEIGHT
)
{
return
-
2
;
}
else
if
(
weight
===
'
0
'
)
{
return
0
;
return
0
;
}
}
return
-
1
;
return
-
1
;
...
...
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
View file @
3179bdcc
...
@@ -109,11 +109,16 @@ class BoardsStoreEE {
...
@@ -109,11 +109,16 @@ class BoardsStoreEE {
let
{
weight
}
=
this
.
store
.
boardConfig
;
let
{
weight
}
=
this
.
store
.
boardConfig
;
if
(
weight
!==
-
1
)
{
if
(
weight
!==
-
1
)
{
if
(
weight
===
0
)
{
if
(
weight
===
0
)
{
weight
=
'
0
'
;
}
if
(
weight
===
-
2
)
{
/* eslint-disable-next-line @gitlab/require-i18n-strings */
/* eslint-disable-next-line @gitlab/require-i18n-strings */
weight
=
'
No
+Weight
'
;
weight
=
'
No
ne
'
;
}
}
updateFilterPath
(
'
weight
'
,
weight
);
updateFilterPath
(
'
weight
'
,
weight
);
}
}
updateFilterPath
(
'
assignee_username
'
,
this
.
store
.
boardConfig
.
assigneeUsername
);
updateFilterPath
(
'
assignee_username
'
,
this
.
store
.
boardConfig
.
assigneeUsername
);
if
(
this
.
store
.
boardConfig
.
assigneeUsername
)
{
if
(
this
.
store
.
boardConfig
.
assigneeUsername
)
{
this
.
store
.
cantEdit
.
push
(
'
assignee
'
);
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
...
@@ -153,6 +153,8 @@ describe 'Scoped issue boards', :js do
context
'weight'
do
context
'weight'
do
let!
(
:issue_weight_1
)
{
create
(
:issue
,
project:
project
,
weight:
1
)
}
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
it
'creates board filtering by weight'
do
create_board_weight
(
1
)
create_board_weight
(
1
)
...
@@ -172,9 +174,21 @@ describe 'Scoped issue boards', :js do
...
@@ -172,9 +174,21 @@ describe 'Scoped issue boards', :js do
it
'creates board filtering by "Any" weight'
do
it
'creates board filtering by "Any" weight'
do
create_board_weight
(
'Any'
)
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
)
expect
(
page
).
to
have_selector
(
'.board-card'
,
count:
4
)
end
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
it
'displays dot highlight and tooltip'
do
create_board_weight
(
1
)
create_board_weight
(
1
)
...
@@ -509,7 +523,9 @@ describe 'Scoped issue boards', :js do
...
@@ -509,7 +523,9 @@ describe 'Scoped issue boards', :js do
if
value
.
is_a?
(
Array
)
if
value
.
is_a?
(
Array
)
value
.
each
{
|
value
|
click_link
value
}
value
.
each
{
|
value
|
click_link
value
}
elsif
filter
==
'weight'
elsif
filter
==
'weight'
page
.
within
(
".dropdown-menu"
)
do
click_button
value
click_button
value
end
else
else
click_link
value
click_link
value
end
end
...
@@ -538,8 +554,11 @@ describe 'Scoped issue boards', :js do
...
@@ -538,8 +554,11 @@ describe 'Scoped issue boards', :js do
page
.
within
(
".
#{
filter
}
"
)
do
page
.
within
(
".
#{
filter
}
"
)
do
click_button
'Edit'
click_button
'Edit'
page
.
within
(
".dropdown-menu"
)
do
filter
==
'weight'
?
click_button
(
value
)
:
click_link
(
value
)
filter
==
'weight'
?
click_button
(
value
)
:
click_link
(
value
)
end
end
end
click_on_board_modal
click_on_board_modal
...
...
ee/spec/frontend/boards/components/weight_select_spec.js
View file @
3179bdcc
...
@@ -11,7 +11,7 @@ describe('WeightSelect', () => {
...
@@ -11,7 +11,7 @@ describe('WeightSelect', () => {
const
weightSelect
=
()
=>
wrapper
.
find
({
ref
:
'
weight-select
'
});
const
weightSelect
=
()
=>
wrapper
.
find
({
ref
:
'
weight-select
'
});
const
defaultProps
=
{
const
defaultProps
=
{
weights
:
[
'
Any
Weight
'
,
'
No Weight
'
,
1
,
2
,
3
],
weights
:
[
'
Any
'
,
'
None
'
,
0
,
1
,
2
,
3
],
board
:
{
board
:
{
weight
:
null
,
weight
:
null
,
},
},
...
@@ -98,11 +98,11 @@ describe('WeightSelect', () => {
...
@@ -98,11 +98,11 @@ describe('WeightSelect', () => {
describe
(
'
when a new weight value is selected
'
,
()
=>
{
describe
(
'
when a new weight value is selected
'
,
()
=>
{
it
.
each
`
it
.
each
`
weight | text
weight | text
${
'
Any Weight
'
}
|
${
'
Any Weight
'
}
${
null
}
|
${
'
Any Weight
'
}
${
'
No Weight
'
}
|
${
'
No Weight
'
}
${
0
}
|
${
'
0
'
}
${
0
}
|
${
'
No Weight
'
}
${
-
1
}
|
${
'
Any Weight
'
}
${
1
}
|
${
'
1
'
}
${
1
}
|
${
'
1
'
}
${
-
1
}
|
${
'
Any Weight
'
}
${
-
2
}
|
${
'
None
'
}
`
(
'
$weight displays as "$text"
'
,
({
weight
,
text
})
=>
{
`
(
'
$weight displays as "$text"
'
,
({
weight
,
text
})
=>
{
createComponent
({
board
:
{
weight
}
});
createComponent
({
board
:
{
weight
}
});
expect
(
valueContainer
().
text
()).
toEqual
(
text
);
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