- {filterKey.replace("_", " ")}
+ {filterKey.replaceAll("_", " ")}
= observer((props) => {
- const { workspaceSlug, projectId, viewId, viewType } = props;
+ const { workspaceSlug, projectId, viewId, viewType, viewPageType } = props;
// hooks
const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType);
- if (!viewDetailStore) return <>>;
+ const validLayouts = viewPageDefaultLayoutsByPageType(viewPageType);
+
+ if (!viewDetailStore || validLayouts.length <= 1) return <>>;
return (
- {LAYOUTS_DATA.map((layout) => (
-
-
- {
+ if (!validLayouts.includes(layout.key)) return
;
+ return (
+
+
+ viewDetailStore.setDisplayFilters({ layout: layout.key })}
- >
-
-
-
-
- ))}
+ onClick={() => viewDetailStore.setDisplayFilters({ layout: layout.key })}
+ >
+
+
+
+
+ );
+ })}
);
});
diff --git a/web/components/view/root.tsx b/web/components/view/root.tsx
index 2a4631591..00aefe265 100644
--- a/web/components/view/root.tsx
+++ b/web/components/view/root.tsx
@@ -23,7 +23,7 @@ import {
// ui
import { Spinner } from "@plane/ui";
// constants
-import { viewLocalPayload } from "constants/view";
+import { EViewPageType, viewLocalPayload } from "constants/view";
// types
import { TViewOperations } from "./types";
import { TView, TViewTypes } from "@plane/types";
@@ -33,6 +33,7 @@ type TGlobalViewRoot = {
projectId: string | undefined;
viewId: string;
viewType: TViewTypes;
+ viewPageType: EViewPageType;
baseRoute: string;
workspaceViewTabOptions: { key: TViewTypes; title: string; href: string }[];
};
@@ -43,7 +44,7 @@ type TViewOperationsToggle = {
};
export const GlobalViewRoot: FC
= observer((props) => {
- const { workspaceSlug, projectId, viewId, viewType, baseRoute, workspaceViewTabOptions } = props;
+ const { workspaceSlug, projectId, viewId, viewType, viewPageType, baseRoute, workspaceViewTabOptions } = props;
// hooks
const viewStore = useView(workspaceSlug, projectId, viewType);
const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType);
@@ -232,7 +233,13 @@ export const GlobalViewRoot: FC = observer((props) => {