2024-02-05 14:39:17 +00:00
|
|
|
// types
|
|
|
|
import { TViewTypes, TView } from "@plane/types";
|
|
|
|
|
|
|
|
export const VIEW_TYPES: Record<TViewTypes, TViewTypes> = {
|
2024-02-08 18:11:30 +00:00
|
|
|
WORKSPACE_PRIVATE_VIEWS: "WORKSPACE_PRIVATE_VIEWS",
|
|
|
|
WORKSPACE_PUBLIC_VIEWS: "WORKSPACE_PUBLIC_VIEWS",
|
|
|
|
PROJECT_PRIVATE_VIEWS: "PROJECT_PRIVATE_VIEWS",
|
|
|
|
PROJECT_PUBLIC_VIEWS: "PROJECT_PUBLIC_VIEWS",
|
2024-02-05 14:39:17 +00:00
|
|
|
};
|
|
|
|
|
2024-02-16 12:58:21 +00:00
|
|
|
export type TViewCRUD = "CREATE" | "EDIT" | "SAVE_AS_NEW" | "CLEAR";
|
|
|
|
|
2024-02-05 14:39:17 +00:00
|
|
|
export const viewLocalPayload: Partial<TView> = {
|
2024-02-16 12:58:21 +00:00
|
|
|
id: "create",
|
2024-02-05 14:39:17 +00:00
|
|
|
name: "",
|
|
|
|
description: "",
|
2024-02-07 06:00:06 +00:00
|
|
|
filters: undefined,
|
|
|
|
display_filters: undefined,
|
|
|
|
display_properties: undefined,
|
2024-02-05 14:39:17 +00:00
|
|
|
is_local_view: false,
|
|
|
|
};
|
2024-02-16 12:58:21 +00:00
|
|
|
|
|
|
|
export const generateViewStoreKey = (
|
|
|
|
workspaceSlug: string,
|
|
|
|
projectId: string | undefined,
|
|
|
|
viewType: TViewTypes
|
|
|
|
): string => `${workspaceSlug}_${projectId}_${viewType}`;
|