Commit 03f136fc authored by Peter Leitzen's avatar Peter Leitzen Committed by Fatih Acet

Prefer usage of helper `expanded_by_default?`

Stop using `Rails.env.test?` in views.
parent 72c179ef
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
- page_title _('Kubernetes Cluster') - page_title _('Kubernetes Cluster')
- manage_prometheus_path = edit_project_service_path(@cluster.project, 'prometheus') if @project - manage_prometheus_path = edit_project_service_path(@cluster.project, 'prometheus') if @project
- expanded = Rails.env.test? - expanded = expanded_by_default?
- status_path = clusterable.cluster_status_cluster_path(@cluster.id, format: :json) if can?(current_user, :admin_cluster, @cluster) - status_path = clusterable.cluster_status_cluster_path(@cluster.id, format: :json) if can?(current_user, :admin_cluster, @cluster)
.edit-cluster-form.js-edit-cluster-form{ data: { status_path: status_path, .edit-cluster-form.js-edit-cluster-form{ data: { status_path: status_path,
......
- breadcrumb_title "General Settings" - breadcrumb_title "General Settings"
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- expanded = Rails.env.test? - expanded = expanded_by_default?
%section.settings.gs-general.no-animate#js-general-settings{ class: ('expanded') } %section.settings.gs-general.no-animate#js-general-settings{ class: ('expanded') }
......
- breadcrumb_title "CI / CD Settings" - breadcrumb_title "CI / CD Settings"
- page_title "CI / CD" - page_title "CI / CD"
- expanded = Rails.env.test? - expanded = expanded_by_default?
%section.settings#ci-variables.no-animate{ class: ('expanded' if expanded) } %section.settings#ci-variables.no-animate{ class: ('expanded' if expanded) }
.settings-header .settings-header
......
- expanded = Rails.env.test? - expanded = expanded_by_default?
%section.settings.no-animate#cleanup{ class: ('expanded' if expanded) } %section.settings.no-animate#cleanup{ class: ('expanded' if expanded) }
.settings-header .settings-header
......
- expanded = Rails.env.test? - expanded = expanded_by_default?
%section.settings.no-animate#default-branch-settings{ class: ('expanded' if expanded) } %section.settings.no-animate#default-branch-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
......
- expanded = Rails.env.test? - expanded = expanded_by_default?
%section.qa-deploy-keys-settings.settings.no-animate#js-deploy-keys-settings{ class: ('expanded' if expanded) } %section.qa-deploy-keys-settings.settings.no-animate#js-deploy-keys-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
......
- breadcrumb_title _("General Settings") - breadcrumb_title _("General Settings")
- page_title _("General") - page_title _("General")
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- expanded = Rails.env.test? - expanded = expanded_by_default?
%section.settings.general-settings.no-animate.expanded#js-general-settings %section.settings.general-settings.no-animate.expanded#js-general-settings
.settings-header .settings-header
......
- expanded = Rails.env.test? - expanded = expanded_by_default?
- protocols = Gitlab::UrlSanitizer::ALLOWED_SCHEMES.join('|') - protocols = Gitlab::UrlSanitizer::ALLOWED_SCHEMES.join('|')
%section.settings.project-mirror-settings.js-mirror-settings.no-animate.qa-mirroring-repositories-settings#js-push-remote-settings{ class: ('expanded' if expanded) } %section.settings.project-mirror-settings.js-mirror-settings.no-animate.qa-mirroring-repositories-settings#js-push-remote-settings{ class: ('expanded' if expanded) }
......
- expanded = Rails.env.test? - expanded = expanded_by_default?
%section.qa-protected-branches-settings.settings.no-animate#js-protected-branches-settings{ class: ('expanded' if expanded) } %section.qa-protected-branches-settings.settings.no-animate#js-protected-branches-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
......
- expanded = Rails.env.test? - expanded = expanded_by_default?
%section.settings.no-animate#js-protected-tags-settings{ class: ('expanded' if expanded) } %section.settings.no-animate#js-protected-tags-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- page_title _("CI / CD Settings") - page_title _("CI / CD Settings")
- page_title _("CI / CD") - page_title _("CI / CD")
- expanded = Rails.env.test? - expanded = expanded_by_default?
- general_expanded = @project.errors.empty? ? expanded : true - general_expanded = @project.errors.empty? ? expanded : true
%section.settings#js-general-pipeline-settings.no-animate{ class: ('expanded' if general_expanded) } %section.settings#js-general-pipeline-settings.no-animate{ class: ('expanded' if general_expanded) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment