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
5fb3b644
Commit
5fb3b644
authored
Oct 06, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix No and Any selection for Weight and Milestone dropdowns
parent
33398e04
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
18 deletions
+48
-18
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+18
-7
app/assets/javascripts/boards/components/milestone_select.vue
...assets/javascripts/boards/components/milestone_select.vue
+14
-2
app/assets/javascripts/boards/components/weight_select.vue
app/assets/javascripts/boards/components/weight_select.vue
+10
-1
app/assets/javascripts/boards/filtered_search_boards.js
app/assets/javascripts/boards/filtered_search_boards.js
+4
-7
ee/app/helpers/ee/boards_helper.rb
ee/app/helpers/ee/boards_helper.rb
+2
-1
No files found.
app/assets/javascripts/boards/boards_bundle.js
View file @
5fb3b644
...
...
@@ -68,8 +68,9 @@ $(() => {
rootPath
:
$boardApp
.
dataset
.
rootPath
,
bulkUpdatePath
:
$boardApp
.
dataset
.
bulkUpdatePath
,
detailIssue
:
Store
.
detail
,
milestoneId
:
parseInt
(
$boardApp
.
dataset
.
boardMilestoneId
,
10
),
milestoneTitle
:
$boardApp
.
dataset
.
boardMilestoneTitle
,
weight
:
$boardApp
.
dataset
.
boardWeight
,
weight
:
parseInt
(
$boardApp
.
dataset
.
boardWeight
,
10
)
,
assigneeUsername
:
$boardApp
.
dataset
.
boardAssigneeUsername
,
labels
:
JSON
.
parse
(
$boardApp
.
dataset
.
labels
||
[]),
defaultAvatar
:
$boardApp
.
dataset
.
defaultAvatar
,
...
...
@@ -87,14 +88,24 @@ $(() => {
Store
.
filter
.
path
=
[
querystring
].
concat
(
Store
.
filter
.
path
.
split
(
'
&
'
).
filter
(
param
=>
param
.
match
(
new
RegExp
(
`^
${
key
}
=(.*)$`
,
'
g
'
))
===
null
)
).
join
(
'
&
'
);
this
.
cantEdit
.
push
({
name
:
tokenName
,
value
,
});
this
.
cantEdit
.
push
(
tokenName
);
};
updateFilterPath
(
'
milestone_title
'
,
this
.
milestoneTitle
,
'
milestone
'
);
updateFilterPath
(
'
weight
'
,
this
.
weight
,
'
weight
'
);
if
(
this
.
milestoneId
!==
-
1
)
{
let
milestoneTitle
=
this
.
milestoneTitle
;
if
(
this
.
milestoneId
===
0
)
{
milestoneTitle
=
'
No+Milestone
'
;
}
updateFilterPath
(
'
milestone_title
'
,
milestoneTitle
,
'
milestone
'
);
}
let
weight
=
this
.
weight
;
if
(
weight
!==
-
1
)
{
if
(
weight
===
0
)
{
weight
=
'
No+Weight
'
;
}
updateFilterPath
(
'
weight
'
,
weight
,
'
weight
'
);
}
updateFilterPath
(
'
assignee_username
'
,
this
.
assigneeUsername
,
'
assignee
'
);
const
filterPath
=
gl
.
issueBoards
.
BoardsStore
.
filter
.
path
.
split
(
'
&
'
);
...
...
app/assets/javascripts/boards/components/milestone_select.vue
View file @
5fb3b644
...
...
@@ -2,9 +2,9 @@
/* global BoardService, MilestoneSelect */
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
extraMilestones
from
'
../mixins/extra_milestones
'
;
const
ANY_MILESTONE
=
'
Any Milestone
'
;
const
NO_MILESTONE
=
'
No Milestone
'
;
export
default
{
props
:
{
...
...
@@ -31,20 +31,32 @@ export default {
},
computed
:
{
milestoneTitle
()
{
if
(
this
.
noMilestone
)
return
NO_MILESTONE
;
return
this
.
board
.
milestone
?
this
.
board
.
milestone
.
title
:
ANY_MILESTONE
;
},
noMilestone
()
{
return
this
.
milestoneId
===
0
;
},
milestoneId
()
{
return
this
.
board
.
milestone
?
this
.
board
.
milestone
.
id
:
''
;
return
this
.
board
.
milestone
_id
;
},
milestoneTitleClass
()
{
return
this
.
milestoneTitle
===
ANY_MILESTONE
?
'
text-secondary
'
:
'
bold
'
;
},
selected
()
{
if
(
this
.
noMilestone
)
return
NO_MILESTONE
;
return
this
.
board
.
milestone
?
this
.
board
.
milestone
.
name
:
''
;
}
},
methods
:
{
selectMilestone
(
milestone
)
{
// swap the IDs of 'Any' and 'No' milestone to what backend requires
if
(
milestone
.
title
===
ANY_MILESTONE
)
{
milestone
.
id
=
-
1
;
}
else
if
(
milestone
.
title
===
NO_MILESTONE
)
{
milestone
.
id
=
0
;
}
this
.
$set
(
this
.
board
,
'
milestone_id
'
,
milestone
.
id
);
this
.
$set
(
this
.
board
,
'
milestone
'
,
milestone
);
},
},
...
...
app/assets/javascripts/boards/components/weight_select.vue
View file @
5fb3b644
...
...
@@ -6,6 +6,7 @@ import loadingIcon from '~/vue_shared/components/loading_icon.vue';
import
eventHub
from
'
../eventhub
'
;
const
ANY_WEIGHT
=
'
Any Weight
'
;
const
NO_WEIGHT
=
'
No Weight
'
;
export
default
{
props
:
{
...
...
@@ -47,11 +48,19 @@ export default {
return
'
bold
'
;
},
valueText
()
{
return
this
.
value
||
ANY_WEIGHT
;
if
(
this
.
value
>
0
)
return
this
.
value
;
if
(
this
.
value
==
0
)
return
NO_WEIGHT
;
return
ANY_WEIGHT
;
}
},
methods
:
{
selectWeight
(
weight
)
{
if
(
weight
===
ANY_WEIGHT
)
{
weight
=
-
1
;
}
if
(
weight
===
NO_WEIGHT
)
{
weight
=
0
;
}
this
.
$set
(
this
.
board
,
'
weight
'
,
weight
);
},
},
...
...
app/assets/javascripts/boards/filtered_search_boards.js
View file @
5fb3b644
...
...
@@ -11,8 +11,8 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager {
// Issue boards is slightly different, we handle all the requests async
// instead or reloading the page, we just re-fire the list ajax requests
this
.
isHandledAsync
=
true
;
this
.
cantEdit
=
cantEdit
;
this
.
hiddenTokenNames
=
cantEdit
.
map
(
i
=>
i
.
tokenName
);
this
.
cantEdit
=
cantEdit
.
filter
(
i
=>
typeof
i
===
'
string
'
)
;
this
.
cantEditWithValue
=
cantEdit
.
filter
(
i
=>
typeof
i
===
'
object
'
);
}
updateObject
(
path
)
{
...
...
@@ -44,10 +44,7 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager {
}
canEdit
(
tokenName
,
tokenValue
)
{
// only hide tokens if both name and value match. This allows mix of hidden and visible Label tokens
if
(
tokenValue
)
{
return
this
.
cantEdit
.
findIndex
(
t
=>
t
.
name
===
tokenName
&&
t
.
value
===
tokenValue
)
===
-
1
;
}
return
this
.
hiddenTokenNames
.
indexOf
(
tokenName
)
===
-
1
;
if
(
this
.
cantEdit
.
includes
(
tokenName
))
return
false
;
return
this
.
cantEditWithValue
.
findIndex
(
t
=>
t
.
name
===
tokenName
&&
t
.
value
===
tokenValue
)
===
-
1
;
}
}
ee/app/helpers/ee/boards_helper.rb
View file @
5fb3b644
...
...
@@ -11,9 +11,10 @@ module EE
!
@project
.
feature_available?
(
:issue_board_focus_mode
))).
to_s
data
=
{
board_milestone_title:
board
&
.
milestone
&
.
title
,
board_milestone_id:
board
&
.
milestone_id
,
board_assignee_username:
board
&
.
assignee
&
.
username
,
label_ids:
board
&
.
label_ids
,
labels:
board
&
.
labels
.
to_json
(
only:
[
:id
,
:title
,
:color
]
),
labels:
board
&
.
labels
.
to_json
(
only:
[
:id
,
:title
,
:color
,
:text_color
]
),
board_weight:
board
&
.
weight
,
focus_mode_available:
parent
.
feature_available?
(
:issue_board_focus_mode
).
to_s
,
show_promotion:
show_feature_promotion
...
...
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