diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 18:40:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 18:40:28 +0300 |
commit | b595cb0c1dec83de5bdee18284abe86614bed33b (patch) | |
tree | 8c3d4540f193c5ff98019352f554e921b3a41a72 /app/assets/javascripts/import_entities/import_groups/components/import_table.vue | |
parent | 2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff) |
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'app/assets/javascripts/import_entities/import_groups/components/import_table.vue')
-rw-r--r-- | app/assets/javascripts/import_entities/import_groups/components/import_table.vue | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/assets/javascripts/import_entities/import_groups/components/import_table.vue b/app/assets/javascripts/import_entities/import_groups/components/import_table.vue index 6b96fa7c45c..98ee858ca91 100644 --- a/app/assets/javascripts/import_entities/import_groups/components/import_table.vue +++ b/app/assets/javascripts/import_entities/import_groups/components/import_table.vue @@ -78,6 +78,11 @@ export default { type: String, required: true, }, + defaultTargetNamespace: { + type: Number, + required: false, + default: null, + }, }, data() { @@ -433,7 +438,15 @@ export default { return this.importTargets[group.id]; } - const defaultTargetNamespace = this.availableNamespaces[0] ?? ROOT_NAMESPACE; + // If we've reached this Vue application we have at least one potential import destination + const defaultTargetNamespace = + // first option: namespace id was explicitly provided + this.availableNamespaces.find((ns) => ns.id === this.defaultTargetNamespace) ?? + // second option: first available namespace + this.availableNamespaces[0] ?? + // last resort: if no namespaces are available - suggest creating new namespace at root + ROOT_NAMESPACE; + let importTarget; if (group.lastImportTarget) { const targetNamespace = [ROOT_NAMESPACE, ...this.availableNamespaces].find( |