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
531fc3a1
Commit
531fc3a1
authored
Jun 09, 2020
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for proper redirects and filtering
parent
e3bd1af7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
app/controllers/import/base_controller.rb
app/controllers/import/base_controller.rb
+4
-0
app/controllers/import/bitbucket_server_controller.rb
app/controllers/import/bitbucket_server_controller.rb
+9
-3
config/routes/import.rb
config/routes/import.rb
+1
-0
No files found.
app/controllers/import/base_controller.rb
View file @
531fc3a1
...
@@ -43,6 +43,10 @@ class Import::BaseController < ApplicationController
...
@@ -43,6 +43,10 @@ class Import::BaseController < ApplicationController
private
private
def
filter_attribute
:name
end
def
sanitized_filter_param
def
sanitized_filter_param
@filter
||=
sanitize
(
params
[
:filter
])
@filter
||=
sanitize
(
params
[
:filter
])
end
end
...
...
app/controllers/import/bitbucket_server_controller.rb
View file @
531fc3a1
...
@@ -193,13 +193,19 @@ class Import::BitbucketServerController < Import::BaseController
...
@@ -193,13 +193,19 @@ class Import::BitbucketServerController < Import::BaseController
end
end
def
bitbucket_connection_error
(
error
)
def
bitbucket_connection_error
(
error
)
flash
[
:alert
]
=
_
(
"Unable to connect to server: %{error}"
)
%
{
error:
error
}
clear_session_data
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
json
do
format
.
json
do
render
json:
{
error:
_
(
"Unable to connect to server: %{error}"
)
%
{
error:
error
}
},
status: :unprocessable_entity
render
json:
{
error:
{
message:
_
(
"Unable to connect to server: %{error}"
)
%
{
error:
error
},
redirect:
new_import_bitbucket_server_path
}
},
status: :unprocessable_entity
end
end
format
.
html
do
format
.
html
do
flash
[
:alert
]
=
_
(
"Unable to connect to server: %{error}"
)
%
{
error:
error
}
clear_session_data
redirect_to
new_import_bitbucket_server_path
redirect_to
new_import_bitbucket_server_path
end
end
end
end
...
...
config/routes/import.rb
View file @
531fc3a1
...
@@ -25,6 +25,7 @@ namespace :import do
...
@@ -25,6 +25,7 @@ namespace :import do
get
:status
get
:status
get
:callback
get
:callback
get
:jobs
get
:jobs
get
:realtime_changes
end
end
resource
:bitbucket
,
only:
[
:create
],
controller: :bitbucket
do
resource
:bitbucket
,
only:
[
:create
],
controller: :bitbucket
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