mirror of
https://github.com/makeplane/plane.git
synced 2026-02-24 04:00:14 +01:00
Merge branch 'sync/ce-ee' of github.com:makeplane/plane-ee into develop
This commit is contained in:
@@ -15,7 +15,7 @@ const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>((props, re
|
||||
// refs
|
||||
const textAreaRef = useRef<any>(ref);
|
||||
// auto re-size
|
||||
useAutoResizeTextArea(textAreaRef);
|
||||
useAutoResizeTextArea(textAreaRef, value);
|
||||
|
||||
return (
|
||||
<textarea
|
||||
|
||||
@@ -1,24 +1,16 @@
|
||||
import { useEffect } from "react";
|
||||
import { useLayoutEffect } from "react";
|
||||
|
||||
export const useAutoResizeTextArea = (textAreaRef: React.RefObject<HTMLTextAreaElement>) => {
|
||||
useEffect(() => {
|
||||
export const useAutoResizeTextArea = (
|
||||
textAreaRef: React.RefObject<HTMLTextAreaElement>,
|
||||
value: string | number | readonly string[]
|
||||
) => {
|
||||
useLayoutEffect(() => {
|
||||
const textArea = textAreaRef.current;
|
||||
if (!textArea) return;
|
||||
|
||||
const resizeTextArea = () => {
|
||||
textArea.style.height = "auto";
|
||||
const computedHeight = textArea.scrollHeight + "px";
|
||||
textArea.style.height = computedHeight;
|
||||
};
|
||||
|
||||
const handleInput = () => resizeTextArea();
|
||||
|
||||
// resize on mount
|
||||
resizeTextArea();
|
||||
|
||||
textArea.addEventListener("input", handleInput);
|
||||
return () => {
|
||||
textArea.removeEventListener("input", handleInput);
|
||||
};
|
||||
}, [textAreaRef]);
|
||||
// We need to reset the height momentarily to get the correct scrollHeight for the textarea
|
||||
textArea.style.height = "0px";
|
||||
const scrollHeight = textArea.scrollHeight;
|
||||
textArea.style.height = scrollHeight + "px";
|
||||
}, [textAreaRef, value]);
|
||||
};
|
||||
|
||||
@@ -178,7 +178,9 @@ export const CommandModal: React.FC = observer(() => {
|
||||
return 0;
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
// when search is empty and page is undefined
|
||||
// when search term is not empty, esc should clear the search term
|
||||
if (e.key === "Escape" && searchTerm) setSearchTerm("");
|
||||
|
||||
// when user tries to close the modal with esc
|
||||
if (e.key === "Escape" && !page && !searchTerm) closePalette();
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ import { useLabel, useMember, useUser, useIssues } from "@/hooks/store";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
|
||||
const GLOBAL_VIEW_LAYOUTS = [
|
||||
{ key: "list", title: "List", link: "/workspace-views", icon: List },
|
||||
{ key: "spreadsheet", title: "Spreadsheet", link: "/workspace-views/all-issues", icon: Sheet },
|
||||
{ key: "list", title: "List", link: "workspace-views", icon: List },
|
||||
{ key: "spreadsheet", title: "Spreadsheet", link: "workspace-views/all-issues", icon: Sheet },
|
||||
];
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -10,7 +10,7 @@ export const OutlineHeading1 = ({ marking, onClick }: HeadingProps) => (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
className="ml-4 cursor-pointer text-sm font-medium text-custom-text-400 hover:text-custom-primary-100 max-md:ml-2.5"
|
||||
className="text-sm text-left font-medium text-custom-text-300 hover:text-custom-primary-100"
|
||||
>
|
||||
{marking.text}
|
||||
</button>
|
||||
@@ -20,7 +20,7 @@ export const OutlineHeading2 = ({ marking, onClick }: HeadingProps) => (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
className="ml-6 cursor-pointer text-xs font-medium text-custom-text-400 hover:text-custom-primary-100"
|
||||
className="ml-2 text-xs text-left font-medium text-custom-text-300 hover:text-custom-primary-100"
|
||||
>
|
||||
{marking.text}
|
||||
</button>
|
||||
@@ -30,7 +30,7 @@ export const OutlineHeading3 = ({ marking, onClick }: HeadingProps) => (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
className="ml-8 cursor-pointer text-xs font-medium text-custom-text-400 hover:text-custom-primary-100"
|
||||
className="ml-4 text-xs text-left font-medium text-custom-text-300 hover:text-custom-primary-100"
|
||||
>
|
||||
{marking.text}
|
||||
</button>
|
||||
|
||||
@@ -22,12 +22,19 @@ export const PageEditorTitle: React.FC<Props> = observer((props) => {
|
||||
return (
|
||||
<>
|
||||
{readOnly ? (
|
||||
<h6 className="-mt-2 break-words bg-transparent text-4xl font-bold">{title}</h6>
|
||||
<h6
|
||||
className="break-words bg-transparent text-4xl font-bold"
|
||||
style={{
|
||||
lineHeight: "1.2",
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</h6>
|
||||
) : (
|
||||
<>
|
||||
<TextArea
|
||||
onChange={(e) => updateTitle(e.target.value)}
|
||||
className="-mt-2 w-full bg-custom-background text-4xl font-bold outline-none p-0 border-none resize-none rounded-none"
|
||||
className="w-full bg-custom-background text-4xl font-bold outline-none p-0 border-none resize-none rounded-none"
|
||||
style={{
|
||||
lineHeight: "1.2",
|
||||
}}
|
||||
|
||||
@@ -51,7 +51,7 @@ export const PageListBlock: FC<TPageListBlock> = observer((props) => {
|
||||
>
|
||||
{/* page title */}
|
||||
<Tooltip tooltipHeading="Title" tooltipContent={name}>
|
||||
<h5 className="text-base font-semibold truncate">{name}</h5>
|
||||
<h5 className="text-base font-medium truncate">{name}</h5>
|
||||
</Tooltip>
|
||||
|
||||
{/* page properties */}
|
||||
|
||||
@@ -93,29 +93,24 @@ export const CYCLE_STATUS: {
|
||||
|
||||
export const CYCLE_STATE_GROUPS_DETAILS = [
|
||||
{
|
||||
key: "backlog_issues",
|
||||
title: "Backlog",
|
||||
color: "#F0F0F3",
|
||||
},
|
||||
{
|
||||
key: "unstarted_issues",
|
||||
title: "Unstarted",
|
||||
color: "#FB923C",
|
||||
key: "completed_issues",
|
||||
title: "Completed",
|
||||
color: "#6490FE",
|
||||
},
|
||||
{
|
||||
key: "started_issues",
|
||||
title: "Started",
|
||||
color: "#FFC53D",
|
||||
color: "#FDD97F",
|
||||
},
|
||||
{
|
||||
key: "completed_issues",
|
||||
title: "Completed",
|
||||
color: "#d687ff",
|
||||
key: "unstarted_issues",
|
||||
title: "Unstarted",
|
||||
color: "#FEB055",
|
||||
},
|
||||
{
|
||||
key: "cancelled_issues",
|
||||
title: "Cancelled",
|
||||
color: "#ef4444",
|
||||
key: "backlog_issues",
|
||||
title: "Backlog",
|
||||
color: "#F0F0F3",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ export const ISSUE_DISPLAY_FILTERS_BY_LAYOUT: {
|
||||
},
|
||||
extra_options: {
|
||||
access: true,
|
||||
values: ["show_empty_groups"],
|
||||
values: ["show_empty_groups", "sub_issue"],
|
||||
},
|
||||
},
|
||||
kanban: {
|
||||
|
||||
Reference in New Issue
Block a user