Resolve duplication in group settings partial views
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !14800 (merged) should be addressed:
-
@pslaughter started a discussion: nitpick: There's a bit of duplication between
_allowed_email_domain.html.hamland_ip_restriction.html.haml. Let's create a follow up issue to resolve this.😄 diff --git a/ee/app/views/groups/settings/_allowed_email_domain.html.haml b/ee/app/views/groups/settings/_ip_restriction.html.haml index a3e7d894daa..b3f9a9cde6c 100644 --- a/ee/app/views/groups/settings/_allowed_email_domain.html.haml +++ b/ee/app/views/groups/settings/_ip_restriction.html.haml @@ -1,17 +1,17 @@ -- return unless group.feature_available?(:group_allowed_email_domains) +- return unless group.feature_available?(:group_ip_restriction) - read_only = group.parent_id.present? -%h5= _('Restrict membership by email') +%h5= _('Restrict access by IP address') -= f.fields_for :allowed_email_domain do |allowed_email_domain_form| += f.fields_for :ip_restriction do |ip_restriction_form| .form-group - if read_only - = allowed_email_domain_form.text_field :domain, value: group.root_ancestor_allowed_email_domain&.domain, class: 'form-control', disabled: true, placeholder: _('No value set by top-level parent group.') + = ip_restriction_form.text_field :range, value: group.root_ancestor_ip_restriction&.range, class: 'form-control', disabled: true, placeholder: _('No value set by top-level parent group.') .form-text.text-muted - = _('Email domain is not editable in subgroups. Value inherited from top-level parent group.') + = _('IP address restriction is not editable in subgroups. Value inherited from top-level parent group.') - else - = allowed_email_domain_form.text_field :domain, class: 'form-control', placeholder: _('Enter domain') + = ip_restriction_form.text_field :range, class: 'form-control', placeholder: _('Enter IP address range') .form-text.text-muted - - read_more_link = link_to(_('Read more'), help_page_path('user/group/index', anchor: 'allowed-domain-restriction-premium-only')) - = _('Only users with an email address in this domain can be added to the group.<br>Example: <code>gitlab.com</code>. Some common domains are not allowed. %{read_more_link}.').html_safe % { read_more_link: read_more_link } + - read_more_link = link_to(_('Read more'), help_page_path('user/group/index', anchor: 'ip-access-restriction-ultimate')) + = _('This group, including all subgroups, projects and git repositories, will only be reachable from the specified IP address range. Example: <code>192.168.0.0/24</code>. %{read_more_link}.').html_safe % { read_more_link: read_more_link }
Edited by 🤖 GitLab Bot 🤖