Skip to content

refactor: Layouts Improvement MVC-1

Closes #3412 (closed)

What is changing in this MR?

Refactor Layout files to improve and apply the SOLID principles in these Layouts (Single Responsibility and Interface Segregation)

  • LayoutMetadataMixin: This mixin generates all metadata content including the validation and canonical path generation of the page that uses this mixin.
  • AosAnimationMixin: Intializes the AOS animation module
  • SearchEventMixin: Instantiates the searchListener, it has been implemented in the NavigationHOC component
  • generateLayoutMeta: This Method generates the metadata necessary for Layout pages, it generates the canonical path and the HTML lang attribute.

How to test?

  • Layouts that have the LayoutMetadataMixin should have a script under the head of the HTML page similar to <link data-n-head="ssr" rel="canonical" href="https://about.gitlab.com/sales/">
  • Layouts that have the AosAnimationMixin should have animations working.
  • Layouts that use the NavigationHOC component should have the search feature working as expected.

Review Apps

Layout Review Apps Production Mixins/Methods Added
code-suggestions-sale CS Sales Sales Prod generateLayoutMeta, AosAnimation
custom-pages Upgrade Upgrade Prod generateLayoutMeta
default Enterprise Enterprise Prod generateLayoutMeta, AosAnimation
free-trial-navigation Free Trial Devsecops Enterprise Prod generateLayoutMeta, AosAnimation
solutions-page Solutions Compliance Enterprise Prod generateLayoutMeta, AosAnimation
summit-navigation Summit Las Vegas Summit Las Vegas Prod generateLayoutMeta, AosAnimation
Edited by John Arias Castillo

Merge request reports