Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-05-02 19:22:18 +0300
committerJames Lopez <james@jameslopez.es>2016-05-02 19:22:18 +0300
commit5a4f576359a71a57c70544568d9291cba53a2d39 (patch)
treec0c30452a6e74788809a945218153087be91cb59
parentb5f2a7e139f0c1803afb68c26042ce4f8cec9148 (diff)
fixing issues with project members mapping. Also added some more JS magic to the import page
-rw-r--r--app/views/projects/new.html.haml11
-rw-r--r--lib/gitlab/import_export/import_export_reader.rb4
-rw-r--r--lib/gitlab/import_export/project_tree_restorer.rb1
3 files changed, 15 insertions, 1 deletions
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index b3d755b3790..f9d9216f626 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -131,3 +131,14 @@
var _href = $("a.import_gitlab_project").attr("href");
$(".import_gitlab_project").attr("href", _href + '?namespace_id=' + $("#project_namespace_id").val() + '&path=' + $("#project_path").val());
});
+ $('.import_gitlab_project').attr('disabled',true)
+ $('.import_gitlab_project').attr('title', 'Project path required.');
+ $('#project_path').keyup(function(){
+ if($(this).val().length !=0) {
+ $('.import_gitlab_project').attr('disabled', false);
+ $('.import_gitlab_project').attr('title','');
+ } else {
+ $('.import_gitlab_project').attr('disabled',true);
+ $('.import_gitlab_project').attr('title', 'Project path required.');
+ }
+ })
diff --git a/lib/gitlab/import_export/import_export_reader.rb b/lib/gitlab/import_export/import_export_reader.rb
index 717d3026f9e..4e46899ec7e 100644
--- a/lib/gitlab/import_export/import_export_reader.rb
+++ b/lib/gitlab/import_export/import_export_reader.rb
@@ -57,8 +57,10 @@ module Gitlab
end
def add_new_class(current_key, included_classes_hash, value)
+ only_except_hash = check_only_and_except(value)
+ # TODO: refactor this
+ value = (value.is_a?(Hash) ? value.merge(only_except_hash) : { value => only_except_hash }) if only_except_hash
new_hash = { include: value }
- new_hash.merge!(check_only_and_except(value))
included_classes_hash[current_key] = new_hash
end
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb
index d2834101758..0f2e3716779 100644
--- a/lib/gitlab/import_export/project_tree_restorer.rb
+++ b/lib/gitlab/import_export/project_tree_restorer.rb
@@ -49,6 +49,7 @@ module Gitlab
project = Gitlab::ImportExport::ProjectFactory.create(
project_params: project_params, user: @user)
project.path = @project_path
+ project.name = @project_path
project.save
project
end