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
3b02f8dc
Commit
3b02f8dc
authored
Jun 30, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide editing/creating milestones from the board UI
parent
2ec00d8c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
160 additions
and
121 deletions
+160
-121
app/views/projects/boards/_switcher.html.haml
app/views/projects/boards/_switcher.html.haml
+4
-3
app/views/projects/boards/components/_form.html.haml
app/views/projects/boards/components/_form.html.haml
+27
-26
spec/features/boards/board_with_milestone_spec.rb
spec/features/boards/board_with_milestone_spec.rb
+129
-92
No files found.
app/views/projects/boards/_switcher.html.haml
View file @
3b02f8dc
...
...
@@ -49,9 +49,10 @@
%li
%a
{
"href"
=>
"#"
,
"@click.stop.prevent"
=>
"showPage('edit')"
}
Edit board name
%li
%a
{
"href"
=>
"#"
,
"@click.stop.prevent"
=>
"showPage('milestone')"
}
Edit board milestone
-
if
@project
.
feature_available?
(
:issue_board_milestone
,
current_user
)
%li
%a
{
"href"
=>
"#"
,
"@click.stop.prevent"
=>
"showPage('milestone')"
}
Edit board milestone
%li
{
"v-if"
=>
"showDelete"
}
%a
.text-danger
{
"href"
=>
"#"
,
"@click.stop.prevent"
=>
"showPage('delete')"
}
Delete board
app/views/projects/boards/components/_form.html.haml
View file @
3b02f8dc
...
...
@@ -10,32 +10,33 @@
%input
.form-control
{
type:
"text"
,
id:
"board-new-name"
,
"v-model"
=>
"board.name"
}
.dropdown.board-inner-milestone-dropdown
{
":class"
=>
"{ open: milestoneDropdownOpen }"
,
"v-if"
=>
"currentPage === 'new'"
}
%label
.label-light
{
for:
"board-milestone"
}
Board milestone
%button
.dropdown-menu-toggle.wide
{
type:
"button"
,
"@click.stop.prevent"
=>
"loadMilestones($event)"
}
{{ milestoneToggleText }}
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-menu-selectable
{
"v-if"
=>
"milestoneDropdownOpen"
,
ref:
"milestoneDropdown"
}
.dropdown-content
%ul
%li
{
"v-for"
=>
"milestone in extraMilestones"
}
%a
{
href:
"#"
,
":class"
=>
"{ 'is-active': milestone.id === board.milestone_id }"
,
"@click.stop.prevent"
=>
"selectMilestone(milestone)"
}
{{ milestone.title }}
%li
.divider
%li
{
"v-for"
=>
"milestone in milestones"
}
%a
{
href:
"#"
,
":class"
=>
"{ 'is-active': milestone.id === board.milestone_id }"
,
"@click.stop.prevent"
=>
"selectMilestone(milestone)"
}
{{ milestone.title }}
=
dropdown_loading
%span
Only show issues scheduled for the selected milestone
-
if
@project
.
feature_available?
(
:issue_board_milestone
,
current_user
)
.dropdown.board-inner-milestone-dropdown
{
":class"
=>
"{ open: milestoneDropdownOpen }"
,
"v-if"
=>
"currentPage === 'new'"
}
%label
.label-light
{
for:
"board-milestone"
}
Board milestone
%button
.dropdown-menu-toggle.wide
{
type:
"button"
,
"@click.stop.prevent"
=>
"loadMilestones($event)"
}
{{ milestoneToggleText }}
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-menu-selectable
{
"v-if"
=>
"milestoneDropdownOpen"
,
ref:
"milestoneDropdown"
}
.dropdown-content
%ul
%li
{
"v-for"
=>
"milestone in extraMilestones"
}
%a
{
href:
"#"
,
":class"
=>
"{ 'is-active': milestone.id === board.milestone_id }"
,
"@click.stop.prevent"
=>
"selectMilestone(milestone)"
}
{{ milestone.title }}
%li
.divider
%li
{
"v-for"
=>
"milestone in milestones"
}
%a
{
href:
"#"
,
":class"
=>
"{ 'is-active': milestone.id === board.milestone_id }"
,
"@click.stop.prevent"
=>
"selectMilestone(milestone)"
}
{{ milestone.title }}
=
dropdown_loading
%span
Only show issues scheduled for the selected milestone
%board-milestone-select
{
"v-if"
=>
"currentPage == 'milestone'"
,
":milestone-path"
=>
"milestonePath"
,
":select-milestone"
=>
"selectMilestone"
,
...
...
spec/features/boards/board_with_milestone_spec.rb
View file @
3b02f8dc
...
...
@@ -10,156 +10,193 @@ describe 'Board with milestone', :feature, :js do
before
do
project
.
team
<<
[
user
,
:master
]
gitlab_sign_in
(
user
)
login_as
(
user
)
end
context
'
new boar
d'
do
context
'
with the feature enable
d'
do
before
do
visit
namespace_project_boards_path
(
project
.
namespace
,
project
)
stub_licensed_features
(
issue_board_milestone:
true
)
end
it
'creates board with milestone'
do
create_board_with_milestone
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
expect
(
find
(
'.tokens-container'
)).
to
have_content
(
milestone
.
title
)
wait_for_requests
expect
(
find
(
'.tokens-container'
)).
to
have_content
(
milestone
.
title
)
wait_for_requests
find
(
'.card'
,
match: :first
)
find
(
'.card'
,
match: :first
)
expect
(
all
(
'.board'
).
last
).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
).
last
).
to
have_selector
(
'.card'
,
count:
1
)
end
end
end
context
'update board'
do
let!
(
:milestone_two
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:board
)
{
create
(
:board
,
project:
project
,
milestone:
milestone
)
}
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
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
it
'defaults milestone filter'
do
page
.
within
'#js-multiple-boards-switcher'
do
find
(
'.dropdown-menu-toggle'
).
click
wait_for_requests
wait_for_requests
click_link
board
.
name
end
click_link
board
.
name
end
expect
(
find
(
'.tokens-container'
)).
to
have_content
(
milestone
.
title
)
expect
(
find
(
'.tokens-container'
)).
to
have_content
(
milestone
.
title
)
find
(
'.card'
,
match: :first
)
find
(
'.card'
,
match: :first
)
expect
(
all
(
'.board'
).
last
).
to
have_selector
(
'.card'
,
count:
1
)
end
expect
(
all
(
'.board'
).
last
).
to
have_selector
(
'.card'
,
count:
1
)
end
it
'sets board to any milestone'
do
update_board_milestone
(
'Any Milestone'
)
it
'sets board to any milestone'
do
update_board_milestone
(
'Any Milestone'
)
expect
(
page
).
not_to
have_css
(
'.js-visual-token'
)
expect
(
find
(
'.tokens-container'
)).
not_to
have_content
(
milestone
.
title
)
expect
(
page
).
not_to
have_css
(
'.js-visual-token'
)
expect
(
find
(
'.tokens-container'
)).
not_to
have_content
(
milestone
.
title
)
find
(
'.card'
,
match: :first
)
find
(
'.card'
,
match: :first
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
expect
(
all
(
'.board'
).
last
).
to
have_selector
(
'.card'
,
count:
2
)
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
expect
(
all
(
'.board'
).
last
).
to
have_selector
(
'.card'
,
count:
2
)
end
it
'sets board to upcoming milestone'
do
update_board_milestone
(
'Upcoming'
)
it
'sets board to upcoming milestone'
do
update_board_milestone
(
'Upcoming'
)
expect
(
find
(
'.tokens-container'
)).
not_to
have_content
(
milestone
.
title
)
expect
(
find
(
'.tokens-container'
)).
not_to
have_content
(
milestone
.
title
)
find
(
'.board'
,
match: :first
)
find
(
'.board'
,
match: :first
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
0
)
end
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
0
)
end
it
'does not allow milestone in filter to be editted'
do
find
(
'.filtered-search'
).
native
.
send_keys
(
:backspace
)
it
'does not allow milestone in filter to be editted'
do
find
(
'.filtered-search'
).
native
.
send_keys
(
:backspace
)
page
.
within
(
'.tokens-container'
)
do
expect
(
page
).
to
have_selector
(
'.value'
)
page
.
within
(
'.tokens-container'
)
do
expect
(
page
).
to
have_selector
(
'.value'
)
end
end
end
it
'does not render milestone in hint dropdown'
do
find
(
'.filtered-search'
).
click
it
'does not render milestone in hint dropdown'
do
find
(
'.filtered-search'
).
click
page
.
within
(
'#js-dropdown-hint'
)
do
expect
(
page
).
not_to
have_button
(
'Milestone'
)
page
.
within
(
'#js-dropdown-hint'
)
do
expect
(
page
).
not_to
have_button
(
'Milestone'
)
end
end
end
end
context
'removing issue from board'
do
let
(
:label
)
{
create
(
:label
,
project:
project
)
}
let!
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
label
],
milestone:
milestone
)
}
let!
(
:board
)
{
create
(
:board
,
project:
project
,
milestone:
milestone
)
}
let!
(
:list
)
{
create
(
:list
,
board:
board
,
label:
label
,
position:
0
)
}
context
'removing issue from board'
do
let
(
:label
)
{
create
(
:label
,
project:
project
)
}
let!
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
label
],
milestone:
milestone
)
}
let!
(
:board
)
{
create
(
:board
,
project:
project
,
milestone:
milestone
)
}
let!
(
:list
)
{
create
(
:list
,
board:
board
,
label:
label
,
position:
0
)
}
before
do
visit
namespace_project_boards_path
(
project
.
namespace
,
project
)
end
before
do
visit
namespace_project_boards_path
(
project
.
namespace
,
project
)
end
it
'removes issues milestone when removing from the board'
do
wait_for_requests
it
'removes issues milestone when removing from the board'
do
wait_for_requests
first
(
'.card .card-number'
).
click
first
(
'.card .card-number'
).
click
click_button
(
'Remove from board'
)
wait_for_requests
click_button
(
'Remove from board'
)
wait_for_requests
expect
(
issue
.
reload
.
milestone
).
to
be_nil
expect
(
issue
.
reload
.
milestone
).
to
be_nil
end
end
end
context
'new issues'
do
let
(
:label
)
{
create
(
:label
,
project:
project
)
}
let!
(
:list1
)
{
create
(
:list
,
board:
board
,
label:
label
,
position:
0
)
}
let!
(
:board
)
{
create
(
:board
,
project:
project
,
milestone:
milestone
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
context
'new issues'
do
let
(
:label
)
{
create
(
:label
,
project:
project
)
}
let!
(
:list1
)
{
create
(
:list
,
board:
board
,
label:
label
,
position:
0
)
}
let!
(
:board
)
{
create
(
:board
,
project:
project
,
milestone:
milestone
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
visit
namespace_project_boards_path
(
project
.
namespace
,
project
)
end
before
do
visit
namespace_project_boards_path
(
project
.
namespace
,
project
)
end
it
'creates new issue with boards milestone'
do
wait_for_requests
it
'creates new issue with boards milestone'
do
wait_for_requests
page
.
within
(
first
(
'.board'
))
do
find
(
'.btn-default'
).
click
page
.
within
(
first
(
'.board'
))
do
find
(
'.btn-default'
).
click
find
(
'.form-control'
).
set
(
'testing new issue with milestone'
)
find
(
'.form-control'
).
set
(
'testing new issue with milestone'
)
click_button
(
'Submit issue'
)
click_button
(
'Submit issue'
)
wait_for_requests
wait_for_requests
click_link
(
'testing new issue with milestone'
)
click_link
(
'testing new issue with milestone'
)
end
expect
(
page
).
to
have_content
(
milestone
.
title
)
end
expect
(
page
).
to
have_content
(
milestone
.
title
)
it
'updates issue with milestone from add issues modal'
do
wait_for_requests
click_button
'Add issues'
page
.
within
(
'.add-issues-modal'
)
do
card
=
find
(
'.card'
,
:first
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
card
.
click
click_button
'Add 1 issue'
end
click_link
(
issue
.
title
)
expect
(
page
).
to
have_content
(
milestone
.
title
)
end
end
end
it
'updates issue with milestone from add issues modal'
do
wait_for_requests
context
'with the feature disabled'
do
before
do
stub_licensed_features
(
issue_board_milestone:
false
)
visit
namespace_project_boards_path
(
project
.
namespace
,
project
)
end
click_button
'Add issues'
it
"doesn't show the input when creating a board"
do
page
.
within
'#js-multiple-boards-switcher'
do
find
(
'.dropdown-menu-toggle'
).
click
page
.
within
(
'.add-issues-modal'
)
do
card
=
find
(
'.card'
,
:first
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
click_link
'Create new board'
card
.
click
# To make sure the form is shown
expect
(
page
).
to
have_selector
(
'#board-new-name'
)
click_button
'Add 1 issue'
expect
(
page
).
not_to
have_button
(
'Milestone'
)
end
end
click_link
(
issue
.
title
)
it
"doesn't show the option to edit the milestone"
do
page
.
within
'#js-multiple-boards-switcher'
do
find
(
'.dropdown-menu-toggle'
).
click
# To make sure the dropdown is open
expect
(
page
).
to
have_link
(
'Edit board name'
)
expect
(
page
).
to
have_content
(
milestone
.
title
)
expect
(
page
).
not_to
have_link
(
'Edit board milestone'
)
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