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
b8e27cb0
Commit
b8e27cb0
authored
Jun 24, 2020
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stirpped down copy of IssuesController
that queries normal issues for now
parent
414308a7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
127 additions
and
0 deletions
+127
-0
ee/app/controllers/projects/integrations/jira/issues_controller.rb
...ntrollers/projects/integrations/jira/issues_controller.rb
+28
-0
ee/app/views/projects/integrations/jira/issues/index.html.haml
...p/views/projects/integrations/jira/issues/index.html.haml
+6
-0
ee/config/routes/project.rb
ee/config/routes/project.rb
+6
-0
ee/spec/controllers/projects/integrations/jira/issues_controller_spec.rb
...lers/projects/integrations/jira/issues_controller_spec.rb
+78
-0
ee/spec/routing/project_routing_spec.rb
ee/spec/routing/project_routing_spec.rb
+6
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/controllers/projects/integrations/jira/issues_controller.rb
0 → 100644
View file @
b8e27cb0
# frozen_string_literal: true
module
Projects
module
Integrations
module
Jira
class
IssuesController
<
Projects
::
ApplicationController
include
RecordUserLastActivity
before_action
:check_feature_enabled!
before_action
:check_issues_available!
before_action
do
push_frontend_feature_flag
(
:jira_integration
,
project
)
push_frontend_feature_flag
(
:vue_issuables_list
,
project
)
end
def
index
end
protected
def
check_feature_enabled!
return
render_404
unless
Feature
.
enabled?
(
:jira_integration
,
project
)
end
end
end
end
end
ee/app/views/projects/integrations/jira/issues/index.html.haml
0 → 100644
View file @
b8e27cb0
-
page_title
_
(
'Jira Issues'
)
.js-issuables-list
{
data:
{
endpoint:
expose_url
(
api_v4_groups_issues_path
(
id:
@project
.
group
.
id
)),
'can-bulk-edit'
:
false
,
'empty-svg-path'
:
image_path
(
'illustrations/issues.svg'
),
'sort-key'
:
@sort
}
}
ee/config/routes/project.rb
View file @
b8e27cb0
...
...
@@ -100,6 +100,12 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources
:dependencies
,
only:
[
:index
]
resources
:licenses
,
only:
[
:index
,
:create
,
:update
]
resources
:on_demand_scans
,
only:
[
:index
],
controller: :on_demand_scans
namespace
:integrations
do
namespace
:jira
do
resources
:issues
,
only:
[
:index
]
end
end
end
# End of the /-/ scope.
...
...
ee/spec/controllers/projects/integrations/jira/issues_controller_spec.rb
0 → 100644
View file @
b8e27cb0
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Projects
::
Integrations
::
Jira
::
IssuesController
do
include
ProjectForksHelper
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
'GET #index'
do
context
'external issue tracker'
do
before
do
sign_in
(
user
)
project
.
add_developer
(
user
)
create
(
:jira_service
,
project:
project
)
end
context
'when jira_integration feature disabled'
do
it
'returns 404 status'
do
stub_feature_flags
(
jira_integration:
false
)
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'when GitLab issues disabled'
do
it
'returns 404 status'
do
project
.
issues_enabled
=
false
project
.
save!
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'when GitLab issues enabled'
do
it
'renders the "index" template'
do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
:index
)
end
end
context
'when project has moved'
do
let
(
:new_project
)
{
create
(
:project
)
}
before
do
project
.
route
.
destroy!
new_project
.
redirect_routes
.
create!
(
path:
project
.
full_path
)
new_project
.
add_developer
(
user
)
end
it
'redirects to the new issue tracker from the old one'
do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
expect
(
response
).
to
redirect_to
(
project_integrations_jira_issues_path
(
new_project
))
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
end
end
end
context
'external authorization'
do
before
do
sign_in
user
project
.
add_developer
(
user
)
end
it_behaves_like
'unauthorized when external service denies access'
do
subject
{
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
end
end
end
end
ee/spec/routing/project_routing_spec.rb
View file @
b8e27cb0
...
...
@@ -58,4 +58,10 @@ RSpec.describe 'EE-specific project routing' do
it_behaves_like
'redirecting a legacy project path'
,
"/gitlab/gitlabhq/audit_events"
,
"/gitlab/gitlabhq/-/audit_events"
end
end
describe
Projects
::
Integrations
::
Jira
::
IssuesController
,
'routing'
,
type: :routing
do
it
"to #index"
do
expect
(
get
(
"/gitlab/gitlabhq/-/integrations/jira/issues"
)).
to
route_to
(
'projects/integrations/jira/issues#index'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
)
end
end
end
locale/gitlab.pot
View file @
b8e27cb0
...
...
@@ -12716,6 +12716,9 @@ msgstr ""
msgid "January"
msgstr ""
msgid "Jira Issues"
msgstr ""
msgid "Jira import is already running."
msgstr ""
...
...
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