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
7055c284
Commit
7055c284
authored
Mar 14, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `Issue.available_for` to `Issue.visible_to_user`
parent
7d3c46e3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
8 additions
and
8 deletions
+8
-8
app/finders/issues_finder.rb
app/finders/issues_finder.rb
+1
-1
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-1
app/models/issue.rb
app/models/issue.rb
+1
-1
app/services/projects/autocomplete_service.rb
app/services/projects/autocomplete_service.rb
+1
-1
app/views/layouts/nav/_group.html.haml
app/views/layouts/nav/_group.html.haml
+1
-1
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+1
-1
lib/api/issues.rb
lib/api/issues.rb
+1
-1
lib/gitlab/search_results.rb
lib/gitlab/search_results.rb
+1
-1
No files found.
app/finders/issues_finder.rb
View file @
7055c284
...
...
@@ -23,6 +23,6 @@ class IssuesFinder < IssuableFinder
private
def
init_collection
Issue
.
available_fo
r
(
current_user
)
Issue
.
visible_to_use
r
(
current_user
)
end
end
app/helpers/application_helper.rb
View file @
7055c284
...
...
@@ -288,7 +288,7 @@ module ApplicationHelper
if
project
.
nil?
nil
elsif
current_controller?
(
:issues
)
project
.
issues
.
available_fo
r
(
current_user
).
send
(
entity
).
count
project
.
issues
.
visible_to_use
r
(
current_user
).
send
(
entity
).
count
elsif
current_controller?
(
:merge_requests
)
project
.
merge_requests
.
send
(
entity
).
count
end
...
...
app/models/issue.rb
View file @
7055c284
...
...
@@ -64,7 +64,7 @@ class Issue < ActiveRecord::Base
attributes
end
def
self
.
available_fo
r
(
user
)
def
self
.
visible_to_use
r
(
user
)
return
where
(
confidential:
false
)
if
user
.
blank?
return
all
if
user
.
admin?
...
...
app/services/projects/autocomplete_service.rb
View file @
7055c284
module
Projects
class
AutocompleteService
<
BaseService
def
issues
@project
.
issues
.
available_fo
r
(
current_user
).
opened
.
select
([
:iid
,
:title
])
@project
.
issues
.
visible_to_use
r
(
current_user
).
opened
.
select
([
:iid
,
:title
])
end
def
merge_requests
...
...
app/views/layouts/nav/_group.html.haml
View file @
7055c284
...
...
@@ -30,7 +30,7 @@
%span
Issues
-
if
current_user
%span
.count
=
number_with_delimiter
(
Issue
.
opened
.
of_group
(
@group
).
count
)
%span
.count
=
number_with_delimiter
(
Issue
.
visible_to_user
(
current_user
).
opened
.
of_group
(
@group
).
count
)
=
nav_link
(
path:
'groups#merge_requests'
)
do
=
link_to
merge_requests_group_path
(
@group
),
title:
'Merge Requests'
do
=
icon
(
'tasks fw'
)
...
...
app/views/layouts/nav/_project.html.haml
View file @
7055c284
...
...
@@ -67,7 +67,7 @@
%span
Issues
-
if
@project
.
default_issues_tracker?
%span
.count.issue_counter
=
number_with_delimiter
(
@project
.
issues
.
available_fo
r
(
current_user
).
opened
.
count
)
%span
.count.issue_counter
=
number_with_delimiter
(
@project
.
issues
.
visible_to_use
r
(
current_user
).
opened
.
count
)
-
if
project_nav_tab?
:merge_requests
=
nav_link
(
controller: :merge_requests
)
do
...
...
lib/api/issues.rb
View file @
7055c284
...
...
@@ -82,7 +82,7 @@ module API
# GET /projects/:id/issues?milestone=1.0.0&state=closed
# GET /issues?iid=42
get
":id/issues"
do
issues
=
user_project
.
issues
.
available_fo
r
(
current_user
)
issues
=
user_project
.
issues
.
visible_to_use
r
(
current_user
)
issues
=
filter_issues_state
(
issues
,
params
[
:state
])
unless
params
[
:state
].
nil?
issues
=
filter_issues_labels
(
issues
,
params
[
:labels
])
unless
params
[
:labels
].
nil?
issues
=
filter_by_iid
(
issues
,
params
[
:iid
])
unless
params
[
:iid
].
nil?
...
...
lib/gitlab/search_results.rb
View file @
7055c284
...
...
@@ -59,7 +59,7 @@ module Gitlab
end
def
issues
issues
=
Issue
.
available_fo
r
(
user
).
where
(
project_id:
project_ids_relation
)
issues
=
Issue
.
visible_to_use
r
(
user
).
where
(
project_id:
project_ids_relation
)
if
query
=~
/#(\d+)\z/
issues
=
issues
.
where
(
iid:
$1
)
...
...
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