From 4084c884de345be075099439ea55b0abe60a782a Mon Sep 17 00:00:00 2001 From: Charlotte Emms <43961396+cemms1@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:01:43 +0100 Subject: [PATCH] remove header-top-nav switch (#27067) --- common/app/conf/switches/FeatureSwitches.scala | 10 ---------- common/app/html/HtmlPage.scala | 3 +-- .../javascripts/bootstraps/standard/main.js | 18 ++++++++---------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/common/app/conf/switches/FeatureSwitches.scala b/common/app/conf/switches/FeatureSwitches.scala index 8c90a656a78..a51b16793ed 100644 --- a/common/app/conf/switches/FeatureSwitches.scala +++ b/common/app/conf/switches/FeatureSwitches.scala @@ -473,16 +473,6 @@ trait FeatureSwitches { exposeClientSide = false, ) - val headerTopNav = Switch( - SwitchGroup.Feature, - "header-top-nav", - "When ON, the header has a thin top bar above containing relevant links", - owners = group(Feature), - safeState = On, - sellByDate = never, - exposeClientSide = true, - ) - val Callout = Switch( SwitchGroup.Feature, "callouts", diff --git a/common/app/html/HtmlPage.scala b/common/app/html/HtmlPage.scala index 38710e80b1f..2429c42cb6e 100644 --- a/common/app/html/HtmlPage.scala +++ b/common/app/html/HtmlPage.scala @@ -8,7 +8,6 @@ import views.html.stacked import views.html.fragments._ import views.html.fragments.page.body._ import views.support.Commercial -import conf.switches.Switches trait HtmlPage[P <: model.Page] { def html(page: P)(implicit request: RequestHeader, applicationContext: ApplicationContext): Html @@ -31,7 +30,7 @@ object HtmlPageHelpers { .isAdFree(request) val headerContent: Html = stacked( commercial.topBanner() when showTop && showAds, - if (Switches.headerTopNav.isSwitchedOn && !page.metadata.hasSlimHeader) headerTopNav() else header() when showTop, + if (!page.metadata.hasSlimHeader) headerTopNav() else header() when showTop, ) bannerAndHeaderDiv(headerContent) } diff --git a/static/src/javascripts/bootstraps/standard/main.js b/static/src/javascripts/bootstraps/standard/main.js index 01fba90bc2c..67e8466d8ef 100644 --- a/static/src/javascripts/bootstraps/standard/main.js +++ b/static/src/javascripts/bootstraps/standard/main.js @@ -38,11 +38,11 @@ const showHiringMessage = () => { if (!config.get('page.isDev') && config.get('switches.weAreHiring')) { window.console.log( '\n' + - '%cHello.\n' + - '\n' + - '%cWe are hiring – ever thought about joining us? \n' + - '%chttps://workforus.theguardian.com/careers/product-engineering%c \n' + - '\n', + '%cHello.\n' + + '\n' + + '%cWe are hiring – ever thought about joining us? \n' + + '%chttps://workforus.theguardian.com/careers/product-engineering%c \n' + + '\n', 'font-family: Georgia, serif; font-size: 32px; color: #052962', 'font-family: Georgia, serif; font-size: 16px; color: #767676', 'font-family: Helvetica Neue, sans-serif; font-size: 11px; text-decoration: underline; line-height: 1.2rem; color: #767676', @@ -73,8 +73,8 @@ const addScrollHandler = () => { 'scroll', userPrefs.get('use-idle-callback') && 'requestIdleCallback' in window ? () => { - window.requestIdleCallback(onScroll); - } + window.requestIdleCallback(onScroll); + } : onScroll, { passive: true } ); @@ -162,9 +162,7 @@ const bootStandard = () => { ophan.setEventEmitter(mediator); - if(window.guardian.config.switches.headerTopNav - && document.querySelector('.header-top-nav') - ) { + if (document.querySelector('.header-top-nav')) { headerTopNavInit(); } else { newHeaderInit();