From 3d775064e71d1ab17dc53fc14fb87af4100d6276 Mon Sep 17 00:00:00 2001 From: mikolajmeller Date: Wed, 9 Dec 2020 09:13:30 +0100 Subject: [PATCH 1/2] SER-4524 show search scope toggle for all users on UCP wikis --- app/components/site-head.js | 17 +++-------------- app/templates/components/site-head.hbs | 1 - 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/app/components/site-head.js b/app/components/site-head.js index 1fa40c53c84..2b1a3fc8718 100644 --- a/app/components/site-head.js +++ b/app/components/site-head.js @@ -2,12 +2,10 @@ import Component from '@ember/component'; import { equal, readOnly } from '@ember/object/computed'; import { run } from '@ember/runloop'; import { inject as service } from '@ember/service'; -import { communicationService } from '../modules/ads/communication/communication-service'; import HeadroomMixin from '../mixins/headroom'; import { standalone } from '../utils/browser'; import { track, trackActions } from '../utils/track'; import Ads from '../modules/ads'; -import { isType } from '../modules/ads/communication/is-type'; export default Component.extend( HeadroomMixin, @@ -57,19 +55,10 @@ export default Component.extend( }, setExperimentFlags() { + // Hacky way to distinct UCP and App wikis as enableHydraFeatures is available only on UCP const isUcpWiki = this.get('wikiVariables.enableHydraFeatures') !== undefined; - const currentUser = this.currentUser; - const isAuthenticated = currentUser.get('isAuthenticated'); - if (!isAuthenticated && isUcpWiki) { - communicationService.addListener((action) => { - if (isType(action, '[AdEngine] set InstantConfig')) { - const defaultScope = action.payload.get('icServicesMobileSearchScopeDropdown'); - if (defaultScope) { - this.set('showSearchScope', true); - this.set('defaultSearchScope', defaultScope); - } - } - }); + if (isUcpWiki) { + this.set('showSearchScope', true); } }, diff --git a/app/templates/components/site-head.hbs b/app/templates/components/site-head.hbs index 19c7c10ac97..ced3d63c731 100644 --- a/app/templates/components/site-head.hbs +++ b/app/templates/components/site-head.hbs @@ -13,7 +13,6 @@ @model={{this.globalNavigation}} @sitename={{this.communityHeader.sitename}} @showSearchScope={{this.showSearchScope}} - @defaultSearchScope={{this.defaultSearchScope}} @canShowContentRecommendations={{this.canShowContentRecommendations}} @track={{action this.track}} @onModalOpen={{action this.onModalOpen}} From fcb82a1f36ee622c187ce83a3825a2e78ec38d5a Mon Sep 17 00:00:00 2001 From: mikolajmeller Date: Wed, 9 Dec 2020 09:41:08 +0100 Subject: [PATCH 2/2] Test with proper design-system version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d118ba53e88..9cd3b658e84 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "compression": "1.7.4", "cors": "2.8.5", "deep-extend": "0.6.0", - "design-system": "git://github.com/Wikia/design-system.git#23.17.0", + "design-system": "git://github.com/Wikia/design-system.git#SER-4524", "ember-cli-dependency-lint": "1.1.3", "ember-hammer": "github:wikia/ember-hammer#6fdd246fd6fe70594be59186e3b3f6068ed91fd6", "ember-maybe-import-regenerator-for-testing": "1.0.0",