bbc / simorgh

The BBC's Open Source Web Application. Contributions welcome! Used on some of our biggest websites, e.g.
https://www.bbc.com/thai
Other
1.39k stars 219 forks source link

WSTEAM1-1034 Implement UX/UI for Uzbek scriptLink #11905

Closed emilysaffron closed 2 weeks ago

emilysaffron commented 3 weeks ago

Resolves JIRA WSTEAM1-1034

Overall changes

Adds logic to only render the scriptLink button if the article is published through optimo and translations exist for it.

Code changes

Testing

  1. Visit http://localhost:7080/uzbek/articles/cxj3rjxm6r0o/lat and observe the scriptLink button, test it works. Comment out the translations for the script link here and observe the button no longer being rendered
  2. Visit http://localhost:7080/uzbek/uzbekistan-53263099 and observe there being no button rendered

Helpful Links

Add Links to useful resources related to this PR if applicable.

Coding Standards

Repository use guidelines

amoore108 commented 3 weeks ago

I think the logic will need to be a bit more specific, like:

  if (scriptLink && renderScriptSwitch) {
    if (service === 'uzbek' && pageType !== ARTICLE_PAGE) return false;

    return true;
  }

  return false;

Would be good to have extra tests in place for all these conditions to ensure it doesn't render when its not suppose to.

amoore108 commented 2 weeks ago

Just checking are translations being added in this or as a follow up PR?

emilysaffron commented 2 weeks ago

Just checking are translations being added in this or as a follow up PR?

Yeah , have asked editorial for translations here and figured they could add them themselves as they're fairly confident editing the config files 😊

karinathomasbbc commented 2 weeks ago

Are there plans in a future PR to add a cypress test for script switch behaviour on article pages?

emilysaffron commented 2 weeks ago

Are there plans in a future PR to add a cypress test for script switch behaviour on article pages?

Im not sure, i dont think so? could add one as part of this or write a follow up ticket?