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
Tatuya Kamada
gitlab-ce
Commits
f4c9d514
Commit
f4c9d514
authored
Aug 11, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Defaults milestone filter to upcoming
parent
917a5140
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
29 deletions
+39
-29
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+1
-1
app/assets/javascripts/boards/test_utils/simulate_drag.js
app/assets/javascripts/boards/test_utils/simulate_drag.js
+1
-1
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+1
-0
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+6
-2
app/views/projects/boards/show.html.haml
app/views/projects/boards/show.html.haml
+1
-1
app/views/shared/issuable/_milestone_dropdown.html.haml
app/views/shared/issuable/_milestone_dropdown.html.haml
+5
-1
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+24
-23
No files found.
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
f4c9d514
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
this.state.filters = {
this.state.filters = {
author_id: gl.utils.getParameterValues('author_id')[0],
author_id: gl.utils.getParameterValues('author_id')[0],
assignee_id: gl.utils.getParameterValues('assignee_id')[0],
assignee_id: gl.utils.getParameterValues('assignee_id')[0],
milestone_title: gl.utils.getParameterValues('milestone_title')[0],
milestone_title: gl.utils.getParameterValues('milestone_title')[0]
|| '#upcoming'
,
label_name: gl.utils.getParameterValues('label_name[]')
label_name: gl.utils.getParameterValues('label_name[]')
};
};
},
},
...
...
app/assets/javascripts/boards/test_utils/simulate_drag.js
View file @
f4c9d514
app/assets/stylesheets/pages/boards.scss
View file @
f4c9d514
...
@@ -228,6 +228,7 @@
...
@@ -228,6 +228,7 @@
.board-list
{
.board-list
{
-webkit-flex
:
1
;
-webkit-flex
:
1
;
flex
:
1
;
flex
:
1
;
height
:
400px
;
margin-bottom
:
0
;
margin-bottom
:
0
;
padding
:
5px
;
padding
:
5px
;
overflow-y
:
scroll
;
overflow-y
:
scroll
;
...
...
app/helpers/issuables_helper.rb
View file @
f4c9d514
...
@@ -49,12 +49,16 @@ module IssuablesHelper
...
@@ -49,12 +49,16 @@ module IssuablesHelper
end
end
end
end
def
milestone_dropdown_label
(
milestone_title
,
default_label
=
"Milestone"
)
def
milestone_dropdown_label
(
milestone_title
,
is_boards
,
default_label
=
"Milestone"
)
if
milestone_title
==
Milestone
::
Upcoming
.
name
if
milestone_title
==
Milestone
::
Upcoming
.
name
milestone_title
=
Milestone
::
Upcoming
.
title
milestone_title
=
Milestone
::
Upcoming
.
title
end
end
h
(
milestone_title
.
presence
||
default_label
)
if
is_boards
boards_default
=
Milestone
::
Upcoming
.
title
end
h
(
milestone_title
.
presence
||
boards_default
||
default_label
)
end
end
def
issuable_meta
(
issuable
,
project
,
text
)
def
issuable_meta
(
issuable
,
project
,
text
)
...
...
app/views/projects/boards/show.html.haml
View file @
f4c9d514
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
-
content_for
:page_specific_javascripts
do
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
'boards/boards_bundle.js'
)
=
page_specific_javascript_tag
(
'boards/boards_bundle.js'
)
=
page_specific_javascript_tag
(
'boards/test_utils/simulate_drag.js'
)
if
Rails
.
env
.
test?
=
page_specific_javascript_tag
(
'boards/test_utils/simulate_drag.js'
)
=
render
"projects/issues/head"
=
render
"projects/issues/head"
...
...
app/views/shared/issuable/_milestone_dropdown.html.haml
View file @
f4c9d514
-
is_boards
=
controller
.
controller_name
==
'boards'
-
if
params
[
:milestone_title
].
present?
-
if
params
[
:milestone_title
].
present?
=
hidden_field_tag
(
:milestone_title
,
params
[
:milestone_title
])
=
hidden_field_tag
(
:milestone_title
,
params
[
:milestone_title
])
=
dropdown_tag
(
milestone_dropdown_label
(
params
[
:milestone_title
]),
options:
{
title:
"Filter by milestone"
,
toggle_class:
'js-milestone-select js-filter-submit'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
-
elsif
is_boards
=
hidden_field_tag
(
:milestone_title
,
Milestone
::
Upcoming
.
name
)
=
dropdown_tag
(
milestone_dropdown_label
(
params
[
:milestone_title
],
is_boards
),
options:
{
title:
"Filter by milestone"
,
toggle_class:
'js-milestone-select js-filter-submit'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search milestones"
,
footer_content:
@project
.
present?
,
data:
{
show_no:
true
,
show_any:
true
,
show_upcoming:
true
,
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
@project
.
try
(
:id
),
milestones:
milestones_filter_dropdown_path
,
default_label:
"Milestone"
}
})
do
placeholder:
"Search milestones"
,
footer_content:
@project
.
present?
,
data:
{
show_no:
true
,
show_any:
true
,
show_upcoming:
true
,
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
@project
.
try
(
:id
),
milestones:
milestones_filter_dropdown_path
,
default_label:
"Milestone"
}
})
do
-
if
@project
-
if
@project
%ul
.dropdown-footer-list
%ul
.dropdown-footer-list
...
...
spec/features/boards/boards_spec.rb
View file @
f4c9d514
...
@@ -44,6 +44,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -44,6 +44,7 @@ describe 'Issue Boards', feature: true, js: true do
end
end
context
'with lists'
do
context
'with lists'
do
let!
(
:milestone_upcoming
)
{
create
(
:milestone
,
project:
project
,
due_date:
Date
.
tomorrow
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:planning
)
{
create
(
:label
,
project:
project
,
name:
'Planning'
)
}
let
(
:planning
)
{
create
(
:label
,
project:
project
,
name:
'Planning'
)
}
...
@@ -54,16 +55,16 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -54,16 +55,16 @@ describe 'Issue Boards', feature: true, js: true do
let!
(
:list1
)
{
create
(
:list
,
board:
project
.
board
,
label:
planning
,
position:
0
)
}
let!
(
:list1
)
{
create
(
:list
,
board:
project
.
board
,
label:
planning
,
position:
0
)
}
let!
(
:list2
)
{
create
(
:list
,
board:
project
.
board
,
label:
development
,
position:
1
)
}
let!
(
:list2
)
{
create
(
:list
,
board:
project
.
board
,
label:
development
,
position:
1
)
}
let!
(
:confidential_issue
)
{
create
(
:issue
,
:confidential
,
project:
project
,
author:
user
)
}
let!
(
:confidential_issue
)
{
create
(
:issue
,
:confidential
,
project:
project
,
author:
user
,
milestone:
milestone_upcoming
)
}
let!
(
:issue1
)
{
create
(
:issue
,
project:
project
,
assignee:
user
)
}
let!
(
:issue1
)
{
create
(
:issue
,
project:
project
,
assignee:
user
,
milestone:
milestone_upcoming
)
}
let!
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user2
)
}
let!
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user2
,
milestone:
milestone_upcoming
)
}
let!
(
:issue3
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:issue3
)
{
create
(
:issue
,
project:
project
,
milestone:
milestone_upcoming
)
}
let!
(
:issue4
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:issue4
)
{
create
(
:issue
,
project:
project
,
milestone:
milestone_upcoming
)
}
let!
(
:issue5
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
],
milestone:
milestone
)
}
let!
(
:issue5
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
],
milestone:
milestone
)
}
let!
(
:issue6
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
,
development
])
}
let!
(
:issue6
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
,
development
]
,
milestone:
milestone_upcoming
)
}
let!
(
:issue7
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
])
}
let!
(
:issue7
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
]
,
milestone:
milestone_upcoming
)
}
let!
(
:issue8
)
{
create
(
:closed_issue
,
project:
project
)
}
let!
(
:issue8
)
{
create
(
:closed_issue
,
project:
project
,
milestone:
milestone_upcoming
)
}
let!
(
:issue9
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
testing
,
bug
])
}
let!
(
:issue9
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
testing
,
bug
]
,
milestone:
milestone_upcoming
)
}
before
do
before
do
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
...
@@ -77,8 +78,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -77,8 +78,8 @@ describe 'Issue Boards', feature: true, js: true do
it
'shows issues in lists'
do
it
'shows issues in lists'
do
page
.
within
(
all
(
'.board'
)[
1
])
do
page
.
within
(
all
(
'.board'
)[
1
])
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'
2
'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'
1
'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
end
page
.
within
(
all
(
'.board'
)[
2
])
do
page
.
within
(
all
(
'.board'
)[
2
])
do
...
@@ -102,7 +103,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -102,7 +103,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'infinite scrolls list'
do
it
'infinite scrolls list'
do
50
.
times
do
50
.
times
do
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
,
milestone:
milestone_upcoming
)
end
end
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
...
@@ -156,8 +157,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -156,8 +157,8 @@ describe 'Issue Boards', feature: true, js: true do
end
end
page
.
within
(
all
(
'.board'
)[
1
])
do
page
.
within
(
all
(
'.board'
)[
1
])
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'
3
'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'
2
'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
3
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
2
)
end
end
end
end
end
end
...
@@ -178,7 +179,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -178,7 +179,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'removes all of the same issue to done'
do
it
'removes all of the same issue to done'
do
drag_to
(
list_from_index:
1
,
list_to_index:
3
)
drag_to
(
list_from_index:
1
,
list_to_index:
3
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
).
last
).
to
have_content
(
issue6
.
title
)
expect
(
all
(
'.board'
).
last
).
to
have_content
(
issue6
.
title
)
expect
(
all
(
'.board'
).
last
).
not_to
have_content
(
planning
.
title
)
expect
(
all
(
'.board'
).
last
).
not_to
have_content
(
planning
.
title
)
...
@@ -194,10 +195,10 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -194,10 +195,10 @@ describe 'Issue Boards', feature: true, js: true do
end
end
it
'moves between lists'
do
it
'moves between lists'
do
drag_to
(
list_from_index:
1
,
card_index:
1
,
list_to_index:
2
)
drag_to
(
list_from_index:
1
,
list_to_index:
2
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
3
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
2
)
expect
(
all
(
'.board'
)[
2
]).
to
have_content
(
issue6
.
title
)
expect
(
all
(
'.board'
)[
2
]).
to
have_content
(
issue6
.
title
)
expect
(
all
(
'.board'
)[
2
].
all
(
'.card'
).
last
).
not_to
have_content
(
development
.
title
)
expect
(
all
(
'.board'
)[
2
].
all
(
'.card'
).
last
).
not_to
have_content
(
development
.
title
)
end
end
...
@@ -205,7 +206,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -205,7 +206,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'moves between lists'
do
it
'moves between lists'
do
drag_to
(
list_from_index:
2
,
list_to_index:
1
)
drag_to
(
list_from_index:
2
,
list_to_index:
1
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
3
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
2
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
)[
1
]).
to
have_content
(
issue7
.
title
)
expect
(
all
(
'.board'
)[
1
]).
to
have_content
(
issue7
.
title
)
expect
(
all
(
'.board'
)[
1
].
all
(
'.card'
).
first
).
not_to
have_content
(
planning
.
title
)
expect
(
all
(
'.board'
)[
1
].
all
(
'.card'
).
first
).
not_to
have_content
(
planning
.
title
)
...
@@ -214,7 +215,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -214,7 +215,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'moves from done'
do
it
'moves from done'
do
drag_to
(
list_from_index:
3
,
list_to_index:
1
)
drag_to
(
list_from_index:
3
,
list_to_index:
1
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
3
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
2
)
expect
(
all
(
'.board'
)[
1
]).
to
have_content
(
issue8
.
title
)
expect
(
all
(
'.board'
)[
1
]).
to
have_content
(
issue8
.
title
)
end
end
...
@@ -314,7 +315,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -314,7 +315,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'filters by milestone'
do
it
'filters by milestone'
do
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
click_button
(
'
Milestone
'
)
click_button
(
'
Upcoming
'
)
page
.
within
'.milestone-filter'
do
page
.
within
'.milestone-filter'
do
click_link
(
milestone
.
title
)
click_link
(
milestone
.
title
)
...
@@ -357,7 +358,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -357,7 +358,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'infinite scrolls list with label filter'
do
it
'infinite scrolls list with label filter'
do
50
.
times
do
50
.
times
do
create
(
:labeled_issue
,
project:
project
,
labels:
[
testing
])
create
(
:labeled_issue
,
project:
project
,
labels:
[
testing
]
,
milestone:
milestone_upcoming
)
end
end
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
...
...
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