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