[WEB-2467] fix: platform bug (#5621)
* fix: reaction endpoint * fix: project label edit permission * fix: guest role upgrade * fix: list layout dnd permission * fix: module and cycle toast alert * fix: leave project redirection
This commit is contained in:
parent
7aea820cfa
commit
7d7415b235
11 changed files with 46 additions and 14 deletions
|
|
@ -4,6 +4,7 @@ import { MutableRefObject, useEffect, useRef, useState } from "react";
|
|||
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
||||
import { dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
||||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
import { cn } from "@plane/editor";
|
||||
// plane packages
|
||||
import {
|
||||
|
|
@ -90,6 +91,7 @@ export const ListGroup = observer((props: Props) => {
|
|||
const [isExpanded, setIsExpanded] = useState(true);
|
||||
const groupRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
const { projectId } = useParams();
|
||||
const projectState = useProjectState();
|
||||
|
||||
const {
|
||||
|
|
@ -216,7 +218,8 @@ export const ListGroup = observer((props: Props) => {
|
|||
);
|
||||
}, [groupRef?.current, group, orderBy, getGroupIndex, setDragColumnOrientation, setIsDraggingOverColumn]);
|
||||
|
||||
const isDragAllowed = !!group_by && DRAG_ALLOWED_GROUPS.includes(group_by);
|
||||
const isDragAllowed =
|
||||
!!group_by && DRAG_ALLOWED_GROUPS.includes(group_by) && canEditProperties(projectId?.toString());
|
||||
const canOverlayBeVisible = orderBy !== "sort_order" || !!group.isDropDisabled;
|
||||
|
||||
const isGroupByCreatedBy = group_by === "created_by";
|
||||
|
|
|
|||
|
|
@ -6,12 +6,28 @@ import { ProjectIssueQuickActions } from "@/components/issues";
|
|||
// components
|
||||
// types
|
||||
// constants
|
||||
import { useUserPermissions } from "@/hooks/store";
|
||||
import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions";
|
||||
import { BaseListRoot } from "../base-list-root";
|
||||
|
||||
export const ListLayout: FC = observer(() => {
|
||||
const { workspaceSlug, projectId } = useParams();
|
||||
const { allowPermissions } = useUserPermissions();
|
||||
|
||||
if (!workspaceSlug || !projectId) return null;
|
||||
|
||||
return <BaseListRoot QuickActions={ProjectIssueQuickActions} />;
|
||||
const canEditPropertiesBasedOnProject = (projectId: string) =>
|
||||
allowPermissions(
|
||||
[EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
||||
EUserPermissionsLevel.PROJECT,
|
||||
workspaceSlug.toString(),
|
||||
projectId
|
||||
);
|
||||
|
||||
return (
|
||||
<BaseListRoot
|
||||
QuickActions={ProjectIssueQuickActions}
|
||||
canEditPropertiesBasedOnProject={canEditPropertiesBasedOnProject}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue