-
Notifications
You must be signed in to change notification settings - Fork 262
WS-1943-Create route in Simorgh to render Topic pages in Next.js app #13593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: latest
Are you sure you want to change the base?
WS-1943-Create route in Simorgh to render Topic pages in Next.js app #13593
Conversation
| page, | ||
| service, | ||
| variant, | ||
| rendererEnv, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would maybe retain similar behaviour to the current implementation here:
simorgh/src/app/routes/topic/getInitialData/index.js
Lines 11 to 21 in 1e35675
| const overrideRendererEnv = pathname => { | |
| if (isTest()) { | |
| const url = Url(pathname, true); | |
| if (!url.query.renderer_env) { | |
| url.query.renderer_env = 'live'; | |
| } | |
| return url.toString(); | |
| } | |
| return pathname; | |
| }; |
Not necessarily exactly this, but something like:
- if isTest AND no renderer_env then renderer_env = 'live'
- else
- use rendererEnv from context.query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unique to topics, so just want to make sure we don't break e2es or anything by omitting this behaviour as it stands.
| | **Nepali** | [Article](http://localhost:7081/nepali/articles/cl90j9m3mn6o)<br />[Home](http://localhost:7080/nepali)<br />[Live Radio](http://localhost:7080/nepali/bbc_nepali_radio/liveradio)<br />[MAP](http://localhost:7081/nepali/media-23269034)<br />[TC2 MAP](http://localhost:7081/nepali/multimedia/2016/07/160725_tc2_testmap1)<br />[Most Read](http://localhost:7080/nepali/popular/read)<br />[On Demand Audio (Brand)](http://localhost:7080/nepali/bbc_nepali_radio/w172x83pnptp1s8)<br />[Podcast (Episode)](http://localhost:7080/nepali/podcasts/p02pc9w3/p086v2bv)<br />[Podcast (Brand)](http://localhost:7080/nepali/podcasts/p02pc9w3)<br />[PGL](http://localhost:7081/nepali/news-50627370)<br />[Topic](http://localhost:7080/nepali/topics/cp2d78r6qppt) | [Article](https://www.test.bbc.com/nepali/articles/cl90j9m3mn6o)<br />[Home](https://www.test.bbc.com/nepali)<br />[Live Radio](https://www.test.bbc.com/nepali/bbc_nepali_radio/liveradio?renderer_env=live)<br />[MAP](https://www.test.bbc.com/nepali/media-23269034)<br />[TC2 MAP](https://www.test.bbc.com/nepali/multimedia/2016/07/160725_tc2_testmap1)<br />[Most Read](https://www.test.bbc.com/nepali/popular/read)<br />[On Demand Audio (Brand)](https://www.test.bbc.com/nepali/bbc_nepali_radio/programmes/p0340xzt)<br />[On Demand Audio (Episode)](https://www.test.bbc.com/nepali/bbc_nepali_radio/w172xzcfvptk838)<br />[Podcast (Episode)](https://www.test.bbc.com/nepali/podcasts/p02pc9w3/p09j0dm5)<br />[Podcast (Brand)](https://www.test.bbc.com/nepali/podcasts/p02pc9w3)<br />[PGL](https://www.test.bbc.com/nepali/news-23093383)<br />[STY](https://www.test.bbc.com/nepali/23210795)<br />[Topic](https://www.test.bbc.com/nepali/topics/cp2d78r6qppt) | [Article](https://www.bbc.com/nepali/articles/c16ljg1v008o)<br />[Home](https://www.bbc.com/nepali)<br />[Live Radio](https://www.bbc.com/nepali/bbc_nepali_radio/liveradio)<br />[MAP](https://www.bbc.com/nepali/news-51675223)<br />[TC2 MAP](https://www.bbc.com/nepali/multimedia/2013/08/130806_boudhavideo)<br />[Most Read](https://www.bbc.com/nepali/popular/read)<br />[On Demand Audio (Brand)](https://www.bbc.com/nepali/bbc_nepali_radio/programmes/p0340xzt)<br />[On Demand Audio (Episode)](https://www.bbc.com/nepali/bbc_nepali_radio/w172xzcfvptk838)<br />[Podcast (Episode)](https://www.bbc.com/nepali/podcasts/p02pc9w3/p09j0dm5)<br />[Podcast Brand)](https://www.bbc.com/nepali/podcasts/p02pc9w3)<br />[PGL](https://www.bbc.com/nepali/news-50627370)<br />[STY](https://www.bbc.com/nepali/news-53409873)<br />[Topic](https://www.bbc.com/nepali/topics/cp2d78r6qppt) | | ||
| | **News** | [Article](http://localhost:7081/news/articles/cn7k01xp8kxo.amp)<br />[STY](http://localhost:7081/news/uk-56342465.amp)<br />[STY 2](http://localhost:7081/news/technology-56294493.amp) | [Article](https://www.test.bbc.com/news/articles/cn7k01xp8kxo.amp)<br />[STY](https://www.test.bbc.com/news/23393110.amp) | [Article](https://www.bbc.com/news/articles/cj7xrxz0e8zo.amp)<br />[STY](https://www.bbc.com/news/uk-56342465.amp)<br />[STY 2](https://www.bbc.com/news/technology-56294493.amp) | | ||
| | **Newsround** | [STY](http://localhost:7081/newsround/56331357.amp) | [STY](https://www.test.bbc.com/newsround/23212028.amp) | [STY](https://www.bbc.com/newsround/56331357.amp) | | ||
| | **Pashto** | [Article](http://localhost:7081/pashto/articles/cyjmdl92z3ro)<br />[Home](http://localhost:7080/pashto)<br />[Live Radio](http://localhost:7080/pashto/bbc_pashto_radio/liveradio)<br />[MAP](http://localhost:7081/pashto/media-23257523)<br />[TC2 MAP](http://localhost:7081/pashto/world/2016/09/160921_tc2_testmap1)<br />[Most Read](http://localhost:7080/pashto/popular/read)<br />[On Demand Audio (Brand)](http://localhost:7080/pashto/bbc_pashto_radio/w3ct0lz1)<br />[On Demand TV (Brand)](http://localhost:7080/pashto/bbc_pashto_tv/tv_programmes/w13xttn4)<br />[On Demand TV (Episode)](http://localhost:7080/pashto/bbc_pashto_tv/tv/w172xcldhhrhmcf)<br />[PGL](http://localhost:7081/pashto/arts-and-literature-50230813)<br />[STY](http://localhost:7081/pashto/23289748)<br />[Topic](http://localhost:7080/pashto/topics/cr50y57xj52t) | [Article](https://www.test.bbc.com/pashto/articles/cyjmdl92z3ro)<br />[Home](https://www.test.bbc.com/pashto)<br />[Live Radio](https://www.test.bbc.com/pashto/bbc_pashto_radio/liveradio?renderer_env=live)<br />[MAP](https://www.test.bbc.com/pashto/media-23257523)<br />[TC2 MAP](https://www.test.bbc.com/pashto/world/2016/09/160921_tc2_testmap1)<br />[Most Read](https://www.test.bbc.com/pashto/popular/read)<br />[On Demand Audio (Brand)](https://www.test.bbc.com/pashto/bbc_pashto_radio/programmes/p0340ysc)<br />[On Demand Audio (Episode)](https://www.test.bbc.com/pashto/bbc_pashto_radio/w3ct26m6)<br />[On Demand TV (Brand)](https://www.test.bbc.com/pashto/bbc_pashto_tv/tv_programmes/w13xttn4)<br />[On Demand TV (Episode)](https://www.test.bbc.com/pashto/bbc_pashto_tv/tv/w172xtq7x8660m1)<br />[PGL](https://www.test.bbc.com/pashto/23092924)<br />[STY](https://www.test.bbc.com/pashto/23289748)<br />[Topic](https://www.test.bbc.com/pashto/topics/cr50y57xj52t) | [Article](https://www.bbc.com/pashto/articles/c70970g2251o)<br />[Home](https://www.bbc.com/pashto)<br />[Live Radio](https://www.bbc.com/pashto/bbc_pashto_radio/liveradio)<br />[MAP](https://www.bbc.com/pashto/arts-and-literature-46787030)<br />[TC2 MAP](https://www.bbc.com/pashto/multimedia/2016/08/160827_gn_southafrica_female_farmer)<br />[Most Read](https://www.bbc.com/pashto/popular/read)<br />[On Demand Audio (Brand)](https://www.bbc.com/pashto/bbc_pashto_radio/programmes/p0340yr4)<br />[On Demand Audio (Episode)](https://www.bbc.com/pashto/bbc_pashto_radio/w3ct26m6)<br />[On Demand TV (Brand)](https://www.bbc.com/pashto/bbc_pashto_tv/tv_programmes/w13xttn4)<br />[On Demand TV (Episode)](https://www.bbc.com/pashto/bbc_pashto_tv/tv/w172xtq7x8660m1)<br />[PGL](https://www.bbc.com/pashto/arts-and-literature-50230813)<br />[STY](https://www.bbc.com/pashto/world-52873295)<br />[Topic](https://www.bbc.com/pashto/topics/cr50y57xj52t) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit of pain but may also be worth updating these localhost:7080 references to localhost:7081 for topics routes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry just wanting clarity, would 7080 not work? Or is it because once we've fully migrated to NextJS the port will be 7081?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7081 will be the new port number for Topics pages after this change. Technically it'll still work on 7080 until we remove the old Express app code, but I think we should direct people to the new port now.
| @@ -0,0 +1,81 @@ | |||
| import { GetServerSideProps } from 'next'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a test for this file as well? Similar pattern to the handleHomepageRoute and handleArticlePageRoute
Resolves JIRA: https://bbc.atlassian.net/browse/WS-1943
Summary
Created new route in Simorgh to render topic pages in NextJS app
Code changes
Developer Checklist
Testing
Ready-For-Test, Local)Ready-For-Test, Test)Ready-For-Test, Preview)Ready-For-Test, Live)Additional Testing Steps
Useful Links