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
c85df550
Commit
c85df550
authored
Feb 16, 2017
by
Phil Hughes
Committed by
Douglas Barbosa Alexandre
Mar 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added feature tests
parent
c4c6f85f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
9 deletions
+99
-9
app/assets/javascripts/boards/components/board_new_form.js
app/assets/javascripts/boards/components/board_new_form.js
+2
-2
app/assets/javascripts/boards/components/boards_selector.js
app/assets/javascripts/boards/components/boards_selector.js
+1
-1
app/assets/javascripts/boards/components/milestone_select.js
app/assets/javascripts/boards/components/milestone_select.js
+6
-6
spec/features/boards/board_with_milestone_spec.rb
spec/features/boards/board_with_milestone_spec.rb
+90
-0
No files found.
app/assets/javascripts/boards/components/board_new_form.js
View file @
c85df550
...
...
@@ -72,11 +72,11 @@ const boardMilestoneSelect = require('./milestone_select');
if
(
this
.
currentBoard
&&
this
.
currentPage
!==
'
new
'
)
{
this
.
currentBoard
.
name
=
this
.
board
.
name
;
if
(
this
.
board
.
milestone
_id
)
{
if
(
this
.
board
.
milestone
)
{
this
.
currentBoard
.
milestone_id
=
this
.
board
.
milestone_id
;
this
.
currentBoard
.
milestone
=
this
.
board
.
milestone
;
Store
.
state
.
filters
.
milestone_title
=
this
.
currentBoard
.
milestone
.
title
;
Store
.
state
.
filters
.
milestone_title
=
this
.
currentBoard
.
milestone
_id
?
this
.
currentBoard
.
milestone
.
title
:
null
;
}
}
...
...
app/assets/javascripts/boards/components/boards_selector.js
View file @
c85df550
...
...
@@ -96,7 +96,7 @@ require('./board_new_form');
},
updateMilestoneFilterDropdown
()
{
const
$milestoneDropdown
=
$
(
'
.dropdown-menu-milestone
'
);
const
hideElements
=
this
.
board
.
milestone_id
===
null
;
const
hideElements
=
this
.
board
.
milestone_id
===
null
||
this
.
board
.
milestone_id
===
-
1
;
$milestoneDropdown
.
find
(
'
.dropdown-input, .dropdown-footer-list
'
)
.
toggle
(
hideElements
);
...
...
app/assets/javascripts/boards/components/milestone_select.js
View file @
c85df550
...
...
@@ -18,9 +18,9 @@ module.exports = Vue.extend({
return
{
loading
:
false
,
milestones
:
[],
no
Milestone
:
{
id
:
-
1
,
title
:
'
No
Milestone
'
,
any
Milestone
:
{
id
:
null
,
title
:
'
Any
Milestone
'
,
},
};
},
...
...
@@ -45,11 +45,11 @@ module.exports = Vue.extend({
<li>
<a
href="#"
@click.prevent.stop="selectMilestone(
no
Milestone)">
@click.prevent.stop="selectMilestone(
any
Milestone)">
<i
class="fa fa-check"
v-if="board.milestone_id ===
no
Milestone.id"></i>
{{
no
Milestone.title }}
v-if="board.milestone_id ===
any
Milestone.id"></i>
{{
any
Milestone.title }}
</a>
</li>
<li class="divider"></li>
...
...
spec/features/boards/board_with_milestone_spec.rb
0 → 100644
View file @
c85df550
require
'rails_helper'
describe
'Multiple Issue Boards'
,
:feature
,
:js
do
include
WaitForAjax
include
WaitForVueResource
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:issue
)
{
create
(
:closed_issue
,
project:
project
)
}
let!
(
:issue_milestone
)
{
create
(
:closed_issue
,
project:
project
,
milestone:
milestone
)
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
end
context
'new board'
do
before
do
visit
namespace_project_boards_path
(
project
.
namespace
,
project
)
end
it
'creates board with milestone'
do
create_board_with_milestone
click_link
'test'
expect
(
find
(
'.js-milestone-select'
)).
to
have_content
(
milestone
.
title
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
1
)
end
end
context
'update board'
do
let!
(
:milestone_two
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:board
)
{
create
(
:board
,
project:
project
,
milestone:
milestone
)
}
before
do
visit
namespace_project_boards_path
(
project
.
namespace
,
project
)
end
it
'defaults milestone filter'
do
page
.
within
'#js-multiple-boards-switcher'
do
find
(
'.dropdown-menu-toggle'
).
click
wait_for_vue_resource
click_link
board
.
name
end
expect
(
find
(
'.js-milestone-select'
)).
to
have_content
(
milestone
.
title
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
1
)
end
it
'sets board to any milestone'
do
update_board_milestone
(
'Any Milestone'
)
expect
(
find
(
'.js-milestone-select'
)).
not_to
have_content
(
milestone
.
title
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
2
)
end
end
def
create_board_with_milestone
page
.
within
'#js-multiple-boards-switcher'
do
find
(
'.dropdown-menu-toggle'
).
click
click_link
'Create new board'
find
(
'#board-new-name'
).
set
'test'
click_button
'Milestone'
click_link
milestone
.
title
click_button
'Create'
end
end
def
update_board_milestone
(
milestone_title
)
page
.
within
'#js-multiple-boards-switcher'
do
find
(
'.dropdown-menu-toggle'
).
click
click_link
'Edit board milestone'
click_link
milestone_title
click_button
'Save'
end
end
end
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