diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /app/views/shared/namespaces | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'app/views/shared/namespaces')
3 files changed, 36 insertions, 0 deletions
diff --git a/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml b/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml new file mode 100644 index 00000000000..1e9aa4ec5ff --- /dev/null +++ b/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml @@ -0,0 +1,14 @@ +- attribute = local_assigns.fetch(:attribute, nil) +- group = local_assigns.fetch(:group, nil) +- form = local_assigns.fetch(:form, nil) + +- return unless attribute && group && form && cascading_namespace_settings_enabled? +- return if group.namespace_settings.public_send("#{attribute}_locked?") + +- lock_attribute = "lock_#{attribute}" + +.gl-form-checkbox.custom-control.custom-checkbox + = form.check_box lock_attribute, checked: group.namespace_settings.public_send(lock_attribute), class: 'custom-control-input', data: { testid: 'enforce-for-all-subgroups-checkbox' } + = form.label lock_attribute, class: 'custom-control-label' do + %span= s_('CascadingSettings|Enforce for all subgroups') + %p.help-text= s_('CascadingSettings|Subgroups cannot change this setting.') diff --git a/app/views/shared/namespaces/cascading_settings/_lock_popovers.html.haml b/app/views/shared/namespaces/cascading_settings/_lock_popovers.html.haml new file mode 100644 index 00000000000..91458bf180b --- /dev/null +++ b/app/views/shared/namespaces/cascading_settings/_lock_popovers.html.haml @@ -0,0 +1 @@ +.js-cascading-settings-lock-popovers diff --git a/app/views/shared/namespaces/cascading_settings/_setting_label.html.haml b/app/views/shared/namespaces/cascading_settings/_setting_label.html.haml new file mode 100644 index 00000000000..6596ce2bc73 --- /dev/null +++ b/app/views/shared/namespaces/cascading_settings/_setting_label.html.haml @@ -0,0 +1,21 @@ +- attribute = local_assigns.fetch(:attribute, nil) +- group = local_assigns.fetch(:group, nil) +- form = local_assigns.fetch(:form, nil) +- settings_path_helper = local_assigns.fetch(:settings_path_helper, nil) +- help_text = local_assigns.fetch(:help_text, nil) + +- return unless attribute && group && form && settings_path_helper + +- setting_locked = group.namespace_settings.public_send("#{attribute}_locked?") + += form.label attribute, class: 'custom-control-label', aria: { disabled: setting_locked } do + %span.position-relative.gl-pr-6.gl-display-inline-flex + = yield + - if setting_locked + %button.position-absolute.gl-top-3.gl-right-0.gl-translate-y-n50.gl-cursor-default.btn.btn-default.btn-sm.gl-button.btn-default-tertiary.js-cascading-settings-lock-popover-target{ class: 'gl-p-1! gl-text-gray-600! gl-bg-transparent!', + type: 'button', + data: cascading_namespace_settings_popover_data(attribute, group, settings_path_helper) } + = sprite_icon('lock', size: 16) + - if help_text + %p.help-text + = help_text |