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
63363e47
Commit
63363e47
authored
Jan 12, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reverting more MR ajax files, will appear in different commit
parent
e6f34237
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
124 deletions
+31
-124
app/views/projects/merge_requests/widget/_open.html.haml
app/views/projects/merge_requests/widget/_open.html.haml
+20
-19
app/views/projects/merge_requests/widget/_show.html.haml
app/views/projects/merge_requests/widget/_show.html.haml
+9
-5
app/views/projects/merge_requests/widget/open/_archived.html.haml
...s/projects/merge_requests/widget/open/_archived.html.haml
+1
-1
spec/javascripts/fixtures/merge_requests_show.html.haml
spec/javascripts/fixtures/merge_requests_show.html.haml
+1
-11
spec/javascripts/merge_request_spec.js.coffee
spec/javascripts/merge_request_spec.js.coffee
+0
-88
No files found.
app/views/projects/merge_requests/widget/_open.html.haml
View file @
63363e47
.mr-state-widget
.mr-state-widget-opened
{
class:
merge_request_widget_visibility
(
@merge_request
,
"opened"
,
"reopened"
)}
.mr-state-widget
=
render
'projects/merge_requests/widget/heading'
=
render
'projects/merge_requests/widget/heading'
.mr-widget-body.merge-request-archived
{
class:
(
"hidden"
unless
@project
.
archived?
)}
.mr-widget-body
=
render
'projects/merge_requests/widget/open/archived'
-
if
@project
.
archived?
.mr-widget-body.merge-request-blank
{
class:
(
"hidden"
unless
@merge_request
.
commits
.
blank?
)}
=
render
'projects/merge_requests/widget/open/archived'
=
render
'projects/merge_requests/widget/open/nothing'
-
elsif
@merge_request
.
commits
.
blank?
.mr-widget-body.merge-request-branch-missing
{
class:
(
"hidden"
unless
@merge_request
.
branch_missing?
)}
=
render
'projects/merge_requests/widget/open/nothing'
=
render
'projects/merge_requests/widget/open/missing_branch'
-
elsif
@merge_request
.
branch_missing?
.mr-widget-body.merge-request-unchecked
{
class:
(
"hidden"
unless
@merge_request
.
unchecked?
)}
=
render
'projects/merge_requests/widget/open/missing_branch'
=
render
'projects/merge_requests/widget/open/check'
-
elsif
@merge_request
.
unchecked?
.mr-widget-body.merge-request-cannot-be-merged
{
class:
(
"hidden"
unless
@merge_request
.
cannot_be_merged?
)}
=
render
'projects/merge_requests/widget/open/check'
=
render
'projects/merge_requests/widget/open/conflicts'
-
elsif
@merge_request
.
cannot_be_merged?
.mr-widget-body.merge-request-work-in-progress
{
class:
(
"hidden"
unless
@merge_request
.
work_in_progress?
)}
=
render
'projects/merge_requests/widget/open/conflicts'
=
render
'projects/merge_requests/widget/open/wip'
-
elsif
@merge_request
.
work_in_progress?
.mr-widget-body.merge-request-merge-when-build-succeeds
{
class:
(
"hidden"
unless
@merge_request
.
merge_when_build_succeeds?
)}
=
render
'projects/merge_requests/widget/open/wip'
=
render
'projects/merge_requests/widget/open/merge_when_build_succeeds'
-
elsif
@merge_request
.
merge_when_build_succeeds?
.mr-widget-body.not-allowed
{
class:
(
"hidden"
if
@merge_request
.
can_be_merged_by?
(
current_user
))}
=
render
'projects/merge_requests/widget/open/merge_when_build_succeeds'
=
render
'projects/merge_requests/widget/open/not_allowed'
-
elsif
!
@merge_request
.
can_be_merged_by?
(
current_user
)
.mr-widget-body.merge-request-archived.can-be-merged
{
class:
(
"hidden"
unless
@merge_request
.
can_be_merged?
)}
=
render
'projects/merge_requests/widget/open/not_allowed'
=
render
'projects/merge_requests/widget/open/accept'
-
elsif
@merge_request
.
can_be_merged?
=
render
'projects/merge_requests/widget/open/accept'
-
if
@closes_issues
.
present?
-
if
@closes_issues
.
present?
.mr-widget-footer
.mr-widget-footer
...
...
app/views/projects/merge_requests/widget/_show.html.haml
View file @
63363e47
=
render
'projects/merge_requests/widget/open'
-
if
@merge_request
.
open?
=
render
'projects/merge_requests/widget/merged'
=
render
'projects/merge_requests/widget/open'
=
render
'projects/merge_requests/widget/closed'
-
elsif
@merge_request
.
merged?
=
render
'projects/merge_requests/widget/locked'
=
render
'projects/merge_requests/widget/merged'
-
elsif
@merge_request
.
closed?
=
render
'projects/merge_requests/widget/closed'
-
elsif
@merge_request
.
locked?
=
render
'projects/merge_requests/widget/locked'
:javascript
:javascript
var
merge_request_widget
;
var
merge_request_widget
;
merge_request_widget
=
new
MergeRequestWidget
({
merge_request_widget
=
new
MergeRequestWidget
({
url_to_automerge_check
:
"
#{
merge_check_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
format: :json
)
}
"
,
url_to_automerge_check
:
"
#{
merge_check_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
check_enable
:
#{
@merge_request
.
unchecked?
?
"true"
:
"false"
}
,
check_enable
:
#{
@merge_request
.
unchecked?
?
"true"
:
"false"
}
,
url_to_ci_check
:
"
#{
ci_status_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
url_to_ci_check
:
"
#{
ci_status_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
ci_enable
:
#{
@project
.
ci_service
?
"true"
:
"false"
}
,
ci_enable
:
#{
@project
.
ci_service
?
"true"
:
"false"
}
,
...
...
app/views/projects/merge_requests/widget/open/_archived.html.haml
View file @
63363e47
%h4
%h4
Project is archived
Project is archived
%p
%p
This merge request cannot be merged because archived projects cannot be written to.
This merge request cannot be merged because archived projects cannot be written to.
spec/javascripts/fixtures/merge_requests_show.html.haml
View file @
63363e47
:css
%a
.btn-close
.hidden
{
display
:
none
!important
}
.flash-container
.flash-alert
.flash-notice
.status-box.status-box-open
Open
.status-box.status-box-closed.hidden
Closed
%a
.btn-close
{
"href"
=>
"http://gitlab.com/merge_requests/6/close"
}
Close
%a
.btn-reopen.hidden
{
"href"
=>
"http://gitlab.com/merge_requests/6/reopen"
}
Reopen
.detail-page-description
.detail-page-description
.description.js-task-list-container
.description.js-task-list-container
...
...
spec/javascripts/merge_request_spec.js.coffee
View file @
63363e47
...
@@ -21,91 +21,3 @@ describe 'MergeRequest', ->
...
@@ -21,91 +21,3 @@ describe 'MergeRequest', ->
expect
(
req
.
data
.
merge_request
.
description
).
not
.
toBe
(
null
)
expect
(
req
.
data
.
merge_request
.
description
).
not
.
toBe
(
null
)
$
(
'.js-task-list-field'
).
trigger
(
'tasklist:changed'
)
$
(
'.js-task-list-field'
).
trigger
(
'tasklist:changed'
)
describe
'reopen/close merge request'
,
->
fixture
.
preload
(
'merge_requests_show.html'
)
beforeEach
->
fixture
.
load
(
'merge_requests_show.html'
)
@
merge_request
=
new
MergeRequest
({})
it
'closes a merge request'
,
->
$
.
ajax
=
(
obj
)
->
expect
(
obj
.
type
).
toBe
(
'PUT'
)
expect
(
obj
.
url
).
toBe
(
'http://gitlab.com/merge_requests/6/close'
)
obj
.
success
saved
:
true
$btnClose
=
$
(
'a.btn-close'
)
$btnReopen
=
$
(
'a.btn-reopen'
)
expect
(
$btnReopen
).
toBeHidden
()
expect
(
$btnClose
.
text
()).
toBe
(
'Close'
)
expect
(
typeof
$btnClose
.
prop
(
'disabled'
)).
toBe
(
'undefined'
)
$btnClose
.
trigger
(
'click'
)
expect
(
$btnReopen
).
toBeVisible
()
expect
(
$btnClose
).
toBeHidden
()
expect
(
$
(
'div.status-box-closed'
)).
toBeVisible
()
expect
(
$
(
'div.status-box-open'
)).
toBeHidden
()
it
'fails to close a merge request with success:false'
,
->
$
.
ajax
=
(
obj
)
->
expect
(
obj
.
type
).
toBe
(
'PUT'
)
expect
(
obj
.
url
).
toBe
(
'http://goesnowhere.nothing/whereami'
)
obj
.
success
saved
:
false
$btnClose
=
$
(
'a.btn-close'
)
$btnReopen
=
$
(
'a.btn-reopen'
)
$btnClose
.
attr
(
'href'
,
'http://goesnowhere.nothing/whereami'
)
expect
(
$btnReopen
).
toBeHidden
()
expect
(
$btnClose
.
text
()).
toBe
(
'Close'
)
expect
(
typeof
$btnClose
.
prop
(
'disabled'
)).
toBe
(
'undefined'
)
$btnClose
.
trigger
(
'click'
)
expect
(
$btnReopen
).
toBeHidden
()
expect
(
$btnClose
).
toBeVisible
()
expect
(
$
(
'div.status-box-closed'
)).
toBeHidden
()
expect
(
$
(
'div.status-box-open'
)).
toBeVisible
()
expect
(
$
(
'div.flash-alert'
)).
toBeVisible
()
expect
(
$
(
'div.flash-alert'
).
text
()).
toBe
(
'Unable to update this merge request at this time.'
)
it
'fails to closes an issue with HTTP error'
,
->
$
.
ajax
=
(
obj
)
->
expect
(
obj
.
type
).
toBe
(
'PUT'
)
expect
(
obj
.
url
).
toBe
(
'http://goesnowhere.nothing/whereami'
)
obj
.
error
()
$btnClose
=
$
(
'a.btn-close'
)
$btnReopen
=
$
(
'a.btn-reopen'
)
$btnClose
.
attr
(
'href'
,
'http://goesnowhere.nothing/whereami'
)
expect
(
$btnReopen
).
toBeHidden
()
expect
(
$btnClose
.
text
()).
toBe
(
'Close'
)
expect
(
typeof
$btnClose
.
prop
(
'disabled'
)).
toBe
(
'undefined'
)
$btnClose
.
trigger
(
'click'
)
expect
(
$btnReopen
).
toBeHidden
()
expect
(
$btnClose
).
toBeVisible
()
expect
(
$
(
'div.status-box-closed'
)).
toBeHidden
()
expect
(
$
(
'div.status-box-open'
)).
toBeVisible
()
expect
(
$
(
'div.flash-alert'
)).
toBeVisible
()
expect
(
$
(
'div.flash-alert'
).
text
()).
toBe
(
'Unable to update this merge request at this time.'
)
it
'reopens a merge request'
,
->
$
.
ajax
=
(
obj
)
->
expect
(
obj
.
type
).
toBe
(
'PUT'
)
expect
(
obj
.
url
).
toBe
(
'http://gitlab.com/merge_requests/6/reopen'
)
obj
.
success
saved
:
true
$btnClose
=
$
(
'a.btn-close'
)
$btnReopen
=
$
(
'a.btn-reopen'
)
expect
(
$btnReopen
.
text
()).
toBe
(
'Reopen'
)
$btnReopen
.
trigger
(
'click'
)
expect
(
$btnReopen
).
toBeHidden
()
expect
(
$btnClose
).
toBeVisible
()
expect
(
$
(
'div.status-box-open'
)).
toBeVisible
()
expect
(
$
(
'div.status-box-closed'
)).
toBeHidden
()
\ No newline at end of file
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