BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c918000b
Commit
c918000b
authored
Mar 30, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3396 from Andrew8xx8/issue-button-fix
New issue button was not follows to external tracker if it is selected. ...
parents
6005ec89
5e6f45b0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
3 deletions
+50
-3
issues_helper.rb
app/helpers/issues_helper.rb
+14
-2
_clone_panel.html.haml
app/views/projects/_clone_panel.html.haml
+1
-1
gitlab.yml.example
config/gitlab.yml.example
+8
-0
issues_helper_spec.rb
spec/helpers/issues_helper_spec.rb
+27
-0
No files found.
app/helpers/issues_helper.rb
View file @
c918000b
...
...
@@ -48,7 +48,19 @@ module IssuesHelper
if
@project
.
used_default_issues_tracker?
project_issues_filter_path
(
@project
)
else
url
=
Settings
[
:issues_tracker
][
@project
.
issues_tracker
][
"project_url"
]
url
=
Gitlab
.
config
.
issues_tracker
[
@project
.
issues_tracker
][
"project_url"
]
url
.
gsub
(
':project_id'
,
@project
.
id
.
to_s
)
.
gsub
(
':issues_tracker_id'
,
@project
.
issues_tracker_id
.
to_s
)
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
=
Gitlab
.
config
.
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
...
...
@@ -60,7 +72,7 @@ module IssuesHelper
if
@project
.
used_default_issues_tracker?
url
=
project_issue_url
project_id:
@project
,
id:
issue_id
else
url
=
Settings
[
:issues_tracker
]
[
@project
.
issues_tracker
][
"issues_url"
]
url
=
Gitlab
.
config
.
issues_tracker
[
@project
.
issues_tracker
][
"issues_url"
]
url
.
gsub
(
':id'
,
issue_id
.
to_s
)
.
gsub
(
':project_id'
,
@project
.
id
.
to_s
)
.
gsub
(
':issues_tracker_id'
,
@project
.
issues_tracker_id
.
to_s
)
...
...
app/views/projects/_clone_panel.html.haml
View file @
c918000b
...
...
@@ -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 @
c918000b
...
...
@@ -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 @
c918000b
...
...
@@ -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