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
bb5f1b22
Commit
bb5f1b22
authored
Oct 04, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly display currently selected value in Milestone/Weight selects
parent
e0d7d84c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
28 deletions
+31
-28
app/assets/javascripts/boards/components/milestone_select.vue
...assets/javascripts/boards/components/milestone_select.vue
+16
-23
app/assets/javascripts/boards/components/weight_select.vue
app/assets/javascripts/boards/components/weight_select.vue
+7
-2
app/assets/javascripts/boards/services/board_service.js
app/assets/javascripts/boards/services/board_service.js
+4
-0
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+3
-2
ee/app/helpers/ee/boards_helper.rb
ee/app/helpers/ee/boards_helper.rb
+1
-1
No files found.
app/assets/javascripts/boards/components/milestone_select.vue
View file @
bb5f1b22
...
...
@@ -4,6 +4,8 @@
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
extraMilestones
from
'
../mixins/extra_milestones
'
;
const
ANY_MILESTONE
=
'
Any Milestone
'
;
export
default
{
props
:
{
board
:
{
...
...
@@ -28,21 +30,22 @@ export default {
default
:
false
,
},
},
data
()
{
return
{
isOpen
:
false
,
loading
:
true
,
milestones
:
[],
extraMilestones
,
};
},
components
:
{
loadingIcon
,
},
computed
:
{
milestoneTitle
()
{
return
this
.
board
.
milestone
?
this
.
board
.
milestone
.
title
:
''
;
return
this
.
board
.
milestone
?
this
.
board
.
milestone
.
title
:
ANY_MILESTONE
;
},
milestoneId
()
{
return
this
.
board
.
milestone
?
this
.
board
.
milestone
.
id
:
''
;
},
milestoneTitleClass
()
{
return
this
.
milestoneTitle
===
'
ANY_MILESTONE
'
?
'
bold
'
:
'
text-secondary
'
;
},
selected
()
{
return
this
.
board
.
milestone
?
this
.
board
.
milestone
.
name
:
''
;
}
},
methods
:
{
selectMilestone
(
milestone
)
{
...
...
@@ -70,17 +73,8 @@ export default {
</a>
</div>
<div
class=
"value"
>
<span
class=
"no-value"
v-if=
"!board.milestone"
>
None
</span>
<span
class=
"bold has-tooltip"
v-if=
"board.milestone"
>
{{
board
.
milestone
.
title
}}
<span
:class=
"milestoneTitleClass"
>
{{
milestoneTitle
}}
</span>
</div>
<div
...
...
@@ -88,15 +82,14 @@ export default {
style=
"display: none;"
>
<input
:value=
"
board.milestone.i
d"
:value=
"
milestoneI
d"
name=
"milestone_id"
type=
"hidden"
v-if=
"board.milestone"
>
<div
class=
"dropdown"
>
<button
ref=
"dropdownButton"
:data-selected=
"
milestoneTitle
"
:data-selected=
"
selected
"
class=
"dropdown-menu-toggle wide"
:data-milestones=
"milestonePath"
:data-show-no=
"true"
...
...
app/assets/javascripts/boards/components/weight_select.vue
View file @
bb5f1b22
...
...
@@ -5,6 +5,8 @@ import '~/weight_select';
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
eventHub
from
'
../eventhub
'
;
const
ANY_WEIGHT
=
'
Any Weight
'
;
export
default
{
props
:
{
board
:
{
...
...
@@ -43,11 +45,14 @@ export default {
},
computed
:
{
valueClass
()
{
if
(
this
.
value
===
'
Any Weight
'
)
{
if
(
this
.
value
Text
===
ANY_WEIGHT
)
{
return
'
text-secondary
'
;
}
return
'
bold
'
;
},
valueText
()
{
return
this
.
value
||
ANY_WEIGHT
;
}
},
methods
:
{
selectWeight
(
weight
)
{
...
...
@@ -80,7 +85,7 @@ export default {
class=
"value"
:class=
"valueClass"
>
{{
value
}}
{{
value
Text
}}
</div>
<div
class=
"selectbox"
...
...
app/assets/javascripts/boards/services/board_service.js
View file @
bb5f1b22
...
...
@@ -36,6 +36,10 @@ class BoardService {
board
.
assignee_id
=
board
.
assignee
.
id
;
}
if
(
board
.
milestone
)
{
board
.
milestone_id
=
board
.
milestone
.
id
;
}
if
(
board
.
id
)
{
return
this
.
boards
.
update
({
id
:
board
.
id
},
{
board
});
}
...
...
app/assets/javascripts/milestone_select.js
View file @
bb5f1b22
...
...
@@ -141,7 +141,7 @@ import _ from 'underscore';
},
opened
:
function
(
e
)
{
const
$el
=
$
(
e
.
currentTarget
);
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
))
{
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
)
||
options
.
handleClick
)
{
selectedMilestone
=
$dropdown
[
0
].
dataset
.
selected
||
selectedMilestoneDefault
;
}
$
(
'
a.is-active
'
,
$el
).
removeClass
(
'
is-active
'
);
...
...
@@ -150,7 +150,8 @@ import _ from 'underscore';
vue
:
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
),
hideRow
:
function
(
milestone
)
{
if
(
$
(
'
html
'
).
hasClass
(
'
issue-boards-page
'
)
&&
!
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
)
&&
!
$dropdown
.
closest
(
'
.add-issues-modal
'
).
length
&&
gl
.
issueBoards
.
BoardsStore
.
state
.
currentBoard
.
milestone
)
{
!
$dropdown
.
closest
(
'
.add-issues-modal
'
).
length
&&
gl
.
issueBoards
.
BoardsStore
.
state
.
currentBoard
.
milestone
&&
!
options
.
handleClick
)
{
return
milestone
!==
gl
.
issueBoards
.
BoardsStore
.
state
.
currentBoard
.
milestone
.
title
;
}
...
...
ee/app/helpers/ee/boards_helper.rb
View file @
bb5f1b22
...
...
@@ -35,7 +35,7 @@ module EE
board
.
to_json
(
only:
[
:id
,
:name
,
:milestone_id
,
:author_id
,
:assignee_id
,
:weight
,
:label_ids
],
include:
{
milestone:
{
only:
[
:
titl
e
]
},
milestone:
{
only:
[
:
id
,
:title
,
:nam
e
]
},
author:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
assignee:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
labels:
{
only:
[
:title
,
:color
,
:id
]
}
...
...
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