Commit b7a62524 authored by Fatih Acet's avatar Fatih Acet Committed by Robert Speicher

Merge branch 'renable-import-button-when-namespace-already-been-taken' into 'master'

Renable import button when import process fail due to the namespace already been taken

Closes #19435

## Screenshots (if relevant)

Before:

![1](/uploads/e8de1b326e0751891f667630a7685f6a/1.png)<br/><br/>

After:

![2](/uploads/566f1fd5442c28232350689fce8eae76/2.png)

See merge request !5053
(cherry picked from commit d6efef0f)
parent 1b85f557
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.9.5 v 8.9.5
- Re-enable import button when import process fails due to namespace already being taken. !5053
- Fix snippets comments not displayed. !5045 - Fix snippets comments not displayed. !5045
- Fix emoji paths in relative root configurations. !5027 - Fix emoji paths in relative root configurations. !5027
- Fix issues importing events in Import/Export. !4987 - Fix issues importing events in Import/Export. !4987
......
...@@ -7,13 +7,16 @@ class @ImporterStatus ...@@ -7,13 +7,16 @@ class @ImporterStatus
$('.js-add-to-import') $('.js-add-to-import')
.off 'click' .off 'click'
.on 'click', (e) => .on 'click', (e) =>
new_namespace = null
$btn = $(e.currentTarget) $btn = $(e.currentTarget)
$tr = $btn.closest('tr') $tr = $btn.closest('tr')
$target_field = $tr.find('.import-target')
$namespace_input = $target_field.find('input')
id = $tr.attr('id').replace('repo_', '') id = $tr.attr('id').replace('repo_', '')
if $tr.find('.import-target input').length > 0 new_namespace = null
new_namespace = $tr.find('.import-target input').prop('value')
$tr.find('.import-target').empty().append("#{new_namespace} / #{$tr.find('.import-target').data('project_name')}") if $namespace_input.length > 0
new_namespace = $namespace_input.prop('value')
$target_field.empty().append("#{new_namespace}/#{$target_field.data('project_name')}")
$btn $btn
.disable() .disable()
......
- if @already_been_taken - if @already_been_taken
:plain :plain
target_field = $("tr#repo_#{@repo_id} .import-target") tr = $("tr#repo_#{@repo_id}")
target_field = tr.find(".import-target")
import_button = tr.find(".btn-import")
origin_target = target_field.text() origin_target = target_field.text()
project_name = "#{@project_name}" project_name = "#{@project_name}"
origin_namespace = "#{@target_namespace}" origin_namespace = "#{@target_namespace}"
...@@ -10,6 +12,7 @@ ...@@ -10,6 +12,7 @@
target_field.append("/" + project_name) target_field.append("/" + project_name)
target_field.data("project_name", project_name) target_field.data("project_name", project_name)
target_field.find('input').prop("value", origin_namespace) target_field.find('input').prop("value", origin_namespace)
import_button.enable().removeClass('is-loading')
- elsif @access_denied - elsif @access_denied
:plain :plain
job = $("tr#repo_#{@repo_id}") job = $("tr#repo_#{@repo_id}")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment