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
Boxiang Sun
gitlab-ce
Commits
3735ce43
Commit
3735ce43
authored
Jul 01, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a Reconfigure button and improve layout of import screen
parent
6b698a93
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
19 deletions
+31
-19
app/controllers/import/bitbucket_server_controller.rb
app/controllers/import/bitbucket_server_controller.rb
+2
-3
app/views/import/bitbucket_server/new.html.haml
app/views/import/bitbucket_server/new.html.haml
+14
-7
app/views/import/bitbucket_server/status.html.haml
app/views/import/bitbucket_server/status.html.haml
+10
-8
lib/bitbucket_server/connection.rb
lib/bitbucket_server/connection.rb
+1
-1
lib/bitbucket_server/representation/pull_request.rb
lib/bitbucket_server/representation/pull_request.rb
+4
-0
No files found.
app/controllers/import/bitbucket_server_controller.rb
View file @
3735ce43
...
...
@@ -14,8 +14,7 @@ class Import::BitbucketServerController < Import::BaseController
repo
=
bitbucket_client
.
repo
(
project_slug
,
repo_slug
)
project_name
=
params
[
:new_name
].
presence
||
repo
.
name
repo_owner
=
repo
.
owner
repo_owner
=
current_user
.
username
if
repo_owner
==
bitbucket_client
.
user
.
username
repo_owner
=
current_user
.
username
namespace_path
=
params
[
:new_namespace
].
presence
||
repo_owner
target_namespace
=
find_or_create_namespace
(
namespace_path
,
current_user
)
...
...
@@ -85,7 +84,7 @@ class Import::BitbucketServerController < Import::BaseController
def
credentials
{
base_uri:
session
[
bitbucket_server_url_key
],
user
name
:
session
[
bitbucket_server_username_key
],
user:
session
[
bitbucket_server_username_key
],
password:
session
[
personal_access_token_key
]
}
end
...
...
app/views/import/bitbucket_server/new.html.haml
View file @
3735ce43
...
...
@@ -9,11 +9,18 @@
%p
=
_
(
'Enter in your Bitbucket Server URL and personal access token below'
)
=
form_tag
configure_import_bitbucket_server_path
,
method: :post
,
class:
'form-inline'
do
.form-group
=
text_field_tag
:bitbucket_server_url
,
''
,
class:
'form-control append-right-8'
,
placeholder:
_
(
'https://bitbucket-server'
),
size:
40
=
text_field_tag
:bitbucket_username
,
''
,
class:
'form-control append-right-8'
,
placeholder:
_
(
'username'
),
size:
40
=
text_field_tag
:personal_access_token
,
''
,
class:
'form-control append-right-8'
,
placeholder:
_
(
'Personal Access Token'
),
size:
40
=
form_tag
configure_import_bitbucket_server_path
,
method: :post
do
.form-group.row
=
label_tag
:bitbucket_server_url
,
'Bitbucket Server URL'
,
class:
'col-form-label col-md-2'
.col-md-4
=
text_field_tag
:bitbucket_server_url
,
''
,
class:
'form-control append-right-8'
,
placeholder:
_
(
'https://bitbucket-server'
),
size:
40
.form-group.row
=
label_tag
:bitbucket_server_url
,
'Username'
,
class:
'col-form-label col-md-2'
.col-md-4
=
text_field_tag
:bitbucket_username
,
''
,
class:
'form-control append-right-8'
,
placeholder:
_
(
'username'
),
size:
40
.form-group.row
=
label_tag
:personal_access_token
,
'Password/Personal Access Token'
,
class:
'col-form-label col-md-2'
.col-md-4
=
text_field_tag
:personal_access_token
,
''
,
class:
'form-control append-right-8'
,
placeholder:
_
(
'Personal Access Token'
),
size:
40
.form-actions
=
submit_tag
_
(
'List your Bitbucket Server repositories'
),
class:
'btn btn-success'
app/views/import/bitbucket_server/status.html.haml
View file @
3735ce43
...
...
@@ -4,20 +4,22 @@
%h3
.page-title
%i
.fa.fa-bitbucket
Import projects from Bitbucket Server
=
link_to
(
'Reconfigure'
,
configure_import_bitbucket_server_path
,
class:
'btn btn-primary float-right'
,
method: :post
)
-
if
@repos
.
any?
%p
.light
Select projects you want to import.
%hr
%p
-
if
@incompatible_repos
.
any?
=
button_tag
class:
'btn btn-import btn-success js-import-all'
do
Import all compatible projects
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
-
else
=
button_tag
class:
'btn btn-import btn-success js-import-all'
do
Import all projects
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
-
if
@incompatible_repos
.
any?
=
button_tag
class:
'btn btn-import btn-success js-import-all'
do
Import all compatible projects
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
-
else
=
button_tag
class:
'btn btn-import btn-success js-import-all'
do
Import all projects
=
icon
(
'spinner spin'
,
class:
'loading-icon'
)
%p
.table-responsive
%table
.table.import-jobs
...
...
lib/bitbucket_server/connection.rb
View file @
3735ce43
...
...
@@ -7,7 +7,7 @@ module BitbucketServer
def
initialize
(
options
=
{})
@api_version
=
options
.
fetch
(
:api_version
,
DEFAULT_API_VERSION
)
@base_uri
=
options
[
:base_uri
]
@username
=
options
[
:user
name
]
@username
=
options
[
:user
]
@token
=
options
[
:password
]
end
...
...
lib/bitbucket_server/representation/pull_request.rb
View file @
3735ce43
...
...
@@ -27,6 +27,10 @@ module BitbucketServer
end
end
def
merged?
state
==
'merged'
end
def
created_at
raw
[
'createdDate'
]
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