Skip to content

Commit

Permalink
Set user namespace as default for new projects without a parent group
Browse files Browse the repository at this point in the history
  • Loading branch information
malchua committed Dec 20, 2024
1 parent 394ff06 commit 5d40bf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/views/projects/_project_namespace_fields.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
<div class="form-field">
<%= builder.label :parent_id %>
<div class="flex items-center whitespace-nowrap">
<%= viral_prefixed_select2(form: builder, name: :parent_id, selected_value: params[:group_id], placeholder: t(:"projects.new.select_namespace")) do |select| %>
<% params.has_key?(:group_id) ?
selected_value = params[:group_id] :
selected_value = current_user.namespace.id %>
<%= viral_prefixed_select2(form: builder, name: :parent_id, selected_value: , placeholder: t(:"projects.new.select_namespace")) do |select| %>
<% authorized_namespaces.each do |namespace| %>
<% select.with_option(
primary: namespace.full_path,
Expand Down

0 comments on commit 5d40bf0

Please sign in to comment.