fix: issue description placeholder (#4312)

This commit is contained in:
Aaryan Khandelwal 2024-04-30 17:21:52 +05:30 committed by GitHub
parent 87a606446f
commit 4f4f1d92e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 28 additions and 30 deletions

View file

@ -1,13 +1,6 @@
import differenceInCalendarDays from "date-fns/differenceInCalendarDays";
import { v4 as uuidv4 } from "uuid";
// helpers
import { getDate } from "@/helpers/date-time.helper";
import { orderArrayBy } from "@/helpers/array.helper";
// types
import { IGanttBlock } from "@/components/gantt-chart";
// constants
import { ISSUE_DISPLAY_FILTERS_BY_LAYOUT } from "@/constants/issue";
import { STATE_GROUPS } from "@/constants/state";
import {
TIssue,
TIssueGroupByOptions,
@ -16,6 +9,13 @@ import {
TIssueParams,
TStateGroups,
} from "@plane/types";
import { IGanttBlock } from "@/components/gantt-chart";
// constants
import { ISSUE_DISPLAY_FILTERS_BY_LAYOUT } from "@/constants/issue";
import { STATE_GROUPS } from "@/constants/state";
// helpers
import { orderArrayBy } from "@/helpers/array.helper";
import { getDate } from "@/helpers/date-time.helper";
type THandleIssuesMutation = (
formData: Partial<TIssue>,
@ -205,3 +205,9 @@ export const formatTextList = (TextArray: string[]): string => {
return `${TextArray.slice(0, 3).join(", ")}, and +${count - 3} more`;
}
};
export const getDescriptionPlaceholder = (isFocused: boolean, description: string | undefined): string => {
const isDescriptionEmpty = !description || description === "<p></p>" || description.trim() === "";
if (!isDescriptionEmpty || isFocused) return "Press '/' for commands...";
else return "Click to add description";
};