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