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
Boxiang Sun
gitlab-ce
Commits
dfa842ce
Commit
dfa842ce
authored
Nov 24, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes builds tab from merge request
Fix specs
parent
09b622f8
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
425 additions
and
32 deletions
+425
-32
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+416
-0
app/assets/javascripts/merge_request_widget.js.es6
app/assets/javascripts/merge_request_widget.js.es6
+2
-2
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+2
-2
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+1
-10
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+0
-7
app/views/projects/merge_requests/widget/_show.html.haml
app/views/projects/merge_requests/widget/_show.html.haml
+0
-2
config/routes/project.rb
config/routes/project.rb
+0
-1
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+0
-4
spec/features/merge_requests/created_from_fork_spec.rb
spec/features/merge_requests/created_from_fork_spec.rb
+4
-4
No files found.
app/assets/javascripts/merge_request_tabs.js
0 → 100644
View file @
dfa842ce
This diff is collapsed.
Click to expand it.
app/assets/javascripts/merge_request_widget.js.es6
View file @
dfa842ce
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
$('#modal_merge_info').modal({
$('#modal_merge_info').modal({
show: false
show: false
});
});
this.clearEventListeners();
this.clearEventListeners();
this.addEventListeners();
this.addEventListeners();
this.getCIStatus(false);
this.getCIStatus(false);
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
MergeRequestWidget.prototype.addEventListeners = function() {
MergeRequestWidget.prototype.addEventListeners = function() {
var allowedPages;
var allowedPages;
allowedPages = ['show', 'commits', '
builds', '
pipelines', 'changes'];
allowedPages = ['show', 'commits', 'pipelines', 'changes'];
$(document).on('page:change.merge_request', (function(_this) {
$(document).on('page:change.merge_request', (function(_this) {
return function() {
return function() {
var page;
var page;
...
@@ -173,7 +174,6 @@
...
@@ -173,7 +174,6 @@
message = message.replace('{{title}}', data.title);
message = message.replace('{{title}}', data.title);
notify(title, message, _this.opts.gitlab_icon, function() {
notify(title, message, _this.opts.gitlab_icon, function() {
this.close();
this.close();
return Turbolinks.visit(_this.opts.builds_path);
});
});
}
}
}
}
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
dfa842ce
...
@@ -9,10 +9,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -9,10 +9,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_action
:module_enabled
before_action
:module_enabled
before_action
:merge_request
,
only:
[
before_action
:merge_request
,
only:
[
:edit
,
:update
,
:show
,
:diffs
,
:commits
,
:conflicts
,
:conflict_for_path
,
:
builds
,
:
pipelines
,
:merge
,
:merge_check
,
:edit
,
:update
,
:show
,
:diffs
,
:commits
,
:conflicts
,
:conflict_for_path
,
:pipelines
,
:merge
,
:merge_check
,
:ci_status
,
:ci_environments_status
,
:toggle_subscription
,
:cancel_merge_when_build_succeeds
,
:remove_wip
,
:resolve_conflicts
,
:assign_related_issues
:ci_status
,
:ci_environments_status
,
:toggle_subscription
,
:cancel_merge_when_build_succeeds
,
:remove_wip
,
:resolve_conflicts
,
:assign_related_issues
]
]
before_action
:validates_merge_request
,
only:
[
:show
,
:diffs
,
:commits
,
:
builds
,
:
pipelines
]
before_action
:validates_merge_request
,
only:
[
:show
,
:diffs
,
:commits
,
:pipelines
]
before_action
:define_show_vars
,
only:
[
:show
,
:diffs
,
:commits
,
:conflicts
,
:conflict_for_path
,
:builds
,
:pipelines
]
before_action
:define_show_vars
,
only:
[
:show
,
:diffs
,
:commits
,
:conflicts
,
:conflict_for_path
,
:builds
,
:pipelines
]
before_action
:define_widget_vars
,
only:
[
:merge
,
:cancel_merge_when_build_succeeds
,
:merge_check
]
before_action
:define_widget_vars
,
only:
[
:merge
,
:cancel_merge_when_build_succeeds
,
:merge_check
]
before_action
:define_commit_vars
,
only:
[
:diffs
]
before_action
:define_commit_vars
,
only:
[
:diffs
]
...
...
app/views/projects/merge_requests/_new_submit.html.haml
View file @
dfa842ce
...
@@ -34,11 +34,6 @@
...
@@ -34,11 +34,6 @@
=
link_to
url_for
(
params
),
data:
{
target:
'div#pipelines'
,
action:
'pipelines'
,
toggle:
'tab'
}
do
=
link_to
url_for
(
params
),
data:
{
target:
'div#pipelines'
,
action:
'pipelines'
,
toggle:
'tab'
}
do
Pipelines
Pipelines
%span
.badge
=
@pipelines
.
size
%span
.badge
=
@pipelines
.
size
-
if
@pipeline
.
present?
%li
.builds-tab
=
link_to
url_for
(
params
),
data:
{
target:
'div#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
%span
.badge
=
@statuses_count
%li
.diffs-tab
%li
.diffs-tab
=
link_to
url_for
(
params
.
merge
(
action:
'new_diffs'
)),
data:
{
target:
'div#diffs'
,
action:
'new/diffs'
,
toggle:
'tab'
}
do
=
link_to
url_for
(
params
.
merge
(
action:
'new_diffs'
)),
data:
{
target:
'div#diffs'
,
action:
'new/diffs'
,
toggle:
'tab'
}
do
Changes
Changes
...
@@ -49,9 +44,6 @@
...
@@ -49,9 +44,6 @@
=
render
"projects/merge_requests/show/commits"
=
render
"projects/merge_requests/show/commits"
#diffs
.diffs.tab-pane
#diffs
.diffs.tab-pane
-
# This tab is always loaded via AJAX
-
# This tab is always loaded via AJAX
-
if
@pipeline
.
present?
#builds
.builds.tab-pane
=
render
"projects/merge_requests/show/builds"
-
if
@pipelines
.
any?
-
if
@pipelines
.
any?
#pipelines
.pipelines.tab-pane
#pipelines
.pipelines.tab-pane
=
render
"projects/merge_requests/show/pipelines"
=
render
"projects/merge_requests/show/pipelines"
...
@@ -66,6 +58,5 @@
...
@@ -66,6 +58,5 @@
});
});
:javascript
:javascript
var
merge_request
=
new
MergeRequest
({
var
merge_request
=
new
MergeRequest
({
action
:
"
#{
(
@show_changes_tab
?
'new/diffs'
:
'new'
)
}
"
,
action
:
"
#{
(
@show_changes_tab
?
'new/diffs'
:
'new'
)
}
"
buildsLoaded
:
"
#{
@pipeline
.
present?
?
'true'
:
'false'
}
"
});
});
app/views/projects/merge_requests/_show.html.haml
View file @
dfa842ce
...
@@ -65,11 +65,6 @@
...
@@ -65,11 +65,6 @@
=
link_to
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#pipelines'
,
action:
'pipelines'
,
toggle:
'tab'
}
do
=
link_to
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#pipelines'
,
action:
'pipelines'
,
toggle:
'tab'
}
do
Pipelines
Pipelines
%span
.badge
=
@pipelines
.
size
%span
.badge
=
@pipelines
.
size
-
if
@pipeline
.
present?
%li
.builds-tab
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
%span
.badge
=
@statuses_count
%li
.diffs-tab
%li
.diffs-tab
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
Changes
Changes
...
@@ -98,8 +93,6 @@
...
@@ -98,8 +93,6 @@
#commits
.commits.tab-pane
#commits
.commits.tab-pane
-
# This tab is always loaded via AJAX
-
# This tab is always loaded via AJAX
#builds
.builds.tab-pane
-
# This tab is always loaded via AJAX
#pipelines
.pipelines.tab-pane
#pipelines
.pipelines.tab-pane
-
# This tab is always loaded via AJAX
-
# This tab is always loaded via AJAX
#diffs
.diffs.tab-pane
#diffs
.diffs.tab-pane
...
...
app/views/projects/merge_requests/widget/_show.html.haml
View file @
dfa842ce
...
@@ -24,12 +24,10 @@
...
@@ -24,12 +24,10 @@
preparing
:
"
{{status}} build
"
,
preparing
:
"
{{status}} build
"
,
normal
:
"
Build {{status}}
"
normal
:
"
Build {{status}}
"
},
},
builds_path
:
"
#{
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
pipelines_path
:
"
#{
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
pipelines_path
:
"
#{
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
};
};
if
(
typeof
merge_request_widget
!==
'
undefined
'
)
{
if
(
typeof
merge_request_widget
!==
'
undefined
'
)
{
clearInterval
(
merge_request_widget
.
fetchBuildStatusInterval
);
merge_request_widget
.
cancelPolling
();
merge_request_widget
.
cancelPolling
();
merge_request_widget
.
clearEventListeners
();
merge_request_widget
.
clearEventListeners
();
}
}
...
...
config/routes/project.rb
View file @
dfa842ce
...
@@ -92,7 +92,6 @@ constraints(ProjectUrlConstrainer.new) do
...
@@ -92,7 +92,6 @@ constraints(ProjectUrlConstrainer.new) do
get
:diffs
get
:diffs
get
:conflicts
get
:conflicts
get
:conflict_for_path
get
:conflict_for_path
get
:builds
get
:pipelines
get
:pipelines
get
:merge_check
get
:merge_check
post
:merge
post
:merge
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
dfa842ce
...
@@ -649,10 +649,6 @@ describe Projects::MergeRequestsController do
...
@@ -649,10 +649,6 @@ describe Projects::MergeRequestsController do
end
end
end
end
describe
'GET builds'
do
it_behaves_like
"loads labels"
,
:builds
end
describe
'GET pipelines'
do
describe
'GET pipelines'
do
it_behaves_like
"loads labels"
,
:pipelines
it_behaves_like
"loads labels"
,
:pipelines
end
end
...
...
spec/features/merge_requests/created_from_fork_spec.rb
View file @
dfa842ce
...
@@ -54,14 +54,14 @@ feature 'Merge request created from fork' do
...
@@ -54,14 +54,14 @@ feature 'Merge request created from fork' do
scenario
'user visits a pipelines page'
,
js:
true
do
scenario
'user visits a pipelines page'
,
js:
true
do
visit_merge_request
(
merge_request
)
visit_merge_request
(
merge_request
)
page
.
within
(
'.merge-request-tabs'
)
{
click_link
'
Build
s'
}
page
.
within
(
'.merge-request-tabs'
)
{
click_link
'
Pipeline
s'
}
page
.
within
(
'table.ci-table'
)
do
page
.
within
(
'table.ci-table'
)
do
expect
(
page
).
to
have_content
'rspec'
expect
(
page
).
to
have_content
pipeline
.
status
expect
(
page
).
to
have_content
'spinach'
expect
(
page
).
to
have_content
pipeline
.
id
end
end
expect
(
find_link
(
'Cancel running
'
)[
:href
])
expect
(
page
.
find
(
'a.btn-remove
'
)[
:href
])
.
to
include
fork_project
.
path_with_namespace
.
to
include
fork_project
.
path_with_namespace
end
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