Migrate GitLab UI checkbox to gitlab_ui_checkbox_component in app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Instructions
-
Find the form_forblock that encompasses the checkbox field you are changing. Change it togitlab_ui_form_for-
The HAML partial may be used in multiple forms. Make sure you change all of the form_forblocks that encompass the checkbox.
-
-
Change f.check_boxtof.gitlab_ui_checkbox_component -
Remove f.labeland instead pass the label as the second argument inf.gitlab_ui_checkbox_component
See https://docs.gitlab.com/ee/development/fe_guide/haml.html#gitlab-ui-form-builder for more information.
Examples
Before
= form_for @group do |f|
.form-group.gl-mb-3
.gl-form-checkbox.custom-control.custom-checkbox
= f.check_box :prevent_sharing_groups_outside_hierarchy, disabled: !can_change_prevent_sharing_groups_outside_hierarchy?(@group), class: 'custom-control-input'
= f.label :prevent_sharing_groups_outside_hierarchy, class: 'custom-control-label' do
%span
= s_('GroupSettings|Prevent members from sending invitations to groups outside of %{group} and its subgroups.').html_safe % { group: link_to_group(@group) }
%p.help-text= prevent_sharing_groups_outside_hierarchy_help_text(@group)
After
= gitlab_ui_form_for @group do |f|
.form-group.gl-mb-3
= f.gitlab_ui_checkbox_component :prevent_sharing_groups_outside_hierarchy,
s_('GroupSettings|Prevent members from sending invitations to groups outside of %{group} and its subgroups.').html_safe % { group: link_to_group(@group) },
help_text: prevent_sharing_groups_outside_hierarchy_help_text(@group),
checkbox_options: { disabled: !can_change_prevent_sharing_groups_outside_hierarchy?(@group) }
Edited by 🤖 GitLab Bot 🤖
