Skip to content
代码片段 群组 项目
未验证 提交 bdcd0de5 编辑于 作者: Andrei Zubov's avatar Andrei Zubov 提交者: GitLab
浏览文件

Merge branch 'admin-settings-migrate-templates' into 'master'

Admin settings: Migrate templates section to use SettingsBlock

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/157048



Merged-by: default avatarAndrei Zubov <azubov@gitlab.com>
Approved-by: default avatarAnnabel Dunstone Gray <annabel.dunstone@gmail.com>
Approved-by: default avatarTomas Vik <tvik@gitlab.com>
Approved-by: default avatarAndrei Zubov <azubov@gitlab.com>
Co-authored-by: default avatarSascha Eggenberger <seggenberger@gitlab.com>
No related branches found
No related tags found
无相关合并请求
- if ::Gitlab::CurrentSettings.custom_project_templates_enabled? - if ::Gitlab::CurrentSettings.custom_project_templates_enabled?
%section.settings.as-custom-project-templates.no-animate#js-custom-project-templates-settings{ class: ('expanded' if expanded), data: { testid: 'custom-project-template-container' } } = render ::Layouts::SettingsBlockComponent.new(_('Custom project templates'),
.settings-header id: 'js-custom-project-templates-settings',
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only testid: 'custom-project-template-container',
= _('Custom project templates') expanded: expanded_by_default?) do |c|
= render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do - c.with_description do
= expanded ? _('Collapse') : _('Expand') - link = link_to('', help_page_path('administration/custom_project_templates'))
%p.gl-text-secondary = safe_format(s_('AdminSettings|Select a group to use as a source of custom templates for new projects. %{link_start}Learn more%{link_end}.'), tag_pair(link, :link_start, :link_end))
- link = link_to('', help_page_path('administration/custom_project_templates')) - c.with_body do
= safe_format(s_('AdminSettings|Select a group to use as a source of custom templates for new projects. %{link_start}Learn more%{link_end}.'), tag_pair(link, :link_start, :link_end))
.settings-content
= gitlab_ui_form_for @application_setting, url: templates_admin_application_settings_path(anchor: 'js-custom-project-templates-settings') do |f| = gitlab_ui_form_for @application_setting, url: templates_admin_application_settings_path(anchor: 'js-custom-project-templates-settings') do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
......
- @force_desktop_expanded_sidebar = true - @force_desktop_expanded_sidebar = true
- if License.feature_available?(:custom_file_templates) - if License.feature_available?(:custom_file_templates)
%section.settings.as-visibility-access.no-animate#js-visibility-settings{ class: ('expanded' if expanded) } = render ::Layouts::SettingsBlockComponent.new(_('Templates'),
.settings-header id: 'js-templates-settings',
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only testid: 'templates-settings',
= _('Templates') expanded: expanded) do |c|
= render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do - c.with_description do
= expanded ? _('Collapse') : _('Expand') = _('Select a repository containing templates for common files.')
%p.gl-text-secondary = link_to _('What templates can I create?'), help_page_path('administration/settings/instance_template_repository', anchor: 'supported-file-types-and-locations'), target: '_blank', rel: 'noopener noreferrer'
= _('Select a repository containing templates for common files.') - c.with_body do
= link_to _('What templates can I create?'), help_page_path('administration/settings/instance_template_repository', anchor: 'supported-file-types-and-locations'), target: '_blank', rel: 'noopener noreferrer'
.settings-content
= gitlab_ui_form_for @application_setting, url: templates_admin_application_settings_path, html: { class: 'fieldset-form' } do |f| = gitlab_ui_form_for @application_setting, url: templates_admin_application_settings_path, html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
......
...@@ -199,13 +199,13 @@ ...@@ -199,13 +199,13 @@
end end
it 'render "Templates" section' do it 'render "Templates" section' do
page.within('.as-visibility-access') do within_testid('templates-settings') do
expect(page).to have_content 'Templates' expect(page).to have_content 'Templates'
end end
end end
it 'render "Custom project templates" section' do it 'render "Custom project templates" section' do
page.within('.as-custom-project-templates') do within_testid('custom-project-template-container') do
expect(page).to have_content 'Custom project templates' expect(page).to have_content 'Custom project templates'
end end
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册