[WEB-5574]chore: notification card refactor (#8234)
* chore: notification card refactor * chore: moved base activity types to constants package
This commit is contained in:
parent
3c8624b1ba
commit
5499e49b72
4 changed files with 192 additions and 65 deletions
|
|
@ -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";
|
||||
Loading…
Add table
Add a link
Reference in a new issue