31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
/**
|
|
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* See the LICENSE file for details.
|
|
*/
|
|
|
|
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";
|