Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion web/core/components/labels/label-drag-n-drop-HOC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import { attachInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree
import { observer } from "mobx-react";
import { createRoot } from "react-dom/client";
// types
import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { IIssueLabel, InstructionType } from "@plane/types";
// ui
import { DropIndicator } from "@plane/ui";
// components
import { useUserPermissions } from "@/hooks/store";
import { LabelName } from "./label-block/label-name";
import { TargetData, getCanDrop, getInstructionFromPayload } from "./label-utils";

Expand Down Expand Up @@ -58,11 +60,14 @@ export const LabelDndHOC = observer((props: Props) => {
const labelRef = useRef<HTMLDivElement | null>(null);
const dragHandleRef = useRef<HTMLButtonElement | null>(null);

const { allowPermissions } = useUserPermissions();
const isEditable = allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.PROJECT);

useEffect(() => {
const element = labelRef.current;
const dragHandleElement = dragHandleRef.current;

if (!element) return;
if (!element || !isEditable) return;

return combine(
draggable({
Expand Down
10 changes: 7 additions & 3 deletions web/core/components/project-states/group-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,16 @@ export const GroupItem: FC<TGroupItem> = observer((props) => {
</div>
<div className="text-base font-medium text-custom-text-200 capitalize px-1">{groupKey}</div>
</div>
<div
className="flex-shrink-0 w-6 h-6 rounded flex justify-center items-center overflow-hidden transition-colors hover:bg-custom-background-80 cursor-pointer text-custom-primary-100/80 hover:text-custom-primary-100"
<button
className={cn(
"flex-shrink-0 w-6 h-6 rounded flex justify-center items-center overflow-hidden transition-colors hover:bg-custom-background-80 cursor-pointer text-custom-primary-100/80 hover:text-custom-primary-100",
!isEditable && "cursor-not-allowed text-custom-text-400 hover:text-custom-text-400"
)}
onClick={() => !createState && setCreateState(true)}
disabled={!isEditable}
>
<Plus className="w-4 h-4" />
</div>
</button>
</div>

{shouldShowEmptyState && (
Expand Down