Skip to content

Commit

Permalink
Merge branch 'WORLDSERVICE-79-enable-reverb-on-live-pidgin' of github…
Browse files Browse the repository at this point in the history
….com:bbc/simorgh into WORLDSERVICE-79-enable-reverb-on-live-pidgin
  • Loading branch information
alex-magana committed Feb 7, 2025
2 parents 7593d5b + 7464b9b commit 6718130
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 75 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/pages/articles/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const nonSmokeCanonicalTestSuites = [
},
];

const canonicalTestSuites = Cypress.env.SMOKE
const canonicalTestSuites = Cypress.env('SMOKE')
? smokeCanonicalTestSuites
: nonSmokeCanonicalTestSuites;

Expand Down
1 change: 1 addition & 0 deletions src/app/components/MediaLoader/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type PlayerConfig = {
insideIframe?: boolean;
embeddedOffsite?: boolean;
externalEmbedUrl?: string;
superResponsive?: boolean;
statsObject: {
clipPID?: string | null;
episodePID?: string | null;
Expand Down
10 changes: 10 additions & 0 deletions src/app/components/MediaLoader/utils/buildSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe('buildSettings', () => {
appName: 'news-serbian',
appType: 'responsive',
counterName: 'live_coverage.testID.page',
superResponsive: true,
playlistObject: {
title:
"BBC launch trailer for We Know Our Place women's sport campaign",
Expand Down Expand Up @@ -158,6 +159,7 @@ describe('buildSettings', () => {
appName: 'news-serbian',
appType: 'responsive',
counterName: 'live_coverage.testID.page',
superResponsive: true,
playlistObject: {
title: 'Five things ants can teach us about management',
summary: 'This is a caption!',
Expand Down Expand Up @@ -224,6 +226,7 @@ describe('buildSettings', () => {
appName: 'news-serbian',
appType: 'responsive',
counterName: 'live_coverage.testID.page',
superResponsive: true,
playlistObject: {
title: 'Five things ants can teach us about management',
summary: 'This is a caption!',
Expand Down Expand Up @@ -292,6 +295,7 @@ describe('buildSettings', () => {
appName: 'news-serbian',
appType: 'responsive',
counterName: 'live_coverage.testID.page',
superResponsive: true,
externalEmbedUrl:
'https://www.bbc.com/serbian/lat/av-embeds/srbija-68707945/vpid/bbc_arabic_tv',
playlistObject: {
Expand Down Expand Up @@ -349,6 +353,7 @@ describe('buildSettings', () => {
appName: 'news-arabic',
appType: 'responsive',
counterName: 'arabic.multimedia.2013.12.131208_iraq_blast_.page',
superResponsive: true,
playlistObject: {
title: 'Legacy Media Page Title',
holdingImageURL:
Expand Down Expand Up @@ -700,6 +705,7 @@ describe('buildSettings', () => {
autoplay: false,
appName: 'news-hindi',
counterName: 'hindi.bbc_hindi_tv.tv.w172zm8920nck2z.page',
superResponsive: true,
statsObject: {
destination: 'WS_NEWS_LANGUAGES',
producer: 'HINDI',
Expand Down Expand Up @@ -874,6 +880,7 @@ describe('buildSettings', () => {
appType: 'responsive',
autoplay: false,
counterName: 'hausa.bbc_hausa_radio.liveradio.page',
superResponsive: true,
playlistObject: {
items: [
{
Expand Down Expand Up @@ -956,6 +963,7 @@ describe('buildSettings', () => {
autoplay: false,
appName: 'news-afrique',
counterName: 'afrique.bbc_afrique_radio.w172zn0kxd65h3g.page',
superResponsive: true,
statsObject: {
destination: 'WS_NEWS_LANGUAGES',
producer: 'AFRIQUE',
Expand Down Expand Up @@ -1081,6 +1089,7 @@ describe('buildSettings', () => {
autoplay: false,
counterName: 'live_coverage.c7dkx155e626t.page',
enableToucan: true,
superResponsive: true,
playlistObject: {
holdingImageURL:
'https://ichef.bbci.co.uk/images/ic/$recipe/p0k31t4d.jpg',
Expand Down Expand Up @@ -1180,6 +1189,7 @@ describe('buildSettings', () => {
autoplay: false,
counterName: 'live_coverage.cvp5r6m6mgpt.page',
enableToucan: true,
superResponsive: true,
playlistObject: {
holdingImageURL:
'https://ichef.bbci.co.uk/images/ic/$recipe/p08b23t4.png',
Expand Down
1 change: 1 addition & 0 deletions src/app/components/MediaLoader/utils/buildSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const buildSettings = ({
subtitles: { enabled: true, defaultOn: true },
fullscreen: { enabled: true },
},
...(!embedded && { superResponsive: true }),
...(counterName && { counterName }),
...(isTestRequested() && { mediator: { host: 'open.test.bbc.co.uk' } }),
statsObject: {
Expand Down
16 changes: 16 additions & 0 deletions src/app/lib/config/services/afaanoromoo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,26 @@ export const service: DefaultServiceConfig = {
title: 'Itoophiyaa',
url: '/afaanoromoo/topics/c2dwqdy81y1t',
},
{
title: 'Ispoortii',
url: '/afaanoromoo/topics/c06gq6440j8t',
},
{
title: 'Viidiyoo',
url: '/afaanoromoo/topics/ck0dg7dpjwwt',
},
{
title: 'Siyaasa',
url: '/afaanoromoo/topics/c2dwqdynwwrt',
},
{
title: 'Dubartoota',
url: '/afaanoromoo/topics/c8y94yq185dt',
},
{
title: 'Baha Jidduugalaa',
url: '/afaanoromoo/topics/c8y94yzd049t',
},
{
title: 'Jajjaboo',
url: '/afaanoromoo/popular/read',
Expand Down
67 changes: 4 additions & 63 deletions src/app/pages/ArticlePage/ArticlePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
/* @jsxFrag React.Fragment */
import React, { useContext } from 'react';
import { useContext } from 'react';
import { jsx, useTheme } from '@emotion/react';
import useToggle from '#hooks/useToggle';
import { singleTextBlock } from '#app/models/blocks';
Expand Down Expand Up @@ -44,11 +44,6 @@ import {
Recommendation,
} from '#app/models/types/optimo';
import ScrollablePromo from '#components/ScrollablePromo';
import JumpTo, { JumpToProps, Variation } from '#app/components/JumpTo';
import useOptimizelyVariation from '#app/hooks/useOptimizelyVariation';
import OptimizelyArticleCompleteTracking from '#app/legacy/containers/OptimizelyArticleCompleteTracking';
import OptimizelyPageViewTracking from '#app/legacy/containers/OptimizelyPageViewTracking';
import OPTIMIZELY_CONFIG from '#app/lib/config/optimizely';
import ElectionBanner from './ElectionBanner';
import ImageWithCaption from '../../components/ImageWithCaption';
import AdContainer from '../../components/Ad';
Expand Down Expand Up @@ -120,29 +115,6 @@ const DisclaimerWithPaddingOverride = (props: ComponentToRenderProps) => (
const getPodcastPromoComponent = (podcastPromoEnabled: boolean) => () =>
podcastPromoEnabled ? <InlinePodcastPromo /> : null;

const getJumptoComponent =
(
optimizelyVariation: Variation | 'off',
hasJumpToBlockForExperiment: boolean,
showRelatedContent: boolean,
) =>
(props: ComponentToRenderProps & JumpToProps) => {
if (
optimizelyVariation === 'off' ||
!optimizelyVariation ||
!hasJumpToBlockForExperiment
)
return null;

return (
<JumpTo
{...props}
showRelatedContentLink={showRelatedContent}
variation={optimizelyVariation}
/>
);
};

const ArticlePage = ({ pageData }: { pageData: Article }) => {
const { isApp, pageType, service } = useContext(RequestContext);

Expand Down Expand Up @@ -203,26 +175,9 @@ const ArticlePage = ({ pageData }: { pageData: Article }) => {
mostRead: mostReadInitialData,
} = pageData;

const optimizelyVariation = useOptimizelyVariation(
OPTIMIZELY_CONFIG.flagKey,
) as unknown as Variation | 'off';

const hasJumpToBlockForExperiment = blocks.some(
block => block.type === 'jumpTo',
);

const enableOptimizelyEventTracking = Boolean(
optimizelyVariation && hasJumpToBlockForExperiment,
);

const showRelatedContent = blocks.some(
block => block.type === 'relatedContent',
);

const atiData = {
...atiAnalytics,
...(isCPS && { pageTitle: `${atiAnalytics.pageTitle} - ${brandName}` }),
...(optimizelyVariation && { experimentVariant: optimizelyVariation }),
};

const componentsToRender = {
Expand Down Expand Up @@ -251,11 +206,6 @@ const ArticlePage = ({ pageData }: { pageData: Article }) => {
wsoj: getWsojComponent(recommendationsData),
disclaimer: DisclaimerWithPaddingOverride,
podcastPromo: getPodcastPromoComponent(podcastPromoEnabled),
jumpTo: getJumptoComponent(
optimizelyVariation,
hasJumpToBlockForExperiment,
showRelatedContent,
),
};

const visuallyHiddenBlock = {
Expand Down Expand Up @@ -350,14 +300,11 @@ const ArticlePage = ({ pageData }: { pageData: Article }) => {
)}
<RelatedContentSection
content={blocks}
sendOptimizelyEvents={enableOptimizelyEventTracking}
sendOptimizelyEvents={false}
/>
</div>
{!isApp && !isPGL && (
<SecondaryColumn
pageData={pageData}
sendOptimizelyEvents={enableOptimizelyEventTracking}
/>
<SecondaryColumn pageData={pageData} sendOptimizelyEvents={false} />
)}
</div>
{!isApp && !isPGL && (
Expand All @@ -368,15 +315,9 @@ const ArticlePage = ({ pageData }: { pageData: Article }) => {
size="default"
headingBackgroundColour={GREY_2}
mobileDivider={showTopics}
sendOptimizelyEvents={enableOptimizelyEventTracking}
sendOptimizelyEvents={false}
/>
)}
{enableOptimizelyEventTracking && (
<>
<OptimizelyArticleCompleteTracking />
<OptimizelyPageViewTracking />
</>
)}
</div>
);
};
Expand Down
7 changes: 0 additions & 7 deletions src/app/pages/ArticlePage/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ jest.mock('../../components/ChartbeatAnalytics', () => {
return ChartbeatAnalytics;
});
jest.mock('../../components/ATIAnalytics');
jest.mock('#app/legacy/containers/OptimizelyArticleCompleteTracking');
jest.mock('#app/legacy/containers/OptimizelyPageViewTracking');

jest.mock('#app/hooks/useOptimizelyVariation', () => ({
__esModule: true,
default: jest.fn(),
}));

const input = {
bbcOrigin: 'https://www.test.bbc.co.uk',
Expand Down
5 changes: 1 addition & 4 deletions src/app/pages/ArticlePage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import withOptimizelyProvider from '#app/legacy/containers/PageHandlers/withOptimizelyProvider';
import ArticlePage from './ArticlePage';
import applyBasicPageHandlers from '../utils/applyBasicPageHandlers';

const OptimizelyArticle = withOptimizelyProvider(ArticlePage);

export default applyBasicPageHandlers(OptimizelyArticle);
export default applyBasicPageHandlers(ArticlePage);

0 comments on commit 6718130

Please sign in to comment.