diff --git a/web/components/view/applied-filters/filter-item.tsx b/web/components/view/applied-filters/filter-item.tsx index 90765dd55..3dd36f856 100644 --- a/web/components/view/applied-filters/filter-item.tsx +++ b/web/components/view/applied-filters/filter-item.tsx @@ -1,10 +1,9 @@ import { FC } from "react"; import { ImagePlus, X } from "lucide-react"; // hooks -import { useViewFilter } from "hooks/store"; +import { useViewDetail, useViewFilter } from "hooks/store"; // types import { TViewFilters, TViewTypes } from "@plane/types"; -import { TViewOperations } from "../types"; type TViewAppliedFiltersItem = { workspaceSlug: string; @@ -13,18 +12,18 @@ type TViewAppliedFiltersItem = { viewType: TViewTypes; filterKey: keyof TViewFilters; propertyId: string; - viewOperations: TViewOperations; }; export const ViewAppliedFiltersItem: FC = (props) => { - const { workspaceSlug, projectId, filterKey, propertyId, viewOperations } = props; + const { workspaceSlug, projectId, viewId, viewType, filterKey, propertyId } = props; // hooks + const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); const viewFilterHelper = useViewFilter(workspaceSlug, projectId); const propertyDetail = viewFilterHelper?.propertyDetails(filterKey, propertyId) || undefined; const removeFilterOption = () => { - viewOperations?.setFilters(filterKey, propertyId); + viewDetailStore?.setFilters(filterKey, propertyId); }; return ( diff --git a/web/components/view/applied-filters/filter.tsx b/web/components/view/applied-filters/filter.tsx index bb3cbec54..b690dde47 100644 --- a/web/components/view/applied-filters/filter.tsx +++ b/web/components/view/applied-filters/filter.tsx @@ -8,7 +8,6 @@ import { useViewDetail, useViewFilter } from "hooks/store"; import { ViewAppliedFiltersItem } from "./filter-item"; // types import { TViewFilters, TViewTypes } from "@plane/types"; -import { TViewOperations } from "../types"; type TViewAppliedFilters = { workspaceSlug: string; @@ -16,12 +15,11 @@ type TViewAppliedFilters = { viewId: string; viewType: TViewTypes; filterKey: keyof TViewFilters; - viewOperations: TViewOperations; propertyVisibleCount?: number | undefined; }; export const ViewAppliedFilters: FC = observer((props) => { - const { workspaceSlug, projectId, viewId, viewType, filterKey, viewOperations, propertyVisibleCount } = props; + const { workspaceSlug, projectId, viewId, viewType, filterKey, propertyVisibleCount } = props; // hooks const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); const viewFilterStore = useViewFilter(workspaceSlug, projectId); @@ -58,7 +56,6 @@ export const ViewAppliedFilters: FC = observer((props) => { viewType={viewType} filterKey={filterKey} propertyId={propertyId} - viewOperations={viewOperations} /> ))} diff --git a/web/components/view/applied-filters/root.tsx b/web/components/view/applied-filters/root.tsx index 3e1d304ac..eabb2ba77 100644 --- a/web/components/view/applied-filters/root.tsx +++ b/web/components/view/applied-filters/root.tsx @@ -8,37 +8,27 @@ import { useViewDetail } from "hooks/store"; import { ViewAppliedFilters } from "./filter"; // types import { TViewTypes, TViewFilters } from "@plane/types"; -import { TViewOperations } from "../types"; type TViewAppliedFiltersRoot = { workspaceSlug: string; projectId: string | undefined; viewId: string; viewType: TViewTypes; - viewOperations: TViewOperations; propertyVisibleCount?: number | undefined; showClearAll?: boolean; }; export const ViewAppliedFiltersRoot: FC = observer((props) => { - const { - workspaceSlug, - projectId, - viewId, - viewType, - viewOperations, - propertyVisibleCount = undefined, - showClearAll = false, - } = props; + const { workspaceSlug, projectId, viewId, viewType, propertyVisibleCount = undefined, showClearAll = false } = props; // hooks const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); const filterKeys = - viewDetailStore?.appliedFilters && !isEmpty(viewDetailStore?.appliedFilters?.filters) - ? Object.keys(viewDetailStore?.appliedFilters?.filters) + viewDetailStore?.filtersToUpdate && !isEmpty(viewDetailStore?.filtersToUpdate?.filters) + ? Object.keys(viewDetailStore?.filtersToUpdate?.filters) : undefined; - const clearAllFilters = () => viewOperations?.setFilters(undefined, "clear_all"); + const clearAllFilters = () => viewDetailStore?.setFilters(undefined, "clear_all"); if (!filterKeys || !viewDetailStore?.isFiltersApplied) return ( @@ -58,7 +48,6 @@ export const ViewAppliedFiltersRoot: FC = observer((pro viewId={viewId} viewType={viewType} filterKey={filterKey} - viewOperations={viewOperations} propertyVisibleCount={propertyVisibleCount} /> diff --git a/web/components/view/display-filters/dropdown.tsx b/web/components/view/display-filters/dropdown.tsx index 8e25c2585..1fca9fa59 100644 --- a/web/components/view/display-filters/dropdown.tsx +++ b/web/components/view/display-filters/dropdown.tsx @@ -11,7 +11,6 @@ import { ViewDisplayPropertiesRoot } from "../"; // ui import { Tooltip } from "@plane/ui"; // types -import { TViewOperations } from "../types"; import { TViewTypes } from "@plane/types"; type TViewDisplayFiltersDropdown = { @@ -19,7 +18,6 @@ type TViewDisplayFiltersDropdown = { projectId: string | undefined; viewId: string; viewType: TViewTypes; - viewOperations: TViewOperations; children?: ReactNode; displayDropdownText?: boolean; dropdownPlacement?: Placement; @@ -31,7 +29,6 @@ export const ViewDisplayFiltersDropdown: FC = obser projectId, viewId, viewType, - viewOperations, children, displayDropdownText = true, dropdownPlacement = "bottom-start", @@ -121,7 +118,6 @@ export const ViewDisplayFiltersDropdown: FC = obser projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} /> diff --git a/web/components/view/display-properties/property-selection.tsx b/web/components/view/display-properties/property-selection.tsx index 2e34eb25c..75a3fc2d4 100644 --- a/web/components/view/display-properties/property-selection.tsx +++ b/web/components/view/display-properties/property-selection.tsx @@ -4,25 +4,23 @@ import { observer } from "mobx-react-lite"; import { useViewDetail } from "hooks/store"; // types import { TViewDisplayProperties, TViewTypes } from "@plane/types"; -import { TViewOperations } from "../types"; type TViewDisplayPropertySelection = { workspaceSlug: string; projectId: string | undefined; viewId: string; viewType: TViewTypes; - viewOperations: TViewOperations; property: keyof TViewDisplayProperties; }; export const ViewDisplayPropertySelection: FC = observer((props) => { - const { workspaceSlug, projectId, viewId, viewType, viewOperations, property } = props; + const { workspaceSlug, projectId, viewId, viewType, property } = props; // hooks const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); const propertyIsSelected = viewDetailStore?.appliedFilters?.display_properties?.[property]; - const handlePropertySelection = () => viewOperations?.setDisplayProperties(property); + const handlePropertySelection = () => viewDetailStore?.setDisplayProperties(property); return (
= observer((props) => { - const { workspaceSlug, projectId, viewId, viewType, viewOperations } = props; + const { workspaceSlug, projectId, viewId, viewType } = props; const displayProperties: Partial[] = [ "key", @@ -40,7 +38,6 @@ export const ViewDisplayPropertiesRoot: FC = observe projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} property={property} /> diff --git a/web/components/view/filters/dropdown.tsx b/web/components/view/filters/dropdown.tsx index ab062fae5..d434ba438 100644 --- a/web/components/view/filters/dropdown.tsx +++ b/web/components/view/filters/dropdown.tsx @@ -11,7 +11,6 @@ import { ViewFiltersRoot } from "../"; // ui import { Tooltip } from "@plane/ui"; // types -import { TViewOperations } from "../types"; import { TViewTypes } from "@plane/types"; type TViewFiltersDropdown = { @@ -19,7 +18,6 @@ type TViewFiltersDropdown = { projectId: string | undefined; viewId: string; viewType: TViewTypes; - viewOperations: TViewOperations; children?: ReactNode; displayDropdownText?: boolean; dropdownPlacement?: Placement; @@ -31,7 +29,6 @@ export const ViewFiltersDropdown: FC = observer((props) => projectId, viewId, viewType, - viewOperations, children, displayDropdownText = true, dropdownPlacement = "bottom-start", @@ -133,7 +130,6 @@ export const ViewFiltersDropdown: FC = observer((props) => projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} dateCustomFilterToggle={dateCustomFilterToggle} setDateCustomFilterToggle={setDateCustomFilterToggle} /> diff --git a/web/components/view/filters/edit-dropdown.tsx b/web/components/view/filters/edit-dropdown.tsx index b737c0aeb..703e2075c 100644 --- a/web/components/view/filters/edit-dropdown.tsx +++ b/web/components/view/filters/edit-dropdown.tsx @@ -50,20 +50,22 @@ export const ViewFiltersEditDropdown: FC = observer((p // dropdown options const dropdownOptions: TViewFilterEditDropdownOptions[] = useMemo( () => [ - { - icon: PhotoFilterIcon, - key: "save_as_new", - label: "Save as new view", - onClick: () => viewOperations.update(), - }, + // { + // icon: PhotoFilterIcon, + // key: "save_as_new", + // label: "Save as new view", + // onClick: () => { + // viewOperations.localViewCreateEdit(undefined, viewDetailStore?.filtersToUpdate); + // }, + // }, { icon: RotateCcw, key: "reset_changes", label: "Reset changes", - onClick: () => viewOperations.resetChanges(), + onClick: () => viewDetailStore?.resetChanges(), }, ], - [viewOperations] + [viewOperations, viewDetailStore] ); if (!viewDetailStore?.isFiltersUpdateEnabled) return <>; diff --git a/web/components/view/filters/filter-item-root.tsx b/web/components/view/filters/filter-item-root.tsx index 810fcd1ea..86d2f33e9 100644 --- a/web/components/view/filters/filter-item-root.tsx +++ b/web/components/view/filters/filter-item-root.tsx @@ -6,7 +6,6 @@ import { useViewDetail, useViewFilter } from "hooks/store"; import { ViewFiltersItem, ViewFilterSelection } from "../"; import { DateFilterModal } from "components/core"; // types -import { TViewOperations } from "../types"; import { TViewFilters, TViewTypes } from "@plane/types"; type TViewFiltersItemRoot = { @@ -14,23 +13,14 @@ type TViewFiltersItemRoot = { projectId: string | undefined; viewId: string; viewType: TViewTypes; - viewOperations: TViewOperations; filterKey: keyof TViewFilters; dateCustomFilterToggle: string | undefined; setDateCustomFilterToggle: (value: string | undefined) => void; }; export const ViewFiltersItemRoot: FC = observer((props) => { - const { - workspaceSlug, - projectId, - viewId, - viewType, - viewOperations, - filterKey, - dateCustomFilterToggle, - setDateCustomFilterToggle, - } = props; + const { workspaceSlug, projectId, viewId, viewType, filterKey, dateCustomFilterToggle, setDateCustomFilterToggle } = + props; // hooks const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); const viewFilterHelper = useViewFilter(workspaceSlug, projectId); @@ -47,15 +37,15 @@ export const ViewFiltersItemRoot: FC = observer((props) => const _propertyIds = viewDetailStore?.appliedFilters?.filters?.[filterKey] || []; const selectedDates = _propertyIds.filter((id) => id.includes("-")); if (selectedDates.length > 0) - selectedDates.forEach((date: string) => viewOperations?.setFilters(filterKey, date)); + selectedDates.forEach((date: string) => viewDetailStore?.setFilters(filterKey, date)); else setDateCustomFilterToggle(filterKey); - } else viewOperations?.setFilters(filterKey, _propertyId); - } else viewOperations?.setFilters(filterKey, _propertyId); + } else viewDetailStore?.setFilters(filterKey, _propertyId); + } else viewDetailStore?.setFilters(filterKey, _propertyId); }; const handleCustomDateSelection = (selectedDates: string[]) => { selectedDates.forEach((date: string) => { - viewOperations?.setFilters(filterKey, date); + viewDetailStore?.setFilters(filterKey, date); setDateCustomFilterToggle(undefined); }); }; diff --git a/web/components/view/filters/root.tsx b/web/components/view/filters/root.tsx index 923de2e98..7f36ef86c 100644 --- a/web/components/view/filters/root.tsx +++ b/web/components/view/filters/root.tsx @@ -9,7 +9,6 @@ import { useViewDetail } from "hooks/store"; // components import { ViewFiltersItemRoot } from "../"; // types -import { TViewOperations } from "../types"; import { TViewFilters, TViewTypes } from "@plane/types"; import { VIEW_DEFAULT_FILTER_PARAMETERS } from "constants/view"; @@ -18,21 +17,12 @@ type TViewFiltersRoot = { projectId: string | undefined; viewId: string; viewType: TViewTypes; - viewOperations: TViewOperations; dateCustomFilterToggle: string | undefined; setDateCustomFilterToggle: (value: string | undefined) => void; }; export const ViewFiltersRoot: FC = observer((props) => { - const { - workspaceSlug, - projectId, - viewId, - viewType, - viewOperations, - dateCustomFilterToggle, - setDateCustomFilterToggle, - } = props; + const { workspaceSlug, projectId, viewId, viewType, dateCustomFilterToggle, setDateCustomFilterToggle } = props; // hooks const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); // state @@ -70,7 +60,6 @@ export const ViewFiltersRoot: FC = observer((props) => { projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} filterKey={filterKey} dateCustomFilterToggle={dateCustomFilterToggle} setDateCustomFilterToggle={setDateCustomFilterToggle} diff --git a/web/components/view/layout.tsx b/web/components/view/layout.tsx index 0daa7e32a..d9284883d 100644 --- a/web/components/view/layout.tsx +++ b/web/components/view/layout.tsx @@ -7,14 +7,12 @@ import { useViewDetail } from "hooks/store"; import { Tooltip } from "@plane/ui"; // types import { TViewLayouts, TViewTypes } from "@plane/types"; -import { TViewOperations } from "./types"; type TViewLayoutRoot = { workspaceSlug: string; projectId: string | undefined; viewId: string; viewType: TViewTypes; - viewOperations: TViewOperations; }; const LAYOUTS_DATA: { key: TViewLayouts; title: string; icon: LucideIcon }[] = [ @@ -26,10 +24,11 @@ const LAYOUTS_DATA: { key: TViewLayouts; title: string; icon: LucideIcon }[] = [ ]; export const ViewLayoutRoot: FC = observer((props) => { - const { workspaceSlug, projectId, viewId, viewType, viewOperations } = props; + const { workspaceSlug, projectId, viewId, viewType } = props; // hooks const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); + if (!viewDetailStore) return <>; return (
{LAYOUTS_DATA.map((layout) => ( @@ -43,7 +42,7 @@ export const ViewLayoutRoot: FC = observer((props) => { : `hover:bg-custom-background-100` } `} - onClick={() => viewOperations.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 467e867c3..2a4631591 100644 --- a/web/components/view/root.tsx +++ b/web/components/view/root.tsx @@ -1,7 +1,9 @@ import { FC, Fragment, useEffect, useMemo, useState } from "react"; import Link from "next/link"; import { observer } from "mobx-react-lite"; -import { CheckCircle, Pencil } from "lucide-react"; +import { CheckCircle } from "lucide-react"; +import { v4 as uuidV4 } from "uuid"; +import cloneDeep from "lodash/cloneDeep"; // hooks import { useView, useViewDetail } from "hooks/store"; import useToast from "hooks/use-toast"; @@ -24,7 +26,7 @@ import { Spinner } from "@plane/ui"; import { viewLocalPayload } from "constants/view"; // types import { TViewOperations } from "./types"; -import { TView, TViewFilters, TViewDisplayFilters, TViewDisplayProperties, TViewTypes } from "@plane/types"; +import { TView, TViewTypes } from "@plane/types"; type TGlobalViewRoot = { workspaceSlug: string; @@ -63,11 +65,19 @@ export const GlobalViewRoot: FC = observer((props) => { const viewOperations: TViewOperations = useMemo( () => ({ - localViewCreateEdit: (viewId: string | undefined) => { + localViewCreateEdit: (viewId: string | undefined, currentView = undefined) => { if (viewId === undefined) { - const viewPayload = viewLocalPayload; - handleViewOperationsToggle("CREATE", viewPayload.id); - viewStore?.localViewCreate(viewPayload as TView); + if (currentView !== undefined) { + // creating new view + const currentViewPayload = cloneDeep({ ...currentView, id: uuidV4() }); + handleViewOperationsToggle("CREATE", currentViewPayload.id); + viewStore?.localViewCreate(currentViewPayload as TView); + } else { + // if current view is available, create a new view with the same data + const viewPayload = viewLocalPayload; + handleViewOperationsToggle("CREATE", viewPayload.id); + viewStore?.localViewCreate(viewPayload as TView); + } } else { handleViewOperationsToggle("EDIT", viewId); viewDetailCreateEditStore?.setIsEditable(true); @@ -75,35 +85,9 @@ export const GlobalViewRoot: FC = observer((props) => { }, localViewCreateEditClear: async (viewId: string | undefined) => { if (viewDetailCreateEditStore?.is_create && viewId) viewStore?.remove(viewId); + if (viewDetailCreateEditStore?.is_editable && viewId) viewDetailCreateEditStore.resetChanges(); handleViewOperationsToggle(undefined, undefined); }, - resetChanges: () => viewDetailStore?.resetChanges(), - - setName: (name: string) => { - if (viewOperationsToggle.type && ["CREATE", "EDIT"].includes(viewOperationsToggle.type)) - viewDetailCreateEditStore?.setName(name); - else viewDetailStore?.setName(name); - }, - setDescription: (name: string) => { - if (viewOperationsToggle.type && ["CREATE", "EDIT"].includes(viewOperationsToggle.type)) - viewDetailCreateEditStore?.setDescription(name); - else viewDetailStore?.setDescription(name); - }, - setFilters: (filterKey: keyof TViewFilters | undefined, filterValue: "clear_all" | string) => { - if (viewOperationsToggle.type && ["CREATE", "EDIT"].includes(viewOperationsToggle.type)) - viewDetailCreateEditStore?.setFilters(filterKey, filterValue); - else viewDetailStore?.setFilters(filterKey, filterValue); - }, - setDisplayFilters: (display_filters: Partial) => { - if (viewOperationsToggle.type && ["CREATE", "EDIT"].includes(viewOperationsToggle.type)) - viewDetailCreateEditStore?.setDisplayFilters(display_filters); - else viewDetailStore?.setDisplayFilters(display_filters); - }, - setDisplayProperties: (displayPropertyKey: keyof TViewDisplayProperties) => { - if (viewOperationsToggle.type && ["CREATE", "EDIT"].includes(viewOperationsToggle.type)) - viewDetailCreateEditStore?.setDisplayProperties(displayPropertyKey); - else viewDetailStore?.setDisplayProperties(displayPropertyKey); - }, fetch: async () => { try { @@ -168,7 +152,7 @@ export const GlobalViewRoot: FC = observer((props) => { } }, }), - [viewStore, viewDetailStore, setToastAlert, viewOperationsToggle, viewDetailCreateEditStore] + [viewStore, viewDetailStore, setToastAlert, viewDetailCreateEditStore] ); // fetch all views @@ -243,19 +227,12 @@ export const GlobalViewRoot: FC = observer((props) => { projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} propertyVisibleCount={5} />
- +
@@ -264,7 +241,6 @@ export const GlobalViewRoot: FC = observer((props) => { projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} displayDropdownText={false} />
@@ -275,12 +251,16 @@ export const GlobalViewRoot: FC = observer((props) => { projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} displayDropdownText={false} /> - + void; + localViewCreateEdit: (viewId: string | undefined, currentView?: TUpdateView | undefined) => void; localViewCreateEditClear: (viewId: string | undefined) => Promise; - resetChanges: () => void; - - setName: (name: string) => void; - setDescription: (description: string) => void; - setFilters: (filterKey: keyof TViewFilters | undefined, filterValue: "clear_all" | string) => void; - setDisplayFilters: (display_filters: Partial) => void; - setDisplayProperties: (displayPropertyKey: keyof TViewDisplayProperties) => void; fetch: () => Promise; create: (data: Partial) => Promise; diff --git a/web/components/view/views/create-edit-form.tsx b/web/components/view/views/create-edit-form.tsx index a6ea3d4f1..a44ce087e 100644 --- a/web/components/view/views/create-edit-form.tsx +++ b/web/components/view/views/create-edit-form.tsx @@ -23,7 +23,7 @@ type TViewCreateEditForm = { export const ViewCreateEditForm: FC = observer((props) => { const { workspaceSlug, projectId, viewId, viewType, viewOperations } = props; // hooks - const currentViewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); + const viewDetailStore = useViewDetail(workspaceSlug, projectId, viewId, viewType); const { getProjectById } = useProject(); // states const [modalToggle, setModalToggle] = useState(false); @@ -43,12 +43,12 @@ export const ViewCreateEditForm: FC = observer((props) => { const onContinue = async () => { setLoader(true); - if (currentViewDetailStore?.is_create) { - const payload = currentViewDetailStore?.filtersToUpdate; + if (viewDetailStore?.is_create) { + const payload = viewDetailStore?.filtersToUpdate; await viewOperations.create(payload); modalClose(); } else { - const payload = currentViewDetailStore?.filtersToUpdate; + const payload = viewDetailStore?.filtersToUpdate; if (!payload) return; await viewOperations.update(); modalClose(); @@ -58,7 +58,7 @@ export const ViewCreateEditForm: FC = observer((props) => { const projectDetails = projectId ? getProjectById(projectId) : undefined; - if (!currentViewDetailStore?.id) return <>; + if (!viewDetailStore) return <>; return ( @@ -110,9 +110,9 @@ export const ViewCreateEditForm: FC = observer((props) => { id="name" name="name" type="text" - value={currentViewDetailStore?.filtersToUpdate?.name || ""} + value={viewDetailStore?.filtersToUpdate?.name || ""} onChange={(e) => { - viewOperations?.setName(e.target.value); + viewDetailStore?.setName(e.target.value); }} placeholder="What do you want to call this view?" className="h-[46px] w-full border border-onboarding-border-100 pr-12 placeholder:text-onboarding-text-400" @@ -126,7 +126,6 @@ export const ViewCreateEditForm: FC = observer((props) => { projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} dropdownPlacement="right" >
@@ -136,17 +135,19 @@ export const ViewCreateEditForm: FC = observer((props) => {
Filters
-
{ - viewOperations.setFilters(undefined, "clear_all"); - }} - > -
Clear all filters
-
- + {viewDetailStore?.isFiltersApplied && ( +
{ + viewDetailStore.setFilters(undefined, "clear_all"); + }} + > +
Clear all filters
+
+ +
-
+ )}
@@ -155,7 +156,6 @@ export const ViewCreateEditForm: FC = observer((props) => { projectId={projectId} viewId={viewId} viewType={viewType} - viewOperations={viewOperations} propertyVisibleCount={undefined} />
@@ -165,7 +165,7 @@ export const ViewCreateEditForm: FC = observer((props) => { Cancel diff --git a/web/components/view/views/edit-dropdown.tsx b/web/components/view/views/edit-dropdown.tsx index 10dfa878b..81be9f966 100644 --- a/web/components/view/views/edit-dropdown.tsx +++ b/web/components/view/views/edit-dropdown.tsx @@ -7,6 +7,8 @@ import { Copy, Eye, Globe2, Link2, Pencil, Trash } from "lucide-react"; import { TViewEditDropdownOptions, TViewOperations } from "../types"; type TViewEditDropdown = { + workspaceSlug: string; + projectId: string | undefined; viewId: string; viewOperations: TViewOperations; }; @@ -47,49 +49,49 @@ export const ViewEditDropdown: FC = observer((props) => { onClick: () => viewOperations.localViewCreateEdit(viewId), children: undefined, }, - { - icon: Eye, - key: "accessability", - label: "Change Accessability", - onClick: () => {}, - children: [ - { - icon: Eye, - key: "private", - label: "Private", - onClick: () => viewOperations.create({}), - children: undefined, - }, - { - icon: Globe2, - key: "public", - label: "Public", - onClick: () => viewOperations.create({}), - children: undefined, - }, - ], - }, - { - icon: Copy, - key: "duplicate", - label: "Duplicate view", - onClick: () => viewOperations.remove(viewId), - children: undefined, - }, - { - icon: Link2, - key: "copy_link", - label: "Copy view link", - onClick: () => viewOperations.remove(viewId), - children: undefined, - }, - { - icon: Trash, - key: "delete", - label: "Delete view", - onClick: () => viewOperations.remove(viewId), - children: undefined, - }, + // { + // icon: Eye, + // key: "accessability", + // label: "Change Accessability", + // onClick: () => {}, + // children: [ + // { + // icon: Eye, + // key: "private", + // label: "Private", + // onClick: () => viewOperations.create({}), + // children: undefined, + // }, + // { + // icon: Globe2, + // key: "public", + // label: "Public", + // onClick: () => viewOperations.create({}), + // children: undefined, + // }, + // ], + // }, + // { + // icon: Copy, + // key: "duplicate", + // label: "Duplicate view", + // onClick: () => viewOperations.remove(viewId), + // children: undefined, + // }, + // { + // icon: Link2, + // key: "copy_link", + // label: "Copy view link", + // onClick: () => viewOperations.remove(viewId), + // children: undefined, + // }, + // { + // icon: Trash, + // key: "delete", + // label: "Delete view", + // onClick: () => viewOperations.remove(viewId), + // children: undefined, + // }, ], [viewOperations, viewId] ); diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/views/private/[viewId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/views/private/[viewId].tsx index 5f3d94e16..c0500b9b0 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/views/private/[viewId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/views/private/[viewId].tsx @@ -3,7 +3,7 @@ import { useRouter } from "next/router"; // layouts import { AppLayout } from "layouts/app-layout"; // components -import { AllIssuesViewRoot } from "components/view"; +import { GlobalViewRoot } from "components/view"; // types import { NextPageWithLayout } from "lib/types"; // constants @@ -33,7 +33,7 @@ const ProjectPrivateViewPage: NextPageWithLayout = () => { return (
- { return (
- { return (
- { return (
-