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 {
initIssueBtnEventListeners
()
{
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
return
$
(
'
.js-issuable-buttons[data-action="close-reopen"]
'
).
on
(
'
click
'
,
...
...
app/assets/javascripts/merge_request.js
View file @
3f3160b4
...
...
@@ -66,6 +66,14 @@ MergeRequest.prototype.showAllCommits = function() {
MergeRequest
.
prototype
.
initMRBtnListeners
=
function
()
{
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
)
{
const
$this
=
$
(
this
);
const
shouldSubmit
=
$this
.
hasClass
(
'
btn-comment
'
);
...
...
app/views/shared/issuable/_close_reopen_report_toggle.html.haml
View file @
3f3160b4
...
...
@@ -39,10 +39,8 @@
%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
)),
button_class:
"#{button_class} btn-close-color"
,
toggle_class:
"#{toggle_class} btn-close-color"
,
method:
''
}
}
%button
.btn.btn-transparent
=
icon
(
'check'
,
class:
'icon'
)
%li
.report-item
{
data:
{
text:
_
(
'Report abuse'
),
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
))
}
.description
%strong
.title
=
_
(
'Report abuse'
)
%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 @@
require
'spec_helper'
RSpec
.
describe
'Issuables Close/Reopen/Report toggle'
do
include
IssuablesHelper
let
(
:user
)
{
create
(
:user
)
}
shared_examples
'an issuable 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'
)
end
it
'changes the button when an item is selected'
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'
)
it
'links to Report Abuse'
do
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
...
...
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