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
1c2554bf
Commit
1c2554bf
authored
Aug 02, 2019
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BitBucketServerImport project filtering
parent
95075fee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
app/controllers/import/bitbucket_server_controller.rb
app/controllers/import/bitbucket_server_controller.rb
+1
-1
app/views/import/bitbucket_server/status.html.haml
app/views/import/bitbucket_server/status.html.haml
+4
-0
lib/bitbucket_server/client.rb
lib/bitbucket_server/client.rb
+2
-1
No files found.
app/controllers/import/bitbucket_server_controller.rb
View file @
1c2554bf
...
...
@@ -57,7 +57,7 @@ class Import::BitbucketServerController < Import::BaseController
# rubocop: disable CodeReuse/ActiveRecord
def
status
@collection
=
bitbucket_client
.
repos
(
page_offset:
page_offset
,
limit:
limit_per_page
)
@collection
=
bitbucket_client
.
repos
(
page_offset:
page_offset
,
limit:
limit_per_page
,
filter:
params
[
:filter_bitbucket_projects
]
)
@repos
,
@incompatible_repos
=
@collection
.
partition
{
|
repo
|
repo
.
valid?
}
# Use the import URL to filter beyond what BaseService#find_already_added_projects
...
...
app/views/import/bitbucket_server/status.html.haml
View file @
1c2554bf
...
...
@@ -20,6 +20,10 @@
.btn-group
=
link_to
(
'Reconfigure'
,
configure_import_bitbucket_server_path
,
class:
'btn btn-primary'
,
method: :post
)
.input-btn-group.float-right
=
form_tag
status_import_bitbucket_server_path
,
:method
=>
'get'
do
=
text_field_tag
:filter_bitbucket_projects
,
params
[
:filter_bitbucket_projects
],
class:
'form-control'
,
placeholder:
_
(
'Filter your projects by name'
),
size:
40
.table-responsive.prepend-top-10
%table
.table.import-jobs
%colgroup
.import-jobs-from-col
...
...
lib/bitbucket_server/client.rb
View file @
1c2554bf
...
...
@@ -23,8 +23,9 @@ module BitbucketServer
BitbucketServer
::
Representation
::
Repo
.
new
(
parsed_response
)
end
def
repos
(
page_offset:
0
,
limit:
nil
)
def
repos
(
page_offset:
0
,
limit:
nil
,
filter:
nil
)
path
=
"/repos"
path
+=
"?q=name=
#{
filter
}
"
if
filter
get_collection
(
path
,
:repo
,
page_offset:
page_offset
,
limit:
limit
)
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