forked from github/plane
fix: project view item edit action fix (#2612)
This commit is contained in:
parent
d5fd69354e
commit
43e42f1896
@ -6,7 +6,7 @@ import { observer } from "mobx-react-lite";
|
|||||||
// mobx store
|
// mobx store
|
||||||
import { useMobxStore } from "lib/mobx/store-provider";
|
import { useMobxStore } from "lib/mobx/store-provider";
|
||||||
// components
|
// components
|
||||||
import { DeleteProjectViewModal } from "components/views";
|
import { CreateUpdateProjectViewModal, DeleteProjectViewModal } from "components/views";
|
||||||
// ui
|
// ui
|
||||||
import { CustomMenu } from "@plane/ui";
|
import { CustomMenu } from "@plane/ui";
|
||||||
// icons
|
// icons
|
||||||
@ -24,6 +24,7 @@ type Props = {
|
|||||||
export const ProjectViewListItem: React.FC<Props> = observer((props) => {
|
export const ProjectViewListItem: React.FC<Props> = observer((props) => {
|
||||||
const { view } = props;
|
const { view } = props;
|
||||||
|
|
||||||
|
const [createUpdateViewModal, setCreateUpdateViewModal] = useState(false);
|
||||||
const [deleteViewModal, setDeleteViewModal] = useState(false);
|
const [deleteViewModal, setDeleteViewModal] = useState(false);
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -47,6 +48,15 @@ export const ProjectViewListItem: React.FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{workspaceSlug && projectId && view && (
|
||||||
|
<CreateUpdateProjectViewModal
|
||||||
|
isOpen={createUpdateViewModal}
|
||||||
|
onClose={() => setCreateUpdateViewModal(false)}
|
||||||
|
workspaceSlug={workspaceSlug.toString()}
|
||||||
|
projectId={projectId.toString()}
|
||||||
|
data={view}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<DeleteProjectViewModal data={view} isOpen={deleteViewModal} onClose={() => setDeleteViewModal(false)} />
|
<DeleteProjectViewModal data={view} isOpen={deleteViewModal} onClose={() => setDeleteViewModal(false)} />
|
||||||
<div className="group hover:bg-custom-background-90 border-b border-custom-border-200">
|
<div className="group hover:bg-custom-background-90 border-b border-custom-border-200">
|
||||||
<Link href={`/${workspaceSlug}/projects/${projectId}/views/${view.id}`}>
|
<Link href={`/${workspaceSlug}/projects/${projectId}/views/${view.id}`}>
|
||||||
@ -97,6 +107,7 @@ export const ProjectViewListItem: React.FC<Props> = observer((props) => {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setCreateUpdateViewModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className="flex items-center justify-start gap-2">
|
<span className="flex items-center justify-start gap-2">
|
||||||
|
Loading…
Reference in New Issue
Block a user