Skip to content

Commit

Permalink
add names of hidden containers to ophan record fn
Browse files Browse the repository at this point in the history
  • Loading branch information
cemms1 committed May 23, 2024
1 parent 3e6c577 commit 3485461
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions dotcom-rendering/src/components/ShowHideContainers.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ const getContainerStates = (): ContainerStates => {
* - If they have previously hidden containers and subsequently undone this action, this will be logged as 0
* - If a user has never interacted with the show/hide feature, no calls to Ophan will be made
*/
if (Object.keys(item).length) {
const hiddenContainers = Object.values(item).filter(
(value) => value === 'closed',
).length;
const containerConfigArr = Object.entries(item);

if (containerConfigArr.length) {
const hiddenContainers = containerConfigArr.filter(
([_, value]) => value === 'closed',

Check failure on line 31 in dotcom-rendering/src/components/ShowHideContainers.importable.tsx

View workflow job for this annotation

GitHub Actions / lint / check

'_' is defined but never used
);

void getOphan('Web').then((ophan) => {
ophan.record({
component: 'front-containers-hidden',
value: hiddenContainers,
component: 'front-containers-show-hide',
value: {
numHidden: hiddenContainers.length,
containersHidden: hiddenContainers.map(([c]) => c),
},
});
});
}
Expand Down

0 comments on commit 3485461

Please sign in to comment.