BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
796e58e1
Commit
796e58e1
authored
Sep 28, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use relative paths for opening and closing issuables
The abuse reports need a full issuable URL, but linking to issuables should use the relative paths
parent
e03bad12
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
11 deletions
+25
-11
issuables_helper.rb
app/helpers/issuables_helper.rb
+15
-6
_close_reopen_button.html.haml
app/views/shared/issuable/_close_reopen_button.html.haml
+2
-2
_close_reopen_report_toggle.html.haml
...ews/shared/issuable/_close_reopen_report_toggle.html.haml
+3
-3
bvl-fix-close-issuable-link.yml
changelogs/unreleased/bvl-fix-close-issuable-link.yml
+5
-0
No files found.
app/helpers/issuables_helper.rb
View file @
796e58e1
...
...
@@ -248,16 +248,25 @@ module IssuablesHelper
Gitlab
::
IssuablesCountForState
.
new
(
finder
)[
state
]
end
def
close_issuable_
url
(
issuable
)
issuable_
url
(
issuable
,
close_reopen_params
(
issuable
,
:close
))
def
close_issuable_
path
(
issuable
)
issuable_
path
(
issuable
,
close_reopen_params
(
issuable
,
:close
))
end
def
reopen_issuable_
url
(
issuable
)
issuable_
url
(
issuable
,
close_reopen_params
(
issuable
,
:reopen
))
def
reopen_issuable_
path
(
issuable
)
issuable_
path
(
issuable
,
close_reopen_params
(
issuable
,
:reopen
))
end
def
close_reopen_issuable_url
(
issuable
,
should_inverse
=
false
)
issuable
.
closed?
^
should_inverse
?
reopen_issuable_url
(
issuable
)
:
close_issuable_url
(
issuable
)
def
close_reopen_issuable_path
(
issuable
,
should_inverse
=
false
)
issuable
.
closed?
^
should_inverse
?
reopen_issuable_path
(
issuable
)
:
close_issuable_path
(
issuable
)
end
def
issuable_path
(
issuable
,
*
options
)
case
issuable
when
Issue
issue_path
(
issuable
,
*
options
)
when
MergeRequest
merge_request_path
(
issuable
,
*
options
)
end
end
def
issuable_url
(
issuable
,
*
options
)
...
...
app/views/shared/issuable/_close_reopen_button.html.haml
View file @
796e58e1
...
...
@@ -3,9 +3,9 @@
-
button_method
=
issuable_close_reopen_button_method
(
issuable
)
-
if
can_update
&&
is_current_user
=
link_to
"Close
#{
display_issuable_type
}
"
,
close_issuable_
url
(
issuable
),
method:
button_method
,
=
link_to
"Close
#{
display_issuable_type
}
"
,
close_issuable_
path
(
issuable
),
method:
button_method
,
class:
"hidden-xs hidden-sm btn btn-grouped btn-close js-btn-issue-action
#{
issuable_button_visibility
(
issuable
,
true
)
}
"
,
title:
"Close
#{
display_issuable_type
}
"
=
link_to
"Reopen
#{
display_issuable_type
}
"
,
reopen_issuable_
url
(
issuable
),
method:
button_method
,
=
link_to
"Reopen
#{
display_issuable_type
}
"
,
reopen_issuable_
path
(
issuable
),
method:
button_method
,
class:
"hidden-xs hidden-sm btn btn-grouped btn-reopen js-btn-issue-action
#{
issuable_button_visibility
(
issuable
,
false
)
}
"
,
title:
"Reopen
#{
display_issuable_type
}
"
-
elsif
can_update
&&
!
is_current_user
=
render
'shared/issuable/close_reopen_report_toggle'
,
issuable:
issuable
...
...
app/views/shared/issuable/_close_reopen_report_toggle.html.haml
View file @
796e58e1
...
...
@@ -7,7 +7,7 @@
-
button_method
=
issuable_close_reopen_button_method
(
issuable
)
.pull-left.btn-group.prepend-left-10.issuable-close-dropdown.droplab-dropdown.js-issuable-close-dropdown
=
link_to
"
#{
display_button_action
}
#{
display_issuable_type
}
"
,
close_reopen_issuable_
url
(
issuable
),
=
link_to
"
#{
display_button_action
}
#{
display_issuable_type
}
"
,
close_reopen_issuable_
path
(
issuable
),
method:
button_method
,
class:
"
#{
button_class
}
btn-
#{
button_action
}
"
,
title:
"
#{
display_button_action
}
#{
display_issuable_type
}
"
=
button_tag
type:
'button'
,
class:
"
#{
toggle_class
}
btn-
#{
button_action
}
-color"
,
...
...
@@ -16,7 +16,7 @@
%ul
#issuable-close-menu
.js-issuable-close-menu.dropdown-menu
{
class:
button_responsive_class
,
data:
{
dropdown:
true
}
}
%li
.close-item
{
class:
"#{issuable_button_visibility(issuable, true) || 'droplab-item-selected'}"
,
data:
{
text:
"Close #{display_issuable_type}"
,
url:
close_issuable_
url
(
issuable
),
data:
{
text:
"Close #{display_issuable_type}"
,
url:
close_issuable_
path
(
issuable
),
button_class:
"#{button_class} btn-close"
,
toggle_class:
"#{toggle_class} btn-close-color"
,
method:
button_method
}
}
%button
.btn.btn-transparent
=
icon
(
'check'
,
class:
'icon'
)
...
...
@@ -26,7 +26,7 @@
=
display_issuable_type
%li
.reopen-item
{
class:
"#{issuable_button_visibility(issuable, false) || 'droplab-item-selected'}"
,
data:
{
text:
"Reopen #{display_issuable_type}"
,
url:
reopen_issuable_
url
(
issuable
),
data:
{
text:
"Reopen #{display_issuable_type}"
,
url:
reopen_issuable_
path
(
issuable
),
button_class:
"#{button_class} btn-reopen"
,
toggle_class:
"#{toggle_class} btn-reopen-color"
,
method:
button_method
}
}
%button
.btn.btn-transparent
=
icon
(
'check'
,
class:
'icon'
)
...
...
changelogs/unreleased/bvl-fix-close-issuable-link.yml
0 → 100644
View file @
796e58e1
---
title
:
Fix CSRF validation issue when closing/opening merge requests from the UI
merge_request
:
14555
author
:
type
:
fixed
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