Skip to content
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

Refactor ATI analytics component #5743

Open
jroebu14 opened this issue Mar 3, 2020 · 2 comments
Open

Refactor ATI analytics component #5743

jroebu14 opened this issue Mar 3, 2020 · 2 comments
Labels
Refinement Needed This is ready for refinement. It shouldn't be worked on until it has been refined by Dev & Test. technical-work Technical debt, support work and building new technical tools and features

Comments

@jroebu14
Copy link

jroebu14 commented Mar 3, 2020

We should refactor the ATI analytics component API to accept the minimal props it needs in order to function. We should remove page type conditional logic from the component and each page type should pick and pass down the props from the page data. We should pick the props we need in each page type's getInitialData function.

If we do all this then we can remove all of the duplicated page type splitting param building logic https://github.com/bbc/simorgh/tree/latest/src/app/containers/ATIAnalytics/params

We will also have the ability to pass page components only what they need instead of passing down the full Ares/Optimo response which means having to define prop types for the full response e.g. https://github.com/bbc/simorgh/blob/latest/src/app/models/propTypes/metadata/index.js which makes for hard to follow prop type documentation, includes many prop names that don't make much sense in the context of the component API and includes many props we don't use. An example of passing a page component only what it needs can be found here https://github.com/bbc/simorgh/pull/5566/files

@jroebu14 jroebu14 added ws-articles Tasks for the WS Articles Team ws-home ws-media World Service Media labels Mar 3, 2020
@jroebu14 jroebu14 added the Refinement Needed This is ready for refinement. It shouldn't be worked on until it has been refined by Dev & Test. label Mar 3, 2020
@joshcoventry joshcoventry added cross-team For visibility for both World Service teams (Engage & Media) technical-work Technical debt, support work and building new technical tools and features and removed ws-articles Tasks for the WS Articles Team ws-media World Service Media labels Jul 22, 2020
@joshcoventry joshcoventry removed the cross-team For visibility for both World Service teams (Engage & Media) label Aug 11, 2021
@joshcoventry
Copy link
Contributor

Related: #4738

@andrewscfc
Copy link
Contributor

This component is known to be complex and messy. We move the logic behind the BFF and reduce our bundlesize and hydrate a slimmed own analytics component from the BFF view model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refinement Needed This is ready for refinement. It shouldn't be worked on until it has been refined by Dev & Test. technical-work Technical debt, support work and building new technical tools and features
Projects
None yet
Development

No branches or pull requests

5 participants