summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages
diff options
context:
space:
mode:
authorJan Beckmann <king-jan1999@hotmail.de>2019-09-11 14:28:34 +0000
committerClement Ho <408677-ClemMakesApps@users.noreply.gitlab.com>2019-09-11 14:28:34 +0000
commitc27f619c2a7609af3a7478ae6a6e2d1f210b5be3 (patch)
tree94e426b17e66de2bfbccba59c95ec9a6d7e1f87b /app/assets/javascripts/pages
parent0813d1543114883e8ec84cecb5495a3cd9c1f332 (diff)
downloadgitlab-ce-c27f619c2a7609af3a7478ae6a6e2d1f210b5be3.tar.gz
Disable "transfer group" button when no parent group is selected
Refactor project_edit.js to be reusable for this purpose Closes #64799
Diffstat (limited to 'app/assets/javascripts/pages')
-rw-r--r--app/assets/javascripts/pages/groups/edit/index.js2
-rw-r--r--app/assets/javascripts/pages/projects/edit/index.js4
2 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/pages/groups/edit/index.js b/app/assets/javascripts/pages/groups/edit/index.js
index d036ff07d89..f32392c9e29 100644
--- a/app/assets/javascripts/pages/groups/edit/index.js
+++ b/app/assets/javascripts/pages/groups/edit/index.js
@@ -2,6 +2,7 @@ import initAvatarPicker from '~/avatar_picker';
import TransferDropdown from '~/groups/transfer_dropdown';
import initConfirmDangerModal from '~/confirm_danger_modal';
import initSettingsPanels from '~/settings_panels';
+import setupTransferEdit from '~/transfer_edit';
import dirtySubmitFactory from '~/dirty_submit/dirty_submit_factory';
import mountBadgeSettings from '~/pages/shared/mount_badge_settings';
import { GROUP_BADGE } from '~/badges/constants';
@@ -17,6 +18,7 @@ document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.js-general-settings-form, .js-general-permissions-form'),
);
mountBadgeSettings(GROUP_BADGE);
+ setupTransferEdit('.js-group-transfer-form', '#new_parent_group_id');
// Initialize Subgroups selector
groupsSelect();
diff --git a/app/assets/javascripts/pages/projects/edit/index.js b/app/assets/javascripts/pages/projects/edit/index.js
index 92ed6a652d7..c9dbe576c4b 100644
--- a/app/assets/javascripts/pages/projects/edit/index.js
+++ b/app/assets/javascripts/pages/projects/edit/index.js
@@ -1,6 +1,6 @@
import { PROJECT_BADGE } from '~/badges/constants';
import initSettingsPanels from '~/settings_panels';
-import setupProjectEdit from '~/project_edit';
+import setupTransferEdit from '~/transfer_edit';
import initConfirmDangerModal from '~/confirm_danger_modal';
import mountBadgeSettings from '~/pages/shared/mount_badge_settings';
import dirtySubmitFactory from '~/dirty_submit/dirty_submit_factory';
@@ -16,7 +16,7 @@ document.addEventListener('DOMContentLoaded', () => {
initProjectLoadingSpinner();
initProjectPermissionsSettings();
- setupProjectEdit();
+ setupTransferEdit('.js-project-transfer-form', 'select.select2');
dirtySubmitFactory(
document.querySelectorAll(