-
Notifications
You must be signed in to change notification settings - Fork 2
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
Austenem/CAT-1113 Add list metrics #3689
Austenem/CAT-1113 Add list metrics #3689
Conversation
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 like the standardization, but have some mild concerns about how the new hook is defined.
function useHandleSaveEntity({ entityUUID }: { entityUUID: string }) { | ||
const { | ||
entity: { entity_type }, | ||
} = useFlaskDataContext(); | ||
const [entityData] = useEntitiesData([entityUUID], ['hubmap_id']); | ||
|
||
return useCallback(() => { | ||
handleSaveEntities({ entityUUIDs: new Set([entityUUID]) }).catch((error) => { | ||
console.error(error); | ||
}); | ||
|
||
if (!entityData?.length) { | ||
return; | ||
} | ||
|
||
trackEvent({ | ||
category: SavedListsEventCategories.EntityDetailPage(entity_type), | ||
action: 'Save Entity to Items', | ||
label: entityData[0].hubmap_id, | ||
}); | ||
}, [entityUUID, entityData, entity_type]); | ||
} |
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 this be defined outside of the useListSavedListsAndEntities
hook, i.e. as its own hook? Since running this function instantiates new hook calls, calling this function at runtime could cause errors related to varying numbers of hooks per render.
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.
🚀
* add ukv endpoint * pull authenticated lists into my lists page * implement add functionality * refactor hooks * update deletion functionality * update lists functionality * fix typing * add entity to list functionality * edit and deletion functionality * liststobedeleted functionality * remove savedlistscontent * update stores * move logic to hooks * typescript conversions and list page update * adjust useeffect and language * add documentation, minor updates * fix re-rendering issue * copy over local lists and entities * update local to remote copy logic * update save entity logic * update alerts * continue adding alerts * add save entities button to search page * update saved items table, add button to table * adjust button tooltips * add barrel files * convert to ts * continue conversions * separate out api and store * update tests * fix minor uuid bug, adjust menu button * sort items * continue to add sorting * clean up and add changelog * update list page * update isLoading bool to pass test * remove lists page for unauthenticated users * refactor alerts * hide list buttons from unauthenticated users * finish refactoring hooks * fix new list dialog * minor updates and extend alerts * update jest test * update test and implement copy logic * update hook to use default export * update storage description * minor cleanup * finish deleting stores * update logged out description * add save entity button to processed datasets * review cleanup 1 * update import * update hooks * Austenem/CAT-1135 Update /services (#3687) * add ukv service * remove logs * add changelog * memoize entity counts * Austenem/CAT-1113 Add list metrics (#3689) * add categories and update organ page table * finish adding tracking * finish adding tested tracking * consolidate save entity tracking * update imports * add changelog * add ref * add additional check * separate out save entity hook
Summary
Adds metrics for the "My Lists" feature.
Design Documentation/Original Tickets
CAT-1113 Jira ticket
Testing
Tested using Matomo and event logging.
Checklist
CHANGELOG-your-feature-name-here.md
is present in the root directory, describing the change(s) in full sentences.