Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ const replaceHeadline = (text) => {
return text
}

const truncateText = (text: string, characters: number = 60): string => {
if (text.length > characters) {
return `${text.substring(0, characters)}...`
}
return text
}

export const newActivityBlocks = (activity) => {
const display = htmlToMrkdwn(replaceHeadline(`${activity.display.default}`))
const reach = activity.member.reach?.[activity.platform] || activity.member.reach?.total
Expand Down Expand Up @@ -76,7 +83,9 @@ export const newActivityBlocks = (activity) => {
type: 'section',
text: {
type: 'mrkdwn',
text: `*<${API_CONFIG.frontendUrl}/members/${activity.member.id}|${activity.member.displayName}>* \n *${display.text}*`,
text: `*<${API_CONFIG.frontendUrl}/members/${activity.member.id}|${
activity.member.displayName
}>* \n *${truncateText(display.text)}*`,
},
...(activity.url
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default class OrganizationEnrichmentService extends LoggingBase {
) {
acc[platform] = {
handle,
[platform === PlatformType.TWITTER? "site": "url"]: social,
[platform === PlatformType.TWITTER ? 'site' : 'url']: social,
}
}
return acc
Expand Down