Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
91d357a6
Commit
91d357a6
authored
Aug 19, 2021
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address reviewer comments
parent
0f385b5c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
16 deletions
+5
-16
app/assets/javascripts/import_entities/import_projects/store/mutations.js
...cripts/import_entities/import_projects/store/mutations.js
+2
-3
app/controllers/import/fogbugz_controller.rb
app/controllers/import/fogbugz_controller.rb
+0
-2
app/controllers/import/manifest_controller.rb
app/controllers/import/manifest_controller.rb
+3
-11
No files found.
app/assets/javascripts/import_entities/import_projects/store/mutations.js
View file @
91d357a6
...
...
@@ -64,10 +64,9 @@ export default {
});
const
existingProjects
=
[...
newImportedProjects
,
...
state
.
repositories
];
const
existingProjectNames
=
new
Set
(
existingProjects
.
map
((
p
)
=>
p
.
importSource
.
fullName
));
const
newProjects
=
repositories
.
providerRepos
.
filter
(
(
project
)
=>
!
existingProjects
.
find
((
p
)
=>
p
.
importSource
.
fullName
===
project
.
fullName
),
)
.
filter
((
project
)
=>
!
existingProjectNames
.
has
(
project
.
fullName
))
.
map
((
project
)
=>
({
importSource
:
project
,
importedProject
:
null
,
...
...
app/controllers/import/fogbugz_controller.rb
View file @
91d357a6
...
...
@@ -74,12 +74,10 @@ class Import::FogbugzController < Import::BaseController
protected
# rubocop: disable CodeReuse/ActiveRecord
override
:importable_repos
def
importable_repos
client
.
repos
end
# rubocop: enable CodeReuse/ActiveRecord
override
:incompatible_repos
def
incompatible_repos
...
...
app/controllers/import/manifest_controller.rb
View file @
91d357a6
...
...
@@ -41,7 +41,7 @@ class Import::ManifestController < Import::BaseController
end
def
create
repository
=
repositorie
s
.
find
do
|
project
|
repository
=
importable_repo
s
.
find
do
|
project
|
project
[
:id
]
==
params
[
:repo_id
].
to_i
end
...
...
@@ -56,14 +56,10 @@ class Import::ManifestController < Import::BaseController
protected
# rubocop: disable CodeReuse/ActiveRecord
override
:importable_repos
def
importable_repos
already_added_projects_names
=
already_added_projects
.
pluck
(
:import_url
)
repositories
.
reject
{
|
repo
|
already_added_projects_names
.
include?
(
repo
[
:url
])
}
@importable_repos
||=
manifest_import_metadata
.
repositories
end
# rubocop: enable CodeReuse/ActiveRecord
override
:incompatible_repos
def
incompatible_repos
...
...
@@ -88,7 +84,7 @@ class Import::ManifestController < Import::BaseController
private
def
ensure_import_vars
unless
group
&&
repositorie
s
.
present?
unless
group
&&
importable_repo
s
.
present?
redirect_to
(
new_import_manifest_path
)
end
end
...
...
@@ -103,10 +99,6 @@ class Import::ManifestController < Import::BaseController
@manifest_import_status
||=
Gitlab
::
ManifestImport
::
Metadata
.
new
(
current_user
,
fallback:
session
)
end
def
repositories
@repositories
||=
manifest_import_metadata
.
repositories
end
def
find_jobs
find_already_added_projects
.
to_json
(
only:
[
:id
],
methods:
[
:import_status
])
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment