Skip to content

Only load terraform banner js on project overview

Simon Knox requested to merge psi-terraform-noti into master

What does this MR do and why?

Don't load terraform banner on every page, as it is only displayed on project overview page. pages/projects/index.js is loaded on every projects/* page, but we only need this on pages/projects/show.

Screenshots or screen recordings

no visual changes

Screenshot_2023-02-14_at_5.02.08_pm

How to set up and validate locally

  1. Add a .tf file to a new project and go to project overview page

or, apply this little diff

diff --git a/app/views/projects/_terraform_banner.html.haml b/app/views/projects/_terraform_banner.html.haml
index 881e4ccd9df3..46d351f0f9d2 100644
--- a/app/views/projects/_terraform_banner.html.haml
+++ b/app/views/projects/_terraform_banner.html.haml
@@ -1,5 +1,4 @@
 - @content_class = "container-limited limit-container-width" unless fluid_layout
 
-- if show_terraform_banner?(project)
-  .container-fluid{ class: @content_class }
-    .js-terraform-notification{ data: { terraform_image_path: image_path('illustrations/third-party-logos/ci_cd-template-logos/terraform.svg') } }
+.container-fluid{ class: @content_class }
+  .js-terraform-notification{ data: { terraform_image_path: image_path('illustrations/third-party-logos/ci_cd-template-logos/terraform.svg') } }

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Simon Knox

Merge request reports