diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-09-20 16:24:20 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-09-20 16:24:20 +0300 |
commit | 00057a75f4f7433d8594ec7adb480ab39a7cb008 (patch) | |
tree | 2630af73ad1c3a8510152cf0e7cb3e9103c6d942 /app | |
parent | ac3157a0d5c3cd32ebc68c0f29e48d7a9c64edc5 (diff) | |
parent | 26225e778d7e5beb9861756890bf2fddb19af77b (diff) |
Merge branch '44998-split-admin-settings-into-multiple-sub-pages' into 'master'
Resolve "Split admin settings into multiple sub pages"
Closes #44998
See merge request gitlab-org/gitlab-ce!21467
Diffstat (limited to 'app')
15 files changed, 406 insertions, 295 deletions
diff --git a/app/assets/javascripts/pages/admin/application_settings/index.js b/app/assets/javascripts/pages/admin/application_settings/index.js index 069f8ce55d0..47bd70537f1 100644 --- a/app/assets/javascripts/pages/admin/application_settings/index.js +++ b/app/assets/javascripts/pages/admin/application_settings/index.js @@ -1,13 +1,8 @@ import initSettingsPanels from '~/settings_panels'; import projectSelect from '~/project_select'; -import UsagePingPayload from './usage_ping_payload'; document.addEventListener('DOMContentLoaded', () => { // Initialize expandable settings panels initSettingsPanels(); projectSelect(); - new UsagePingPayload( - document.querySelector('.js-usage-ping-payload-trigger'), - document.querySelector('.js-usage-ping-payload'), - ).init(); }); diff --git a/app/assets/javascripts/pages/admin/application_settings/metrics_and_profiling/index.js b/app/assets/javascripts/pages/admin/application_settings/metrics_and_profiling/index.js new file mode 100644 index 00000000000..c40503603be --- /dev/null +++ b/app/assets/javascripts/pages/admin/application_settings/metrics_and_profiling/index.js @@ -0,0 +1,8 @@ +import UsagePingPayload from './../usage_ping_payload'; + +document.addEventListener('DOMContentLoaded', () => { + new UsagePingPayload( + document.querySelector('.js-usage-ping-payload-trigger'), + document.querySelector('.js-usage-ping-payload'), + ).init(); +}); diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 869213d61f1..51f75fb77f0 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -1,9 +1,37 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController + include InternalRedirect before_action :set_application_setting def show end + def integrations + end + + def repository + end + + def templates + end + + def ci_cd + end + + def reporting + end + + def metrics_and_profiling + end + + def network + end + + def geo + end + + def preferences + end + def update successful = ApplicationSettings::UpdateService .new(@application_setting, current_user, application_setting_params) @@ -13,10 +41,12 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController session[:ask_for_usage_stats_consent] = current_user.requires_usage_stats_consent? end + redirect_path = referer_path(request) || admin_application_settings_path + respond_to do |format| if successful format.json { head :ok } - format.html { redirect_to admin_application_settings_path, notice: 'Application settings saved successfully' } + format.html { redirect_to redirect_path, notice: 'Application settings saved successfully' } else format.json { head :bad_request } format.html { render :show } diff --git a/app/controllers/concerns/internal_redirect.rb b/app/controllers/concerns/internal_redirect.rb index 10b9852e329..6ac9e860437 100644 --- a/app/controllers/concerns/internal_redirect.rb +++ b/app/controllers/concerns/internal_redirect.rb @@ -36,4 +36,10 @@ module InternalRedirect path_with_query = [uri.path, uri.query].compact.join('?') [path_with_query, uri.fragment].compact.join("#") end + + def referer_path(request) + return unless request.referer.presence + + URI(request.referer).path + end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ef4560023af..32fc8e5e9ce 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,7 +7,15 @@ module ApplicationHelper # See https://docs.gitlab.com/ee/development/ee_features.html#code-in-app-views # rubocop: disable CodeReuse/ActiveRecord def render_if_exists(partial, locals = {}) - render(partial, locals) if lookup_context.exists?(partial, [], true) + render(partial, locals) if partial_exists?(partial) + end + + def partial_exists?(partial) + lookup_context.exists?(partial, [], true) + end + + def template_exists?(template) + lookup_context.exists?(template, [], false) end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 3ebf0162cb6..dc393968786 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -264,4 +264,8 @@ module ApplicationSettingsHelper :web_ide_clientside_preview_enabled ] end + + def expanded_by_default? + Rails.env.test? + end end diff --git a/app/views/admin/application_settings/ci_cd.html.haml b/app/views/admin/application_settings/ci_cd.html.haml new file mode 100644 index 00000000000..db24c9982f7 --- /dev/null +++ b/app/views/admin/application_settings/ci_cd.html.haml @@ -0,0 +1,26 @@ +- breadcrumb_title _("CI/CD") +- page_title _("CI/CD") +- @content_class = "limit-container-width" unless fluid_layout + +%section.settings.as-ci-cd.no-animate#js-ci-cd-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Continuous Integration and Deployment') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Auto DevOps, runners and job artifacts') + .settings-content + = render 'ci_cd' + +- if Gitlab.config.registry.enabled + %section.settings.as-registry.no-animate#js-registry-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Container Registry') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Various container registry settings.') + .settings-content + = render 'registry' diff --git a/app/views/admin/application_settings/integrations.html.haml b/app/views/admin/application_settings/integrations.html.haml new file mode 100644 index 00000000000..310e86b1377 --- /dev/null +++ b/app/views/admin/application_settings/integrations.html.haml @@ -0,0 +1,31 @@ +- breadcrumb_title _("Integrations") +- page_title _("Integrations") +- @content_class = "limit-container-width" unless fluid_layout + += render_if_exists 'admin/application_settings/elasticsearch_form', expanded: expanded_by_default? + +%section.settings.as-plantuml.no-animate#js-plantuml-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('PlantUML') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Allow rendering of PlantUML diagrams in Asciidoc documents.') + .settings-content + = render 'plantuml' + += render_if_exists 'admin/application_settings/slack', expanded: expanded_by_default? + +%section.settings.as-third-party-offers.no-animate#js-third-party-offers-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Third party offers') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Control the display of third party offers.') + .settings-content + = render 'third_party_offers', application_setting: @application_setting + += render_if_exists 'admin/application_settings/snowplow', expanded: expanded_by_default? diff --git a/app/views/admin/application_settings/metrics_and_profiling.html.haml b/app/views/admin/application_settings/metrics_and_profiling.html.haml new file mode 100644 index 00000000000..f50aca32bdf --- /dev/null +++ b/app/views/admin/application_settings/metrics_and_profiling.html.haml @@ -0,0 +1,50 @@ +- breadcrumb_title _("Metrics and profiling") +- page_title _("Metrics and profiling") +- @content_class = "limit-container-width" unless fluid_layout + +%section.settings.as-influx.no-animate#js-influx-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Metrics - Influx') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Enable and configure InfluxDB metrics.') + .settings-content + = render 'influx' + +%section.settings.as-prometheus.no-animate#js-prometheus-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Metrics - Prometheus') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Enable and configure Prometheus metrics.') + .settings-content + = render 'prometheus' + +%section.settings.as-performance-bar.no-animate#js-performance-bar-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Profiling - Performance bar') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Enable the Performance Bar for a given group.') + = link_to icon('question-circle'), help_page_path('administration/monitoring/performance/performance_bar') + .settings-content + = render 'performance_bar' + +%section.settings.as-usage.no-animate#js-usage-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header#usage-statistics + %h4 + = _('Usage statistics') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Enable or disable version check and usage ping.') + .settings-content + = render 'usage' + += render_if_exists 'admin/application_settings/pseudonymizer_settings', expanded: expanded_by_default? diff --git a/app/views/admin/application_settings/network.html.haml b/app/views/admin/application_settings/network.html.haml new file mode 100644 index 00000000000..26fd745f45f --- /dev/null +++ b/app/views/admin/application_settings/network.html.haml @@ -0,0 +1,36 @@ +- breadcrumb_title _("Network") +- page_title _("Network") +- @content_class = "limit-container-width" unless fluid_layout + +%section.settings.as-performance.no-animate#js-performance-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Performance optimization') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Various settings that affect GitLab performance.') + .settings-content + = render 'performance' + +%section.settings.as-ip-limits.no-animate#js-ip-limits-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('User and IP Rate Limits') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Configure limits for web and API requests.') + .settings-content + = render 'ip_limits' + +%section.settings.as-outbound.no-animate#js-outbound-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Outbound requests') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Allow requests to the local network from hooks and services.') + .settings-content + = render 'outbound' diff --git a/app/views/admin/application_settings/preferences.html.haml b/app/views/admin/application_settings/preferences.html.haml new file mode 100644 index 00000000000..75f76eea3b4 --- /dev/null +++ b/app/views/admin/application_settings/preferences.html.haml @@ -0,0 +1,69 @@ +- breadcrumb_title _("Preferences") +- page_title _("Preferences") +- @content_class = "limit-container-width" unless fluid_layout + +%section.settings.as-email.no-animate#js-email-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Email') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Various email settings.') + .settings-content + = render 'email' + +%section.settings.as-help-page.no-animate#js-help-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Help page') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Help page text and support page url.') + .settings-content + = render 'help_page' + +%section.settings.as-pages.no-animate#js-pages-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Pages') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Size and domain settings for static websites') + .settings-content + = render 'pages' + +%section.settings.as-realtime.no-animate#js-realtime-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Real-time features') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Change this value to influence how frequently the GitLab UI polls for updates.') + .settings-content + = render 'realtime' + +%section.settings.as-background.no-animate#js-background-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Background jobs') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Configure Sidekiq job throttling.') + .settings-content + = render 'background_jobs' + +%section.settings.as-gitaly.no-animate#js-gitaly-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Gitaly') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Configure Gitaly timeouts.') + .settings-content + = render 'gitaly' diff --git a/app/views/admin/application_settings/reporting.html.haml b/app/views/admin/application_settings/reporting.html.haml new file mode 100644 index 00000000000..1c2d9ccdb2d --- /dev/null +++ b/app/views/admin/application_settings/reporting.html.haml @@ -0,0 +1,36 @@ +- breadcrumb_title _("Reporting") +- page_title _("Reporting") +- @content_class = "limit-container-width" unless fluid_layout + +%section.settings.as-spam.no-animate#js-spam-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Spam and Anti-bot Protection') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Enable reCAPTCHA or Akismet and set IP limits.') + .settings-content + = render 'spam' + +%section.settings.as-abuse.no-animate#js-abuse-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Abuse reports') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Set notification email for abuse reports.') + .settings-content + = render 'abuse' + +%section.settings.as-logging.no-animate#js-logging-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Error Reporting and Logging') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Enable Sentry for error reporting and logging.') + .settings-content + = render 'logging' diff --git a/app/views/admin/application_settings/repository.html.haml b/app/views/admin/application_settings/repository.html.haml new file mode 100644 index 00000000000..d8029e0c54a --- /dev/null +++ b/app/views/admin/application_settings/repository.html.haml @@ -0,0 +1,36 @@ +- breadcrumb_title _("Repository") +- page_title _("Repository") +- @content_class = "limit-container-width" unless fluid_layout + +%section.settings.as-mirror.no-animate#js-mirror-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Repository mirror') + %button.btn.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? 'Collapse' : 'Expand' + %p + = _('Configure push mirrors.') + .settings-content + = render partial: 'repository_mirrors_form' + +%section.settings.as-repository-storage.no-animate#js-repository-storage-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Repository storage') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Configure storage path and circuit breaker settings.') + .settings-content + = render 'repository_storage' + +%section.settings.as-repository-check.no-animate#js-repository-check-settings{ class: ('expanded' if expanded_by_default?) } + .settings-header + %h4 + = _('Repository maintenance') + %button.btn.btn-default.js-settings-toggle{ type: 'button' } + = expanded_by_default? ? _('Collapse') : _('Expand') + %p + = _('Configure automatic git checks and housekeeping on repositories.') + .settings-content + = render 'repository_check' diff --git a/app/views/admin/application_settings/show.html.haml b/app/views/admin/application_settings/show.html.haml index 194a8157013..e2043183a97 100644 --- a/app/views/admin/application_settings/show.html.haml +++ b/app/views/admin/application_settings/show.html.haml @@ -1,359 +1,93 @@ -- breadcrumb_title "Settings" -- page_title "Settings" +- breadcrumb_title _("Settings") +- page_title _("Settings") - @content_class = "limit-container-width" unless fluid_layout -- expanded = Rails.env.test? -%section.settings.as-visibility-access.no-animate#js-visibility-settings{ class: ('expanded' if expanded) } +%section.settings.as-visibility-access.no-animate#js-visibility-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 = _('Visibility and access controls') %button.btn.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') + = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set default and restrict visibility levels. Configure import sources and git access protocol.') .settings-content = render 'visibility_and_access' -%section.settings.as-account-limit.no-animate#js-account-settings{ class: ('expanded' if expanded) } +%section.settings.as-account-limit.no-animate#js-account-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 = _('Account and limit') %button.btn.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') + = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Session expiration, projects limit and attachment size.') .settings-content = render 'account_and_limit' -%section.settings.as-signup.no-animate#js-signup-settings{ class: ('expanded' if expanded) } +%section.settings.as-signup.no-animate#js-signup-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 = _('Sign-up restrictions') %button.btn.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') + = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Configure the way a user creates a new account.') .settings-content = render 'signup' -%section.settings.as-signin.no-animate#js-signin-settings{ class: ('expanded' if expanded) } +%section.settings.as-signin.no-animate#js-signin-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 = _('Sign-in restrictions') %button.btn.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') + = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set requirements for a user to sign-in. Enable mandatory two-factor authentication.') .settings-content = render 'signin' -%section.settings.as-terms.no-animate#js-terms-settings{ class: ('expanded' if expanded) } +%section.qa-terms-settings.settings.as-terms.no-animate#js-terms-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 = _('Terms of Service and Privacy Policy') %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') + = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Include a Terms of Service agreement and Privacy Policy that all users must accept.') .settings-content = render 'terms' -%section.settings.as-help-page.no-animate#js-help-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Help page') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Help page text and support page url.') - .settings-content - = render 'help_page' - -%section.settings.as-pages.no-animate#js-pages-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Pages') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Size and domain settings for static websites') - .settings-content - = render 'pages' - -%section.settings.as-ci-cd.no-animate#js-ci-cd-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Continuous Integration and Deployment') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Auto DevOps, runners and job artifacts') - .settings-content - = render 'ci_cd' - -%section.settings.as-influx.no-animate#js-influx-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Metrics - Influx') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Enable and configure InfluxDB metrics.') - .settings-content - = render 'influx' - -%section.settings.as-prometheus.no-animate#js-prometheus-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Metrics - Prometheus') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Enable and configure Prometheus metrics.') - .settings-content - = render 'prometheus' - -%section.settings.as-performance-bar.no-animate#js-performance-bar-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Profiling - Performance bar') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Enable the Performance Bar for a given group.') - = link_to icon('question-circle'), help_page_path('administration/monitoring/performance/performance_bar') - .settings-content - = render 'performance_bar' - -%section.settings.as-background.no-animate#js-background-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Background jobs') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Configure Sidekiq job throttling.') - .settings-content - = render 'background_jobs' - -%section.settings.as-spam.no-animate#js-spam-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Spam and Anti-bot Protection') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Enable reCAPTCHA or Akismet and set IP limits.') - .settings-content - = render 'spam' - -%section.settings.as-abuse.no-animate#js-abuse-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Abuse reports') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Set notification email for abuse reports.') - .settings-content - = render 'abuse' - -%section.settings.as-logging.no-animate#js-logging-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Error Reporting and Logging') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Enable Sentry for error reporting and logging.') - .settings-content - = render 'logging' - -%section.qa-repository-storage-settings.settings.as-repository-storage.no-animate#js-repository-storage-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Repository storage') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Configure storage path and circuit breaker settings.') - .settings-content - = render 'repository_storage' - -%section.settings.as-repository-check.no-animate#js-repository-check-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Repository maintenance') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Configure automatic git checks and housekeeping on repositories.') - .settings-content - = render 'repository_check' - -- if Gitlab.config.registry.enabled - %section.settings.as-registry.no-animate#js-registry-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Container Registry') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Various container registry settings.') - .settings-content - = render 'registry' - - if koding_enabled? - %section.settings.as-koding.no-animate#js-koding-settings{ class: ('expanded' if expanded) } + %section.settings.as-koding.no-animate#js-koding-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 = _('Koding') %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') + = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Online IDE integration settings.') .settings-content = render 'koding' -%section.settings.as-plantuml.no-animate#js-plantuml-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('PlantUML') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Allow rendering of PlantUML diagrams in Asciidoc documents.') - .settings-content - = render 'plantuml' - -%section.settings.as-usage.no-animate#js-usage-settings{ class: ('expanded' if expanded) } - .settings-header#usage-statistics - %h4 - = _('Usage statistics') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Enable or disable version check and usage ping.') - .settings-content - = render 'usage' - -%section.settings.as-email.no-animate#js-email-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Email') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Various email settings.') - .settings-content - = render 'email' - -%section.settings.as-gitaly.no-animate#js-gitaly-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Gitaly') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Configure Gitaly timeouts.') - .settings-content - = render 'gitaly' += render_if_exists 'admin/application_settings/external_authorization_service_form', expanded: expanded_by_default? -%section.settings.as-terminal.no-animate#js-terminal-settings{ class: ('expanded' if expanded) } +%section.settings.as-terminal.no-animate#js-terminal-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 = _('Web terminal') %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') + = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Set max session time for web terminal.') .settings-content = render 'terminal' -%section.settings.as-realtime.no-animate#js-realtime-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Real-time features') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Change this value to influence how frequently the GitLab UI polls for updates.') - .settings-content - = render 'realtime' - -%section.settings.as-performance.no-animate#js-performance-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Performance optimization') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Various settings that affect GitLab performance.') - .settings-content - = render 'performance' - -%section.settings.as-ip-limits.no-animate#js-ip-limits-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('User and IP Rate Limits') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Configure limits for web and API requests.') - .settings-content - = render 'ip_limits' - -%section.settings.as-outbound.no-animate#js-outbound-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Outbound requests') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Allow requests to the local network from hooks and services.') - .settings-content - = render 'outbound' - -%section.settings.as-mirror.no-animate#js-mirror-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Repository mirror') - %button.btn.js-settings-toggle{ type: 'button' } - = expanded ? 'Collapse' : 'Expand' - %p - = _('Configure push mirrors.') - .settings-content - = render partial: 'repository_mirrors_form' - -= render_if_exists 'admin/application_settings/geo', expanded: expanded - -= render_if_exists 'admin/application_settings/external_authorization_service_form', expanded: expanded - -= render_if_exists 'admin/application_settings/elasticsearch_form', expanded: expanded - -= render_if_exists 'admin/application_settings/slack', expanded: expanded - -= render_if_exists 'admin/application_settings/templates', expanded: expanded - -%section.settings.as-third-party-offers.no-animate#js-third-party-offers-settings{ class: ('expanded' if expanded) } - .settings-header - %h4 - = _('Third party offers') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') - %p - = _('Control the display of third party offers.') - .settings-content - = render 'third_party_offers', application_setting: @application_setting - -= render_if_exists 'admin/application_settings/custom_templates_form', expanded: expanded - -%section.settings.no-animate#js-web-ide-settings{ class: ('expanded' if expanded) } +%section.settings.no-animate#js-web-ide-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 = _('Web IDE') %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded ? _('Collapse') : _('Expand') + = expanded_by_default? ? _('Collapse') : _('Expand') %p = _('Manage Web IDE features') .settings-content @@ -370,5 +104,3 @@ = s_('IDE|Allow live previews of JavaScript projects in the Web IDE using CodeSandbox client side evaluation.') = f.submit _('Save changes'), class: "btn btn-success" - -= render_if_exists 'admin/application_settings/pseudonymizer_settings', expanded: expanded diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index ff25b040913..a2636f8179a 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -199,10 +199,54 @@ = sprite_icon('settings') %span.nav-item-name = _('Settings') - %ul.sidebar-sub-level-items.is-fly-out-only + + %ul.sidebar-sub-level-items = nav_link(controller: :application_settings, html_options: { class: "fly-out-top-item" } ) do = link_to admin_application_settings_path do %strong.fly-out-top-item-name = _('Settings') + %li.divider.fly-out-top-item + = nav_link(path: 'application_settings#show') do + = link_to admin_application_settings_path, title: _('General') do + %span + = _('General') + = nav_link(path: 'application_settings#integrations') do + = link_to integrations_admin_application_settings_path, title: _('Integrations') do + %span + = _('Integrations') + = nav_link(path: 'application_settings#repository') do + = link_to repository_admin_application_settings_path, title: _('Repository') do + %span + = _('Repository') + - if template_exists?('admin/application_settings/templates') + = nav_link(path: 'application_settings#templates') do + = link_to templates_admin_application_settings_path, title: _('Templates') do + %span + = _('Templates') + = nav_link(path: 'application_settings#ci_cd') do + = link_to ci_cd_admin_application_settings_path, title: _('CI/CD') do + %span + = _('CI/CD') + = nav_link(path: 'application_settings#reporting') do + = link_to reporting_admin_application_settings_path, title: _('Reporting') do + %span + = _('Reporting') + = nav_link(path: 'application_settings#metrics_and_profiling') do + = link_to metrics_and_profiling_admin_application_settings_path, title: _('Metrics and profiling') do + %span + = _('Metrics and profiling') + = nav_link(path: 'application_settings#network') do + = link_to network_admin_application_settings_path, title: _('Network') do + %span + = _('Network') + - if template_exists?('admin/application_settings/geo') + = nav_link(path: 'application_settings#geo') do + = link_to geo_admin_application_settings_path, title: _('Geo') do + %span + = _('Geo') + = nav_link(path: 'application_settings#preferences') do + = link_to preferences_admin_application_settings_path, title: _('Preferences') do + %span + = _('Preferences') = render 'shared/sidebar_toggle_button' |