Refactor ATI analytics component #5743
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
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
The text was updated successfully, but these errors were encountered: