diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index 903722ef..6f1070bf 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -13,6 +13,7 @@ import { getCategoryDetails } from '../utils/filters'; import { formatNotificationUpdatedAt, formatProperCase, + getRepositoryName, } from '../utils/helpers'; import { openNotification } from '../utils/links'; @@ -116,8 +117,11 @@ export const NotificationRow: FC = ({ )} > - {notification.path?.title ?? - formatProperCase(notification.product.name)} + {notification.path?.title + ? notification.path.title + : notification.product.name === 'bitbucket' + ? getRepositoryName(notification) + : formatProperCase(notification.product.name)} diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index cf3b1970..7bd03931 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -9,6 +9,10 @@ export function formatProperCase(text: string) { }); } +export function getRepositoryName(notification: AtlasifyNotification): string { + return notification.entity.url.split('/').slice(3, 5).join('/'); +} + export function formatNotificationUpdatedAt( notification: AtlasifyNotification, ): string {