(
eventName: string,
{
action,
columns,
column,
row,
feedName,
ranking,
count,
clickedHighlight,
highlightIds,
feedMeta,
position,
origin,
}: FeedHighlightsLogEventOptions,
)
| 192 | } |
| 193 | |
| 194 | export function feedHighlightsLogEvent( |
| 195 | eventName: string, |
| 196 | { |
| 197 | action, |
| 198 | columns, |
| 199 | column, |
| 200 | row, |
| 201 | feedName, |
| 202 | ranking, |
| 203 | count, |
| 204 | clickedHighlight, |
| 205 | highlightIds, |
| 206 | feedMeta, |
| 207 | position, |
| 208 | origin, |
| 209 | }: FeedHighlightsLogEventOptions, |
| 210 | ): FeedItemLogEvent { |
| 211 | return { |
| 212 | event_name: eventName, |
| 213 | feed_grid_columns: columns, |
| 214 | feed_item_grid_column: column, |
| 215 | feed_item_grid_row: row, |
| 216 | feed_item_meta: feedMeta ?? undefined, |
| 217 | feed_item_target_url: clickedHighlight?.post.commentsPermalink, |
| 218 | feed_item_title: clickedHighlight?.headline, |
| 219 | target_type: TargetType.HighlightsCard, |
| 220 | extra: JSON.stringify({ |
| 221 | ...feedLogExtra(feedName, ranking, undefined, origin).extra, |
| 222 | ...(action ? { action } : {}), |
| 223 | ...(typeof count === 'number' ? { count } : {}), |
| 224 | ...(typeof position === 'number' ? { position } : {}), |
| 225 | ...(highlightIds?.length ? { highlight_ids: highlightIds } : {}), |
| 226 | ...(clickedHighlight |
| 227 | ? { |
| 228 | clicked_highlight_id: clickedHighlight.id, |
| 229 | post_id: clickedHighlight.post.id, |
| 230 | } |
| 231 | : {}), |
| 232 | }), |
| 233 | }; |
| 234 | } |
| 235 | |
| 236 | export interface GetDefaultFeedProps { |
| 237 | hasFiltered?: boolean; |
no test coverage detected