From 5d709e7e865652d795f90bfd3166abe0455df3cb Mon Sep 17 00:00:00 2001 From: Martin Wortschack Date: Tue, 2 Oct 2018 07:46:41 +0000 Subject: [PATCH] Resolve "Selecting an autofill suggestion for project name will not update the project slug" --- app/assets/javascripts/projects/project_new.js | 2 +- ...n-for-project-name-will-not-update-the-project-slug.yml | 5 +++++ spec/features/projects/import_export/import_file_spec.rb | 7 +++---- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 changelogs/unreleased/52035-selecting-an-autofill-suggestion-for-project-name-will-not-update-the-project-slug.yml diff --git a/app/assets/javascripts/projects/project_new.js b/app/assets/javascripts/projects/project_new.js index 8a079b4b38a..ebe18b47e4e 100644 --- a/app/assets/javascripts/projects/project_new.js +++ b/app/assets/javascripts/projects/project_new.js @@ -147,7 +147,7 @@ const bindEvents = () => { $projectImportUrl.keyup(() => deriveProjectPathFromUrl($projectImportUrl)); - $projectName.keyup(() => { + $projectName.on('keyup change', () => { onProjectNameChange($projectName, $projectPath); hasUserDefinedProjectPath = $projectPath.val().trim().length > 0; }); diff --git a/changelogs/unreleased/52035-selecting-an-autofill-suggestion-for-project-name-will-not-update-the-project-slug.yml b/changelogs/unreleased/52035-selecting-an-autofill-suggestion-for-project-name-will-not-update-the-project-slug.yml new file mode 100644 index 00000000000..d56c814b139 --- /dev/null +++ b/changelogs/unreleased/52035-selecting-an-autofill-suggestion-for-project-name-will-not-update-the-project-slug.yml @@ -0,0 +1,5 @@ +--- +title: Update project path on project name autofill +merge_request: 22016 +author: +type: other diff --git a/spec/features/projects/import_export/import_file_spec.rb b/spec/features/projects/import_export/import_file_spec.rb index 65c68277167..28ae90bc0de 100644 --- a/spec/features/projects/import_export/import_file_spec.rb +++ b/spec/features/projects/import_export/import_file_spec.rb @@ -21,8 +21,9 @@ describe 'Import/Export - project import integration test', :js do context 'when selecting the namespace' do let(:user) { create(:admin) } let!(:namespace) { user.namespace } - let(:project_name) { 'Test Project Name' + SecureRandom.hex } - let(:project_path) { 'test-project-path' + SecureRandom.hex } + let(:randomHex) { SecureRandom.hex } + let(:project_name) { 'Test Project Name' + randomHex } + let(:project_path) { 'test-project-name' + randomHex } context 'prefilled the path' do it 'user imports an exported project successfully' do @@ -30,7 +31,6 @@ describe 'Import/Export - project import integration test', :js do select2(namespace.id, from: '#project_namespace_id') fill_in :project_name, with: project_name, visible: true - fill_in :project_path, with: project_path, visible: true click_import_project_tab click_link 'GitLab export' @@ -79,7 +79,6 @@ describe 'Import/Export - project import integration test', :js do select2(user.namespace.id, from: '#project_namespace_id') fill_in :project_name, with: project.name, visible: true - fill_in :project_path, with: project.path, visible: true click_import_project_tab click_link 'GitLab export' attach_file('file', file)