Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
7095c803
Unverified
Commit
7095c803
authored
3 years ago
by
Eugen Rochko
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add ability to filter reports by origin of target account (#16487)
parent
ca8ac1a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/models/report_filter.rb
+14
-0
14 additions, 0 deletions
app/models/report_filter.rb
app/views/admin/reports/index.html.haml
+6
-0
6 additions, 0 deletions
app/views/admin/reports/index.html.haml
config/locales/en.yml
+1
-0
1 addition, 0 deletions
config/locales/en.yml
with
21 additions
and
0 deletions
app/models/report_filter.rb
+
14
−
0
View file @
7095c803
...
...
@@ -6,6 +6,7 @@ class ReportFilter
account_id
target_account_id
by_target_domain
target_origin
)
.
freeze
attr_reader
:params
...
...
@@ -34,8 +35,21 @@ class ReportFilter
Report
.
where
(
account_id:
value
)
when
:target_account_id
Report
.
where
(
target_account_id:
value
)
when
:target_origin
target_origin_scope
(
value
)
else
raise
"Unknown filter:
#{
key
}
"
end
end
def
target_origin_scope
(
value
)
case
value
.
to_sym
when
:local
Report
.
where
(
target_account:
Account
.
local
)
when
:remote
Report
.
where
(
target_account:
Account
.
remote
)
else
raise
"Unknown value:
#{
value
}
"
end
end
end
This diff is collapsed.
Click to expand it.
app/views/admin/reports/index.html.haml
+
6
−
0
View file @
7095c803
...
...
@@ -7,6 +7,12 @@
%ul
%li
=
filter_link_to
t
(
'admin.reports.unresolved'
),
resolved:
nil
%li
=
filter_link_to
t
(
'admin.reports.resolved'
),
resolved:
'1'
.filter-subset
%strong
=
t
(
'admin.reports.target_origin'
)
%ul
%li
=
filter_link_to
t
(
'admin.accounts.location.all'
),
target_origin:
nil
%li
=
filter_link_to
t
(
'admin.accounts.location.local'
),
target_origin:
'local'
%li
=
filter_link_to
t
(
'admin.accounts.location.remote'
),
target_origin:
'remote'
=
form_tag
admin_reports_url
,
method:
'GET'
,
class:
'simple_form'
do
.fields-group
...
...
This diff is collapsed.
Click to expand it.
config/locales/en.yml
+
1
−
0
View file @
7095c803
...
...
@@ -579,6 +579,7 @@ en:
resolved
:
Resolved
resolved_msg
:
Report successfully resolved!
status
:
Status
target_origin
:
Origin of reported account
title
:
Reports
unassign
:
Unassign
unresolved
:
Unresolved
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment