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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
84a7675e
Commit
84a7675e
authored
Apr 30, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove title_for_issue helper
parent
242bebc1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
35 deletions
+6
-35
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+1
-12
app/models/external_issue.rb
app/models/external_issue.rb
+4
-0
lib/gitlab/markdown/issue_reference_filter.rb
lib/gitlab/markdown/issue_reference_filter.rb
+1
-5
spec/helpers/issues_helper_spec.rb
spec/helpers/issues_helper_spec.rb
+0
-18
No files found.
app/helpers/issues_helper.rb
View file @
84a7675e
...
...
@@ -43,17 +43,6 @@ module IssuesHelper
end
end
def
title_for_issue
(
issue_iid
,
project
=
@project
)
return
''
if
project
.
nil?
if
project
.
default_issues_tracker?
issue
=
project
.
issues
.
where
(
iid:
issue_iid
).
first
return
issue
.
title
if
issue
end
''
end
def
issue_timestamp
(
issue
)
# Shows the created at time and the updated at time if different
ts
=
"
#{
time_ago_with_tooltip
(
issue
.
created_at
,
'bottom'
,
'note_created_ago'
)
}
"
...
...
@@ -110,5 +99,5 @@ module IssuesHelper
end
# Required for Gitlab::Markdown::IssueReferenceFilter
module_function
:url_for_issue
,
:title_for_issue
module_function
:url_for_issue
end
app/models/external_issue.rb
View file @
84a7675e
...
...
@@ -15,6 +15,10 @@ class ExternalIssue
@issue_identifier
.
to_s
end
def
title
"External Issue
#{
self
}
"
end
def
==
(
other
)
other
.
is_a?
(
self
.
class
)
&&
(
to_s
==
other
.
to_s
)
end
...
...
lib/gitlab/markdown/issue_reference_filter.rb
View file @
84a7675e
...
...
@@ -52,7 +52,7 @@ module Gitlab
url
=
url_for_issue
(
id
,
project
,
only_path:
context
[
:only_path
])
title
=
escape_once
(
"Issue:
#{
title_for_issue
(
id
,
project
)
}
"
)
title
=
escape_once
(
"Issue:
#{
issue
.
title
}
"
)
klass
=
reference_class
(
:issue
)
%(<a href="#{url}"
...
...
@@ -67,10 +67,6 @@ module Gitlab
def
url_for_issue
(
*
args
)
IssuesHelper
.
url_for_issue
(
*
args
)
end
def
title_for_issue
(
*
args
)
IssuesHelper
.
title_for_issue
(
*
args
)
end
end
end
end
spec/helpers/issues_helper_spec.rb
View file @
84a7675e
...
...
@@ -5,24 +5,6 @@ describe IssuesHelper do
let
(
:issue
)
{
create
:issue
,
project:
project
}
let
(
:ext_project
)
{
create
:redmine_project
}
describe
"title_for_issue"
do
it
"should return issue title if used internal tracker"
do
@project
=
project
expect
(
title_for_issue
(
issue
.
iid
)).
to
eq
issue
.
title
end
it
"should always return empty string if used external tracker"
do
@project
=
ext_project
expect
(
title_for_issue
(
rand
(
100
))).
to
eq
""
end
it
"should always return empty string if project nil"
do
@project
=
nil
expect
(
title_for_issue
(
rand
(
100
))).
to
eq
""
end
end
describe
"url_for_project_issues"
do
let
(
:project_url
)
{
ext_project
.
external_issue_tracker
.
project_url
}
let
(
:ext_expected
)
do
...
...
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