Skip to content

Commit

Permalink
Change dropdown to expand and shrink based on space
Browse files Browse the repository at this point in the history
  • Loading branch information
malchua committed Nov 12, 2024
1 parent c54350e commit 637c191
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
24 changes: 13 additions & 11 deletions app/views/groups/_form_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,20 @@
>
<%= root_url %>
</div>
<%= viral_select2(form:, name: :parent_id, placeholder: t(:"groups.new_subgroup.select_group")) do |select| %>
<% authorized_namespaces.each do |namespace| %>
<% select.with_option(
primary: namespace.full_path,
secondary: namespace.puid,
value: namespace.id,
) %>
<div class="flex-1">
<%= viral_select2(form:, name: :parent_id, placeholder: t(:"groups.new_subgroup.select_group")) do |select| %>
<% authorized_namespaces.each do |namespace| %>
<% select.with_option(
primary: namespace.full_path,
secondary: namespace.puid,
value: namespace.id,
) %>
<% end %>
<%= select.with_empty_state do %>
<%= t(:"groups.new_subgroup.empty_state") %>
<% end %>
<% end %>
<%= select.with_empty_state do %>
<%= t(:"groups.new_subgroup.empty_state") %>
<% end %>
<% end %>
</div>
<div class="ml-4 dark:text-slate-200">/</div>
</div>
</div>
Expand Down
24 changes: 13 additions & 11 deletions app/views/projects/_project_namespace_fields.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@
>
<%= root_url %>
</div>
<%= viral_select2(form: builder, name: :parent_id, placeholder: t(:"projects.new.select_namespace")) do |select| %>
<% authorized_namespaces.each do |namespace| %>
<% select.with_option(
primary: namespace.full_path,
secondary: namespace.puid,
value: namespace.id,
) %>
<div class="flex-1">
<%= viral_select2(form: builder, name: :parent_id, placeholder: t(:"projects.new.select_namespace")) do |select| %>
<% authorized_namespaces.each do |namespace| %>
<% select.with_option(
primary: namespace.full_path,
secondary: namespace.puid,
value: namespace.id,
) %>
<% end %>
<%= select.with_empty_state do %>
<%= t(:"projects.new.empty_state") %>
<% end %>
<% end %>
<%= select.with_empty_state do %>
<%= t(:"projects.new.empty_state") %>
<% end %>
<% end %>
</div>
<div class="ml-4 dark:text-slate-200">/</div>
</div>
</div>
Expand Down

0 comments on commit 637c191

Please sign in to comment.