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
3f3160b4
Commit
3f3160b4
authored
Sep 01, 2020
by
Scott Stern
Committed by
Andrew Fontaine
Sep 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add stopPropagation and specs to report abuse link
parent
ce721bd7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
15 deletions
+27
-15
app/assets/javascripts/issue.js
app/assets/javascripts/issue.js
+7
-0
app/assets/javascripts/merge_request.js
app/assets/javascripts/merge_request.js
+8
-0
app/views/shared/issuable/_close_reopen_report_toggle.html.haml
...ews/shared/issuable/_close_reopen_report_toggle.html.haml
+2
-4
changelogs/unreleased/ss-fix-report-abuse-button.yml
changelogs/unreleased/ss-fix-report-abuse-button.yml
+5
-0
spec/features/issuables/close_reopen_report_toggle_spec.rb
spec/features/issuables/close_reopen_report_toggle_spec.rb
+5
-11
No files found.
app/assets/javascripts/issue.js
View file @
3f3160b4
...
@@ -100,6 +100,13 @@ export default class Issue {
...
@@ -100,6 +100,13 @@ export default class Issue {
initIssueBtnEventListeners
()
{
initIssueBtnEventListeners
()
{
const
issueFailMessage
=
__
(
'
Unable to update this issue at this time.
'
);
const
issueFailMessage
=
__
(
'
Unable to update this issue at this time.
'
);
$
(
'
.report-abuse-link
'
).
on
(
'
click
'
,
e
=>
{
// this is needed because of the implementation of
// the dropdown toggle and Report Abuse needing to be
// linked to another page.
e
.
stopPropagation
();
});
// NOTE: data attribute seems unnecessary but is actually necessary
// NOTE: data attribute seems unnecessary but is actually necessary
return
$
(
'
.js-issuable-buttons[data-action="close-reopen"]
'
).
on
(
return
$
(
'
.js-issuable-buttons[data-action="close-reopen"]
'
).
on
(
'
click
'
,
'
click
'
,
...
...
app/assets/javascripts/merge_request.js
View file @
3f3160b4
...
@@ -66,6 +66,14 @@ MergeRequest.prototype.showAllCommits = function() {
...
@@ -66,6 +66,14 @@ MergeRequest.prototype.showAllCommits = function() {
MergeRequest
.
prototype
.
initMRBtnListeners
=
function
()
{
MergeRequest
.
prototype
.
initMRBtnListeners
=
function
()
{
const
_this
=
this
;
const
_this
=
this
;
$
(
'
.report-abuse-link
'
).
on
(
'
click
'
,
e
=>
{
// this is needed because of the implementation of
// the dropdown toggle and Report Abuse needing to be
// linked to another page.
e
.
stopPropagation
();
});
return
$
(
'
.btn-close, .btn-reopen
'
).
on
(
'
click
'
,
function
(
e
)
{
return
$
(
'
.btn-close, .btn-reopen
'
).
on
(
'
click
'
,
function
(
e
)
{
const
$this
=
$
(
this
);
const
$this
=
$
(
this
);
const
shouldSubmit
=
$this
.
hasClass
(
'
btn-comment
'
);
const
shouldSubmit
=
$this
.
hasClass
(
'
btn-comment
'
);
...
...
app/views/shared/issuable/_close_reopen_report_toggle.html.haml
View file @
3f3160b4
...
@@ -39,10 +39,8 @@
...
@@ -39,10 +39,8 @@
%li
.divider.droplab-item-ignore
%li
.divider.droplab-item-ignore
%li
.report-item
{
data:
{
text:
_
(
'Report abuse'
),
url:
new_abuse_report_path
(
user_id:
issuable
.
author
.
id
,
ref_url:
issuable_url
(
issuable
)),
%li
.report-item
{
data:
{
text:
_
(
'Report abuse'
),
button_class:
"#{button_class} btn-close-color"
,
toggle_class:
"#{toggle_class} btn-close-color"
,
method:
''
}
}
button_class:
"#{button_class} btn-close-color"
,
toggle_class:
"#{toggle_class} btn-close-color"
,
method:
''
}
}
%a
.report-abuse-link
{
:href
=>
new_abuse_report_path
(
user_id:
issuable
.
author
.
id
,
ref_url:
issuable_url
(
issuable
))
}
%button
.btn.btn-transparent
=
icon
(
'check'
,
class:
'icon'
)
.description
.description
%strong
.title
=
_
(
'Report abuse'
)
%strong
.title
=
_
(
'Report abuse'
)
%p
.text
%p
.text
...
...
changelogs/unreleased/ss-fix-report-abuse-button.yml
0 → 100644
View file @
3f3160b4
---
title
:
Fix report abuse button in issues and mrs
merge_request
:
40918
author
:
type
:
fixed
spec/features/issuables/close_reopen_report_toggle_spec.rb
View file @
3f3160b4
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'Issuables Close/Reopen/Report toggle'
do
RSpec
.
describe
'Issuables Close/Reopen/Report toggle'
do
include
IssuablesHelper
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
shared_examples
'an issuable close/reopen/report toggle'
do
shared_examples
'an issuable close/reopen/report toggle'
do
...
@@ -27,19 +29,11 @@ RSpec.describe 'Issuables Close/Reopen/Report toggle' do
...
@@ -27,19 +29,11 @@ RSpec.describe 'Issuables Close/Reopen/Report toggle' do
expect
(
container
).
not_to
have_selector
(
'.reopen-item'
)
expect
(
container
).
not_to
have_selector
(
'.reopen-item'
)
end
end
it
'changes the button when an item is selected'
do
it
'links to Report Abuse'
do
button
=
container
.
find
(
'.issuable-close-button'
)
container
.
find
(
'.dropdown-toggle'
).
click
container
.
find
(
'.report-item'
).
click
expect
(
container
).
not_to
have_selector
(
'.dropdown-menu'
)
expect
(
button
).
to
have_content
(
'Report abuse'
)
container
.
find
(
'.dropdown-toggle'
).
click
container
.
find
(
'.dropdown-toggle'
).
click
container
.
find
(
'.
close-item
'
).
click
container
.
find
(
'.
report-abuse-link
'
).
click
expect
(
button
).
to
have_content
(
"Close
#{
human_model_name
}
"
)
expect
(
page
).
to
have_content
(
'Report abuse to admin'
)
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