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
242f6aa2
Commit
242f6aa2
authored
Mar 26, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New issue button was not follows to external tracker if it is selected. fixed #3386
parent
90db28d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
1 deletion
+48
-1
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+12
-0
app/views/projects/_clone_panel.html.haml
app/views/projects/_clone_panel.html.haml
+1
-1
config/gitlab.yml.example
config/gitlab.yml.example
+8
-0
spec/helpers/issues_helper_spec.rb
spec/helpers/issues_helper_spec.rb
+27
-0
No files found.
app/helpers/issues_helper.rb
View file @
242f6aa2
...
...
@@ -54,6 +54,18 @@ module IssuesHelper
end
end
def
url_for_new_issue
return
""
if
@project
.
nil?
if
@project
.
used_default_issues_tracker?
url
=
new_project_issue_path
project_id:
@project
else
url
=
Settings
[
:issues_tracker
][
@project
.
issues_tracker
][
"new_issue_url"
]
url
.
gsub
(
':project_id'
,
@project
.
id
.
to_s
)
.
gsub
(
':issues_tracker_id'
,
@project
.
issues_tracker_id
.
to_s
)
end
end
def
url_for_issue
(
issue_id
)
return
""
if
@project
.
nil?
...
...
app/views/projects/_clone_panel.html.haml
View file @
242f6aa2
...
...
@@ -13,5 +13,5 @@
=
link_to
new_project_merge_request_path
(
@project
),
title:
"New Merge Request"
,
class:
"btn-small btn grouped"
do
Merge Request
-
if
@project
.
issues_enabled
&&
can?
(
current_user
,
:write_issue
,
@project
)
=
link_to
new_project_issue_path
(
@project
)
,
title:
"New Issue"
,
class:
"btn-small btn grouped"
do
=
link_to
url_for_new_issue
,
title:
"New Issue"
,
class:
"btn-small btn grouped"
do
Issue
config/gitlab.yml.example
View file @
242f6aa2
...
...
@@ -46,12 +46,19 @@ production: &base
# ## :project_id - GitLab project identifier
# ## :issues_tracker_id - Project Name or Id in external issue tracker
# project_url: "http://redmine.sample/projects/:issues_tracker_id"
#
# ## If not nil, links from /#\d/ entities from commit messages will replaced with this
# ## Use placeholders:
# ## :project_id - GitLab project identifier
# ## :issues_tracker_id - Project Name or Id in external issue tracker
# ## :id - Issue id (from commit messages)
# issues_url: "http://redmine.sample/issues/:id"
#
# ## If not nil, linkis to creating new issues will be replaced with this
# ## Use placeholders:
# ## :project_id - GitLab project identifier
# ## :issues_tracker_id - Project Name or Id in external issue tracker
# new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new"
## Gravatar
gravatar:
...
...
@@ -152,6 +159,7 @@ test:
redmine:
project_url: "http://redmine/projects/:issues_tracker_id"
issues_url: "http://redmine/:project_id/:issues_tracker_id/:id"
new_issue_url: "http://redmine/projects/:issues_tracker_id/insues/new"
staging:
<<: *base
spec/helpers/issues_helper_spec.rb
View file @
242f6aa2
...
...
@@ -76,4 +76,31 @@ describe IssuesHelper do
url_for_issue
(
issue
.
id
).
should
eq
""
end
end
describe
:url_for_new_issue
do
let
(
:issues_url
)
{
Gitlab
.
config
.
issues_tracker
.
redmine
.
new_issue_url
}
let
(
:ext_expected
)
do
issues_url
.
gsub
(
':project_id'
,
ext_project
.
id
.
to_s
)
.
gsub
(
':issues_tracker_id'
,
ext_project
.
issues_tracker_id
.
to_s
)
end
let
(
:int_expected
)
{
new_project_issue_path
(
project
)
}
it
"should return internal path if used internal tracker"
do
@project
=
project
url_for_new_issue
.
should
match
(
int_expected
)
end
it
"should return path to external tracker"
do
@project
=
ext_project
url_for_new_issue
.
should
match
(
ext_expected
)
end
it
"should return empty string if project nil"
do
@project
=
nil
url_for_new_issue
.
should
eq
""
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