[WEB-5574]chore: notification card refactor (#8234)

* chore: notification card refactor

* chore: moved base activity types to constants package
This commit is contained in:
Vamsi Krishna 2025-12-24 20:32:50 +05:30 committed by GitHub
parent 3c8624b1ba
commit 5499e49b72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 192 additions and 65 deletions

View file

@ -0,0 +1,25 @@
import { replaceUnderscoreIfSnakeCase } from "@plane/utils";
import type { TNotificationContentMap } from "@/components/workspace-notifications/sidebar/notification-card/content";
// Additional notification content map for CE (empty - EE extends this)
export const ADDITIONAL_NOTIFICATION_CONTENT_MAP: TNotificationContentMap = {};
// Fallback action renderer for fields not in the map
export const renderAdditionalAction = (notificationField: string, verb: string | undefined) => {
const baseAction = !["comment", "archived_at"].includes(notificationField) ? verb : "";
return `${baseAction} ${replaceUnderscoreIfSnakeCase(notificationField)}`;
};
// Fallback value renderer for fields not in the map
export const renderAdditionalValue = (
_notificationField: string | undefined,
newValue: string | undefined,
_oldValue: string | undefined
) => newValue;
export const shouldShowConnector = (notificationField: string | undefined) =>
!["comment", "archived_at", "None", "assignees", "labels", "start_date", "target_date", "parent"].includes(
notificationField || ""
);
export const shouldRender = (notificationField: string | undefined, verb: string | undefined) => verb !== "deleted";