summaryrefslogtreecommitdiff
path: root/app/controllers/groups_controller.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
commit0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch)
tree4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/controllers/groups_controller.rb
parent744144d28e3e7fddc117924fef88de5d9674fe4c (diff)
downloadgitlab-ce-0653e08efd039a5905f3fa4f6e9cef9f5d2f799c.tar.gz
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 2796760fbe1..a419171039e 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -33,6 +33,7 @@ class GroupsController < Groups::ApplicationController
before_action do
push_frontend_feature_flag(:vue_issuables_list, @group)
+ push_frontend_feature_flag(:vue_issues_list, @group, default_enabled: :yaml)
push_frontend_feature_flag(:iteration_cadences, @group, default_enabled: :yaml)
end
@@ -64,6 +65,7 @@ class GroupsController < Groups::ApplicationController
def new
@group = Group.new(params.permit(:parent_id))
+ @group.build_namespace_settings
end
def create
@@ -269,7 +271,9 @@ class GroupsController < Groups::ApplicationController
:default_branch_name,
:allow_mfa_for_subgroups,
:resource_access_token_creation_allowed,
- :prevent_sharing_groups_outside_hierarchy
+ :prevent_sharing_groups_outside_hierarchy,
+ :setup_for_company,
+ :jobs_to_be_done
]
end
@@ -342,7 +346,15 @@ class GroupsController < Groups::ApplicationController
render action: 'new'
end
- def successful_creation_hooks; end
+ def successful_creation_hooks
+ update_user_role_and_setup_for_company
+ end
+
+ def update_user_role_and_setup_for_company
+ user_params = params.fetch(:user, {}).permit(:role)
+ user_params[:setup_for_company] = @group.setup_for_company if !@group.setup_for_company.nil? && current_user.setup_for_company.nil?
+ Users::UpdateService.new(current_user, user_params.merge(user: current_user)).execute if user_params.present?
+ end
def groups
if @group.supports_events?