diff options
author | Sam Bigelow <sbigelow@gitlab.com> | 2019-04-13 12:00:10 -0400 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2019-05-21 14:12:11 +0300 |
commit | 731ec33ada14b12e7ae4d2451bb9718424f8bca4 (patch) | |
tree | 3571fc6386ae24493a9457c62fd3afa14e155b69 | |
parent | f7fa349e4782bd8bbc095375d6546db2cbf7b55f (diff) | |
download | gitlab-ce-731ec33ada14b12e7ae4d2451bb9718424f8bca4.tar.gz |
Handling password on import by url page
-rw-r--r-- | app/views/shared/_import_form.html.haml | 20 | ||||
-rw-r--r-- | app/workers/concerns/project_import_options.rb | 2 | ||||
-rw-r--r-- | locale/gitlab.pot | 4 | ||||
-rw-r--r-- | spec/javascripts/projects/project_new_spec.js | 14 |
4 files changed, 22 insertions, 18 deletions
diff --git a/app/views/shared/_import_form.html.haml b/app/views/shared/_import_form.html.haml index 98a8520084a..8a7bc78b569 100644 --- a/app/views/shared/_import_form.html.haml +++ b/app/views/shared/_import_form.html.haml @@ -1,7 +1,7 @@ - ci_cd_only = local_assigns.fetch(:ci_cd_only, false) - import_url = Gitlab::UrlSanitizer.new(f.object.import_url) -.form-group.import-url-data +.import-url-data .form-group = f.label :import_url, class: 'label-bold' do %span @@ -9,24 +9,18 @@ = f.text_field :import_url, value: import_url.sanitized_url, autocomplete: 'off', class: 'form-control', placeholder: 'https://gitlab.company.com/group/project.git', required: true - .form-group#import_url_auth_method - = label :import_url_auth_method, class: 'label-bold' do - %span - = _('Authentication method') - = select_tag :import_url_auth_method, options_for_select([[_('None'), 'none'], [_('Username and Password'), 'username-and-password']]), class: 'form-control' - - .div#import_url_auth_group{ style: 'display: none' } - .form-group + .row + .form-group.col-md-6 = f.label :import_url_user, class: 'label-bold' do %span = _('Username (optional)') = f.text_field :import_url_user, value: import_url.user, class: 'form-control', required: false, autocomplete: 'new-password' - .form-group + .form-group.col-md-6 = f.label :import_url_password, class: 'label-bold' do %span - = _('Git repository password') - = f.password_field :import_url_password, class: 'form-control', required: false, autocomplete: 'new-password', placeholder: 'Basic Auth Password' + = _('Password (optional)') + = f.password_field :import_url_password, class: 'form-control', required: false, autocomplete: 'new-password' .info-well.prepend-top-20 .well-segment @@ -34,7 +28,7 @@ %li = _('The repository must be accessible over <code>http://</code>, <code>https://</code> or <code>git://</code>.').html_safe %li - = _('If your HTTP repository is not publicly accessible, add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>.').html_safe + = _('If your HTTP repository is not publicly accessible, add your credentials.') %li = import_will_timeout_message(ci_cd_only) %li diff --git a/app/workers/concerns/project_import_options.rb b/app/workers/concerns/project_import_options.rb index 53b0459c48c..2baf768bfd1 100644 --- a/app/workers/concerns/project_import_options.rb +++ b/app/workers/concerns/project_import_options.rb @@ -3,7 +3,7 @@ module ProjectImportOptions extend ActiveSupport::Concern - IMPORT_RETRY_COUNT = 0 + IMPORT_RETRY_COUNT = 5 included do sidekiq_options retry: IMPORT_RETRY_COUNT, status_expiration: StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 952e0566f26..49ac8e5c638 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -4941,7 +4941,7 @@ msgstr "" msgid "If this was a mistake you can leave the %{source_type}." msgstr "" -msgid "If your HTTP repository is not publicly accessible, add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>." +msgid "If your HTTP repository is not publicly accessible, add your credentials." msgstr "" msgid "ImageDiffViewer|2-up" @@ -10577,7 +10577,7 @@ msgstr "" msgid "UserProfile|Your projects can be available publicly, internally, or privately, at your choice." msgstr "" -msgid "Username and Password" +msgid "Username (optional)" msgstr "" msgid "Users" diff --git a/spec/javascripts/projects/project_new_spec.js b/spec/javascripts/projects/project_new_spec.js index b61e0ac872f..106a3ba94e4 100644 --- a/spec/javascripts/projects/project_new_spec.js +++ b/spec/javascripts/projects/project_new_spec.js @@ -10,7 +10,17 @@ describe('New Project', () => { setFixtures(` <div class='toggle-import-form'> <div class='import-url-data'> - <input id="project_import_url" /> + <div class="form-group"> + <input id="project_import_url" /> + </div> + <div id="import-url-auth-method"> + <div class="form-group"> + <input id="project-import-url-user" /> + </div> + <div class="form-group"> + <input id="project_import_url_password" /> + </div> + </div> <input id="project_name" /> <input id="project_path" /> </div> @@ -119,7 +129,7 @@ describe('New Project', () => { }); it('changes project path for HTTPS URL in $projectImportUrl', () => { - $projectImportUrl.val('https://username:password@gitlab.company.com/group/project.git'); + $projectImportUrl.val('https://gitlab.company.com/group/project.git'); projectNew.deriveProjectPathFromUrl($projectImportUrl); |