From 88e640374a82c3058b2a8cb54407fdc1784484d9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 2 Jul 2018 12:16:24 +0300 Subject: Add manifest import feature It allows user to automatically import multiple repositories with nested structure by uploading a manifest xml file. AOSP project was used as an example during development of this feature. Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_import_project_pane.html.haml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'app/views/projects/_import_project_pane.html.haml') diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index 8f535b9d789..7cb5d51bec1 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -1,9 +1,8 @@ - active_tab = local_assigns.fetch(:active_tab, 'blank') -- f = local_assigns.fetch(:f) .project-import .form-group.import-btn-container.clearfix - = f.label :visibility_level, class: 'label-light' do #the label here seems wrong + %h5 Import project from .import-buttons - if gitlab_project_import_enabled? @@ -39,11 +38,20 @@ = link_to new_import_gitea_path, class: 'btn import_gitea' do = custom_icon('go_logo') Gitea - %div - - if git_import_enabled? + - if git_import_enabled? + %div %button.btn.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active' } } = icon('git', text: 'Repo by URL') + %div + %button.btn{ type: "button" } + = icon('git', text: 'Manifest file') + .js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') } - %hr + = form_for @project, html: { class: 'new_project' } do |f| + %hr = render "shared/import_form", f: f = render 'new_project_fields', f: f, project_name_id: "import-url-name" + + .toggle-manifest-form + %hr + = render 'import/manifest/form' -- cgit v1.2.3 From 98d29f6e78526d9bc35233a1049a502294f56384 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 5 Jul 2018 15:46:39 +0300 Subject: Add ability to disable manifest import Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_import_project_pane.html.haml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app/views/projects/_import_project_pane.html.haml') diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index 7cb5d51bec1..8472714b8a5 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -38,13 +38,14 @@ = link_to new_import_gitea_path, class: 'btn import_gitea' do = custom_icon('go_logo') Gitea - - if git_import_enabled? - %div + %div + - if git_import_enabled? %button.btn.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active' } } = icon('git', text: 'Repo by URL') - %div + %div + - if manifest_import_enabled? %button.btn{ type: "button" } - = icon('git', text: 'Manifest file') + = icon('file', text: 'Manifest file') .js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') } = form_for @project, html: { class: 'new_project' } do |f| -- cgit v1.2.3 From 0f9dacf4316072ed11e9bd6f328585c469b1ad9c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 5 Jul 2018 17:30:47 +0300 Subject: Fix icon for manifest import and mention manifest feature in API Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_import_project_pane.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects/_import_project_pane.html.haml') diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index 8472714b8a5..7f4520fa50f 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -45,7 +45,7 @@ %div - if manifest_import_enabled? %button.btn{ type: "button" } - = icon('file', text: 'Manifest file') + = icon('file-text-o', text: 'Manifest file') .js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') } = form_for @project, html: { class: 'new_project' } do |f| -- cgit v1.2.3 From 4cee5d2e8c78001a1affc53175833641253adbb0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 6 Jul 2018 13:59:48 +0300 Subject: Move manifest import to separate page and add feature specs Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_import_project_pane.html.haml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'app/views/projects/_import_project_pane.html.haml') diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index 7f4520fa50f..cfbaebec876 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -44,7 +44,7 @@ = icon('git', text: 'Repo by URL') %div - if manifest_import_enabled? - %button.btn{ type: "button" } + = link_to new_import_manifest_path, class: 'btn import_manifest' do = icon('file-text-o', text: 'Manifest file') .js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') } @@ -52,7 +52,3 @@ %hr = render "shared/import_form", f: f = render 'new_project_fields', f: f, project_name_id: "import-url-name" - - .toggle-manifest-form - %hr - = render 'import/manifest/form' -- cgit v1.2.3 From e02efff63d2b065f95e4eeac28ba994d245e4505 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 9 Jul 2018 13:12:37 +0300 Subject: Improve manifest feature frontend after review Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_import_project_pane.html.haml | 40 ++++++++++++++--------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'app/views/projects/_import_project_pane.html.haml') diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index cfbaebec876..3da6db08580 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -9,41 +9,49 @@ .import_gitlab_project.has-tooltip{ data: { container: 'body' } } = link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do = icon('gitlab', text: 'GitLab export') - %div - - if github_import_enabled? + + - if github_import_enabled? + %div = link_to new_import_github_path, class: 'btn js-import-github' do = icon('github', text: 'GitHub') - %div - - if bitbucket_import_enabled? + + - if bitbucket_import_enabled? + %div = link_to status_import_bitbucket_path, class: "btn import_bitbucket #{'how_to_import_link' unless bitbucket_import_configured?}" do = icon('bitbucket', text: 'Bitbucket') - unless bitbucket_import_configured? = render 'bitbucket_import_modal' - %div - - if gitlab_import_enabled? + + - if gitlab_import_enabled? + %div = link_to status_import_gitlab_path, class: "btn import_gitlab #{'how_to_import_link' unless gitlab_import_configured?}" do = icon('gitlab', text: 'GitLab.com') - unless gitlab_import_configured? = render 'gitlab_import_modal' - %div - - if google_code_import_enabled? + + - if google_code_import_enabled? + %div = link_to new_import_google_code_path, class: 'btn import_google_code' do = icon('google', text: 'Google Code') - %div - - if fogbugz_import_enabled? + + - if fogbugz_import_enabled? + %div = link_to new_import_fogbugz_path, class: 'btn import_fogbugz' do = icon('bug', text: 'Fogbugz') - %div - - if gitea_import_enabled? + + - if gitea_import_enabled? + %div = link_to new_import_gitea_path, class: 'btn import_gitea' do = custom_icon('go_logo') Gitea - %div - - if git_import_enabled? + + - if git_import_enabled? + %div %button.btn.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active' } } = icon('git', text: 'Repo by URL') - %div - - if manifest_import_enabled? + + - if manifest_import_enabled? + %div = link_to new_import_manifest_path, class: 'btn import_manifest' do = icon('file-text-o', text: 'Manifest file') -- cgit v1.2.3