diff --git a/app/assets/javascripts/import_entities/import_groups/components/import_actions_cell.vue b/app/assets/javascripts/import_entities/import_groups/components/import_actions_cell.vue index deaf26544249e78d5e9ef4fdb0cad23db1b739fa..18ab7e17e61ef7de2d9ca7bc4985b2e56dbef540 100644 --- a/app/assets/javascripts/import_entities/import_groups/components/import_actions_cell.vue +++ b/app/assets/javascripts/import_entities/import_groups/components/import_actions_cell.vue @@ -1,10 +1,11 @@ <script> -import { GlButton, GlIcon, GlTooltipDirective as GlTooltip } from '@gitlab/ui'; +import { GlDropdown, GlDropdownItem, GlIcon, GlTooltipDirective as GlTooltip } from '@gitlab/ui'; export default { components: { GlIcon, - GlButton, + GlDropdown, + GlDropdownItem, }, directives: { GlTooltip, @@ -23,21 +24,30 @@ export default { required: true, }, }, + methods: { + importGroup(migrateProjects) { + this.$emit('import-group', migrateProjects); + }, + }, }; </script> <template> <span class="gl-white-space-nowrap gl-inline-flex gl-align-items-center"> - <gl-button + <gl-dropdown v-if="isAvailableForImport" + :text="isFinished ? __('Re-import with projects') : __('Import with projects')" :disabled="isInvalid" variant="confirm" category="secondary" data-qa-selector="import_group_button" - @click="$emit('import-group')" + split + @click="importGroup(true)" > - {{ isFinished ? __('Re-import') : __('Import') }} - </gl-button> + <gl-dropdown-item @click="importGroup(false)">{{ + isFinished ? __('Re-import without projects') : __('Import without projects') + }}</gl-dropdown-item> + </gl-dropdown> <gl-icon v-if="isAvailableForImport && isFinished" v-gl-tooltip 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 6412f26fde7074c3c996261c1e38fba89276ad5f..1528b529dc1ac5b3685d65b3062e8e6262c8820f 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 @@ -1,7 +1,8 @@ <script> import { GlAlert, - GlButton, + GlDropdown, + GlDropdownItem, GlEmptyState, GlIcon, GlLink, @@ -46,7 +47,8 @@ const DEFAULT_TD_CLASSES = 'gl-vertical-align-top!'; export default { components: { GlAlert, - GlButton, + GlDropdown, + GlDropdownItem, GlEmptyState, GlIcon, GlLink, @@ -375,10 +377,11 @@ export default { } }, - importSelectedGroups() { + importSelectedGroups(migrateProjects) { const importRequests = this.groupsTableData .filter((group) => this.selectedGroupsIds.includes(group.id)) .map((group) => ({ + migrateProjects, sourceGroupId: group.id, targetNamespace: group.importTarget.targetNamespace.fullPath, newName: group.importTarget.newName, @@ -646,14 +649,19 @@ export default { </template> </gl-sprintf> </span> - <gl-button - category="primary" + <gl-dropdown + :text="s__('BulkImport|Import with projects')" + :disabled="!hasSelectedGroups" variant="confirm" + category="primary" class="gl-ml-4" - :disabled="!hasSelectedGroups" - @click="importSelectedGroups" - >{{ s__('BulkImport|Import selected') }}</gl-button + split + @click="importSelectedGroups(true)" > + <gl-dropdown-item class="gl-z-index-200" @click="importSelectedGroups(false)">{{ + s__('BulkImport|Import without projects') + }}</gl-dropdown-item> + </gl-dropdown> </div> <gl-table ref="table" @@ -717,6 +725,7 @@ export default { @import-group=" importGroups([ { + migrateProjects: $event, sourceGroupId: group.id, targetNamespace: group.importTarget.targetNamespace.fullPath, newName: group.importTarget.newName, diff --git a/app/assets/javascripts/import_entities/import_groups/graphql/typedefs.graphql b/app/assets/javascripts/import_entities/import_groups/graphql/typedefs.graphql index c48e22a7717d65720c2b4622e593db931dbbed7a..83d17a5baa7ad00b47fd7d7f394cc1b8910b8293 100644 --- a/app/assets/javascripts/import_entities/import_groups/graphql/typedefs.graphql +++ b/app/assets/javascripts/import_entities/import_groups/graphql/typedefs.graphql @@ -74,6 +74,7 @@ input ImportRequestInput { sourceGroupId: ID! targetNamespace: String! newName: String! + migrateProjects: Boolean! } extend type Mutation { diff --git a/locale/gitlab.pot b/locale/gitlab.pot index ca17d528fc377d488a18c11020aacce65702a614..cb7ade5aae69e317f56db434a8f27b11d90a92f9 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -7429,7 +7429,10 @@ msgstr "" msgid "BulkImport|Import is finished. Pick another name for re-import" msgstr "" -msgid "BulkImport|Import selected" +msgid "BulkImport|Import with projects" +msgstr "" + +msgid "BulkImport|Import without projects" msgstr "" msgid "BulkImport|Importing the group failed." @@ -21146,6 +21149,12 @@ msgstr "" msgid "Import timed out. Import took longer than %{import_jobs_expiration} seconds" msgstr "" +msgid "Import with projects" +msgstr "" + +msgid "Import without projects" +msgstr "" + msgid "ImportAProjectModal|Import from a project" msgstr "" @@ -34498,7 +34507,10 @@ msgstr "" msgid "Re-authentication required" msgstr "" -msgid "Re-import" +msgid "Re-import with projects" +msgstr "" + +msgid "Re-import without projects" msgstr "" msgid "Re-request review"