From 0b02b57b8eedfc86c9137ef09be72789a7fcbf38 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Tue, 21 Feb 2023 13:13:43 +0530 Subject: [PATCH 1/7] fix: ellipsis added to issue title --- apps/app/components/core/list-view/single-issue.tsx | 4 +++- apps/app/components/issues/my-issues-list-item.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/app/components/core/list-view/single-issue.tsx b/apps/app/components/core/list-view/single-issue.tsx index b2b74a94d70..0a050e6dee2 100644 --- a/apps/app/components/core/list-view/single-issue.tsx +++ b/apps/app/components/core/list-view/single-issue.tsx @@ -155,7 +155,9 @@ export const SingleListIssue: React.FC = ({ {issue.project_detail?.identifier}-{issue.sequence_id} )} - {issue.name} + + {issue.name} + diff --git a/apps/app/components/issues/my-issues-list-item.tsx b/apps/app/components/issues/my-issues-list-item.tsx index 130c777affe..7de7f82a213 100644 --- a/apps/app/components/issues/my-issues-list-item.tsx +++ b/apps/app/components/issues/my-issues-list-item.tsx @@ -82,7 +82,9 @@ export const MyIssuesListItem: React.FC = ({ {issue.project_detail?.identifier}-{issue.sequence_id} )} - {issue.name} + + {issue.name} + From 6927eae16e8da43810e394c97d3d5d2cdd06aa6e Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Tue, 21 Feb 2023 18:11:23 +0530 Subject: [PATCH 2/7] feat: toolttip added --- .../core/list-view/single-issue.tsx | 23 ++++-- .../issues/view-select/due-date.tsx | 46 ++++++----- .../issues/view-select/priority.tsx | 16 ++-- .../components/issues/view-select/state.tsx | 13 ++- apps/app/components/ui/tooltip.tsx | 81 ++++++------------- apps/app/package.json | 4 +- 6 files changed, 89 insertions(+), 94 deletions(-) diff --git a/apps/app/components/core/list-view/single-issue.tsx b/apps/app/components/core/list-view/single-issue.tsx index 0a050e6dee2..1ee648cd9f4 100644 --- a/apps/app/components/core/list-view/single-issue.tsx +++ b/apps/app/components/core/list-view/single-issue.tsx @@ -16,8 +16,10 @@ import { ViewPrioritySelect, ViewStateSelect, } from "components/issues/view-select"; +import { Tooltip2 } from "@blueprintjs/popover2"; + // ui -import { CustomMenu } from "components/ui"; +import { Tooltip, CustomMenu } from "components/ui"; // helpers import { copyTextToClipboard } from "helpers/string.helper"; // types @@ -151,13 +153,20 @@ export const SingleListIssue: React.FC = ({ {properties.key && ( - - {issue.project_detail?.identifier}-{issue.sequence_id} - + + + {issue.project_detail?.identifier}-{issue.sequence_id} + + )} - - {issue.name} - + + + {issue.name} + + diff --git a/apps/app/components/issues/view-select/due-date.tsx b/apps/app/components/issues/view-select/due-date.tsx index 9033e95e3f2..b36ca6db085 100644 --- a/apps/app/components/issues/view-select/due-date.tsx +++ b/apps/app/components/issues/view-select/due-date.tsx @@ -1,5 +1,5 @@ // ui -import { CustomDatePicker } from "components/ui"; +import { CustomDatePicker, Tooltip } from "components/ui"; // helpers import { findHowManyDaysLeft } from "helpers/date-time.helper"; // types @@ -12,25 +12,27 @@ type Props = { }; export const ViewDueDateSelect: React.FC = ({ issue, partialUpdateIssue, isNotAllowed }) => ( -
- - partialUpdateIssue({ - target_date: val, - }) - } - className={issue?.target_date ? "w-[6.5rem]" : "w-[3rem] text-center"} - disabled={isNotAllowed} - /> -
+ +
+ + partialUpdateIssue({ + target_date: val, + }) + } + className={issue?.target_date ? "w-[6.5rem]" : "w-[3rem] text-center"} + disabled={isNotAllowed} + /> +
+
); diff --git a/apps/app/components/issues/view-select/priority.tsx b/apps/app/components/issues/view-select/priority.tsx index 096d6e93f09..5e4dae007fc 100644 --- a/apps/app/components/issues/view-select/priority.tsx +++ b/apps/app/components/issues/view-select/priority.tsx @@ -1,7 +1,7 @@ import React from "react"; // ui -import { CustomSelect } from "components/ui"; +import { CustomSelect, Tooltip } from "components/ui"; // icons import { getPriorityIcon } from "components/icons/priority-icon"; // types @@ -24,12 +24,14 @@ export const ViewPrioritySelect: React.FC = ({ }) => ( - {getPriorityIcon( - issue.priority && issue.priority !== "" ? issue.priority ?? "" : "None", - "text-sm" - )} - + + + {getPriorityIcon( + issue.priority && issue.priority !== "" ? issue.priority ?? "" : "None", + "text-sm" + )} + + } value={issue.state} onChange={(data: string) => { diff --git a/apps/app/components/issues/view-select/state.tsx b/apps/app/components/issues/view-select/state.tsx index b6bac7a0b81..0f516f2c93a 100644 --- a/apps/app/components/issues/view-select/state.tsx +++ b/apps/app/components/issues/view-select/state.tsx @@ -5,7 +5,7 @@ import useSWR from "swr"; // services import stateService from "services/state.service"; // ui -import { CustomSelect } from "components/ui"; +import { CustomSelect, Tooltip } from "components/ui"; // helpers import { addSpaceIfCamelCase } from "helpers/string.helper"; import { getStatesList } from "helpers/state.helper"; @@ -48,7 +48,16 @@ export const ViewStateSelect: React.FC = ({ backgroundColor: states?.find((s) => s.id === issue.state)?.color, }} /> - {addSpaceIfCamelCase(states?.find((s) => s.id === issue.state)?.name ?? "")} + s.id === issue.state)?.name ?? "" + )} + > + + {addSpaceIfCamelCase(states?.find((s) => s.id === issue.state)?.name ?? "")} + + } value={issue.state} diff --git a/apps/app/components/ui/tooltip.tsx b/apps/app/components/ui/tooltip.tsx index 5c91b7f0d96..8c2558d32ed 100644 --- a/apps/app/components/ui/tooltip.tsx +++ b/apps/app/components/ui/tooltip.tsx @@ -1,66 +1,37 @@ -import React, { useEffect, useState } from "react"; +import React from "react"; +import { Tooltip2 } from "@blueprintjs/popover2"; export type Props = { - direction?: "top" | "right" | "bottom" | "left"; - content: string | React.ReactNode; - margin?: string; - children: React.ReactNode; - className?: string; - disabled?: boolean; + tooltipHeading?: string; + tooltipContent: string; + position?: "top" | "right" | "bottom" | "left"; + children: JSX.Element; }; export const Tooltip: React.FC = ({ - content, - direction = "top", + tooltipHeading, + tooltipContent, + position = "top", children, - margin = "24px", - className = "", - disabled = false, }) => { - const [active, setActive] = useState(false); - const [styleConfig, setStyleConfig] = useState(`top-[calc(-100%-${margin})]`); - let timeout: any; - - const showToolTip = () => { - timeout = setTimeout(() => { - setActive(true); - }, 300); - }; - - const hideToolTip = () => { - clearInterval(timeout); - setActive(false); - }; - - const tooltipStyles = { - top: "left-[50%] translate-x-[-50%] before:contents-[''] before:border-solid before:border-transparent before:h-0 before:w-0 before:absolute before:pointer-events-none before:border-[6px] before:left-[50%] before:ml-[calc(6px*-1)] before:top-full before:border-t-black", - - right: "right-[-100%] top-[50%] translate-x-0 translate-y-[-50%]", - - bottom: - "left-[50%] translate-x-[-50%] before:contents-[''] before:border-solid before:border-transparent before:h-0 before:w-0 before:absolute before:pointer-events-none before:border-[6px] before:left-[50%] before:ml-[calc(6px*-1)] before:bottom-full before:border-b-black", - - left: "left-[-100%] top-[50%] translate-x-0 translate-y-[-50%]", - }; - - useEffect(() => { - const styleConfig = `${direction}-[calc(-100%-${margin})]`; - setStyleConfig(styleConfig); - }, [margin, direction]); - return ( -
- {children} - {active && ( -
- {content} + + {tooltipHeading ? ( + <> +
{tooltipHeading}
+

{tooltipContent}

+ + ) : ( +

{tooltipContent}

+ )}
- )} -
+ } + position={position} + renderTarget={({ isOpen: isTooltipOpen, ref: eleRefernce, ...tooltipProps }) => + React.cloneElement(children, { ref: eleRefernce, ...tooltipProps, ...children.props }) + } + /> ); }; diff --git a/apps/app/package.json b/apps/app/package.json index 21026735e28..634e69e4bba 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -9,6 +9,8 @@ "lint": "next lint" }, "dependencies": { + "@blueprintjs/core": "^4.16.3", + "@blueprintjs/popover2": "^1.13.3", "@headlessui/react": "^1.7.3", "@heroicons/react": "^2.0.12", "@remirror/core": "^2.0.11", @@ -46,8 +48,8 @@ "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", "autoprefixer": "^10.4.7", - "eslint-config-custom": "*", "eslint": "^8.31.0", + "eslint-config-custom": "*", "eslint-config-next": "12.2.2", "postcss": "^8.4.14", "tailwindcss": "^3.1.6", From 6176893c24df5f7d48b15832e8d1b53f62dcaa37 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Wed, 22 Feb 2023 11:13:22 +0530 Subject: [PATCH 3/7] feat: assignees tooltip added --- .../issues/view-select/assignee.tsx | 27 ++++++++++++++----- apps/app/components/ui/avatar.tsx | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/apps/app/components/issues/view-select/assignee.tsx b/apps/app/components/issues/view-select/assignee.tsx index 54d66784196..daae990b85d 100644 --- a/apps/app/components/issues/view-select/assignee.tsx +++ b/apps/app/components/issues/view-select/assignee.tsx @@ -9,7 +9,7 @@ import { Listbox, Transition } from "@headlessui/react"; // services import projectService from "services/project.service"; // ui -import { AssigneesList, Avatar } from "components/ui"; +import { AssigneesList, Avatar, Tooltip } from "components/ui"; // types import { IIssue } from "types"; // fetch-keys @@ -56,13 +56,26 @@ export const ViewAssigneeSelect: React.FC = ({ {({ open }) => (
-
0 + ? issue.assignee_details + .map((assingee) => + assingee.first_name !== "" ? assingee.first_name : assingee.email + ) + .toString() + : "No Assignee" + } > - -
+
+ +
+
= ({ user, index }) => ( -
+
{user && user.avatar && user.avatar !== "" ? (
Date: Wed, 22 Feb 2023 11:35:14 +0530 Subject: [PATCH 4/7] fix: build fix --- apps/app/components/states/single-state.tsx | 20 +++++++++++--------- apps/app/components/ui/tooltip.tsx | 3 +++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/app/components/states/single-state.tsx b/apps/app/components/states/single-state.tsx index d5168427589..e6ddce350fe 100644 --- a/apps/app/components/states/single-state.tsx +++ b/apps/app/components/states/single-state.tsx @@ -184,16 +184,18 @@ export const SingleState: React.FC = ({ Set as default )} - - - + + + diff --git a/apps/app/components/ui/tooltip.tsx b/apps/app/components/ui/tooltip.tsx index 8c2558d32ed..796a01ed8ca 100644 --- a/apps/app/components/ui/tooltip.tsx +++ b/apps/app/components/ui/tooltip.tsx @@ -6,6 +6,7 @@ export type Props = { tooltipContent: string; position?: "top" | "right" | "bottom" | "left"; children: JSX.Element; + disabled?: boolean; }; export const Tooltip: React.FC = ({ @@ -13,9 +14,11 @@ export const Tooltip: React.FC = ({ tooltipContent, position = "top", children, + disabled = false, }) => { return ( {tooltipHeading ? ( From 350e97f427dff66fbda784b4ed62e9a238b7fb6d Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Wed, 22 Feb 2023 12:59:32 +0530 Subject: [PATCH 5/7] fix: build fix --- apps/app/components/core/list-view/single-issue.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/app/components/core/list-view/single-issue.tsx b/apps/app/components/core/list-view/single-issue.tsx index 80ad522a638..69745f6e2dc 100644 --- a/apps/app/components/core/list-view/single-issue.tsx +++ b/apps/app/components/core/list-view/single-issue.tsx @@ -16,7 +16,6 @@ import { ViewPrioritySelect, ViewStateSelect, } from "components/issues/view-select"; -import { Tooltip2 } from "@blueprintjs/popover2"; // ui import { Tooltip, CustomMenu } from "components/ui"; From 2a772a0a82bc6201c7c75ede50c2246da1661aae Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Wed, 22 Feb 2023 13:10:15 +0530 Subject: [PATCH 6/7] fix: build error --- apps/app/components/ui/tooltip.tsx | 45 +++++++++++++++--------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/apps/app/components/ui/tooltip.tsx b/apps/app/components/ui/tooltip.tsx index 796a01ed8ca..f7fb77425f2 100644 --- a/apps/app/components/ui/tooltip.tsx +++ b/apps/app/components/ui/tooltip.tsx @@ -1,7 +1,8 @@ import React from "react"; + import { Tooltip2 } from "@blueprintjs/popover2"; -export type Props = { +type Props = { tooltipHeading?: string; tooltipContent: string; position?: "top" | "right" | "bottom" | "left"; @@ -15,26 +16,24 @@ export const Tooltip: React.FC = ({ position = "top", children, disabled = false, -}) => { - return ( - - {tooltipHeading ? ( - <> -
{tooltipHeading}
-

{tooltipContent}

- - ) : ( +}) => ( + + {tooltipHeading ? ( + <> +
{tooltipHeading}

{tooltipContent}

- )} -
- } - position={position} - renderTarget={({ isOpen: isTooltipOpen, ref: eleRefernce, ...tooltipProps }) => - React.cloneElement(children, { ref: eleRefernce, ...tooltipProps, ...children.props }) - } - /> - ); -}; + + ) : ( +

{tooltipContent}

+ )} +
+ } + position={position} + renderTarget={({ isOpen: isTooltipOpen, ref: eleRefernce, ...tooltipProps }) => + React.cloneElement(children, { ref: eleRefernce, ...tooltipProps, ...children.props }) + } + /> +); From 70c73c37501c1ca8a4d41a163735b62d4de52d86 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Thu, 23 Feb 2023 03:08:23 +0530 Subject: [PATCH 7/7] fix: minor bugs and ux improvements --- .../core/board-view/single-issue.tsx | 43 ++++++++---- apps/app/components/core/link-modal.tsx | 28 ++++---- .../core/list-view/single-issue.tsx | 42 +++++++---- .../components/core/sidebar/links-list.tsx | 27 +++++--- .../components/cycles/single-cycle-card.tsx | 27 +++----- .../components/icons/external-link-icon.tsx | 38 ++++++++++ apps/app/components/icons/index.ts | 13 ++-- .../components/issues/description-form.tsx | 69 +++++++++---------- apps/app/components/issues/form.tsx | 16 +++-- .../components/issues/my-issues-list-item.tsx | 18 +++++ apps/app/components/issues/sidebar.tsx | 38 +++++----- .../app/components/issues/sub-issues-list.tsx | 37 +++++----- .../issues/view-select/assignee.tsx | 8 +-- apps/app/components/modules/sidebar.tsx | 4 +- .../components/modules/single-module-card.tsx | 29 ++++---- apps/app/components/project/sidebar-list.tsx | 28 ++++---- .../rich-text-editor/toolbar/index.tsx | 12 ++-- .../rich-text-editor/toolbar/link.tsx | 14 +++- .../rich-text-editor/toolbar/ordered-list.tsx | 28 -------- .../toolbar/unordered-list.tsx | 28 -------- apps/app/components/states/single-state.tsx | 6 +- apps/app/hooks/use-issue-properties.tsx | 16 ++--- apps/app/hooks/use-my-issues-filter.tsx | 8 +-- .../projects/[projectId]/settings/states.tsx | 2 +- apps/app/types/issues.d.ts | 8 +-- 25 files changed, 316 insertions(+), 271 deletions(-) create mode 100644 apps/app/components/icons/external-link-icon.tsx delete mode 100644 apps/app/components/rich-text-editor/toolbar/ordered-list.tsx delete mode 100644 apps/app/components/rich-text-editor/toolbar/unordered-list.tsx diff --git a/apps/app/components/core/board-view/single-issue.tsx b/apps/app/components/core/board-view/single-issue.tsx index ea1a37a7a92..1e9c4ddd558 100644 --- a/apps/app/components/core/board-view/single-issue.tsx +++ b/apps/app/components/core/board-view/single-issue.tsx @@ -165,19 +165,15 @@ export const SingleBoardIssue: React.FC = ({ const handleCopyText = () => { const originURL = typeof window !== "undefined" && window.location.origin ? window.location.origin : ""; - copyTextToClipboard(`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`) - .then(() => { - setToastAlert({ - type: "success", - title: "Issue link copied to clipboard", - }); - }) - .catch(() => { - setToastAlert({ - type: "error", - title: "Some error occurred", - }); + copyTextToClipboard( + `${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}` + ).then(() => { + setToastAlert({ + type: "success", + title: "Link Copied!", + message: "Issue link copied to clipboard.", }); + }); }; useEffect(() => { @@ -201,14 +197,14 @@ export const SingleBoardIssue: React.FC = ({
{type && !isNotAllowed && ( - Edit + Edit issue {type !== "issue" && removeIssue && ( <>Remove from {type} )} handleDeleteIssue(issue)}> - Delete permanently + Delete issue Copy issue link @@ -236,7 +232,6 @@ export const SingleBoardIssue: React.FC = ({ issue={issue} partialUpdateIssue={partialUpdateIssue} isNotAllowed={isNotAllowed} - position="left" /> )} {properties.state && selectedGroup !== "state_detail.name" && ( @@ -258,6 +253,24 @@ export const SingleBoardIssue: React.FC = ({ {issue.sub_issues_count} {issue.sub_issues_count === 1 ? "sub-issue" : "sub-issues"}
)} + {properties.labels && ( +
+ {issue.label_details.map((label) => ( + + + {label.name} + + ))} +
+ )} {properties.assignee && ( = ({ isOpen, handleClose, onFormSubmit }
diff --git a/apps/app/components/core/list-view/single-issue.tsx b/apps/app/components/core/list-view/single-issue.tsx index 69745f6e2dc..0dea000203b 100644 --- a/apps/app/components/core/list-view/single-issue.tsx +++ b/apps/app/components/core/list-view/single-issue.tsx @@ -124,19 +124,15 @@ export const SingleListIssue: React.FC = ({ const handleCopyText = () => { const originURL = typeof window !== "undefined" && window.location.origin ? window.location.origin : ""; - copyTextToClipboard(`${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}`) - .then(() => { - setToastAlert({ - type: "success", - title: "Issue link copied to clipboard", - }); - }) - .catch(() => { - setToastAlert({ - type: "error", - title: "Some error occurred", - }); + copyTextToClipboard( + `${originURL}/${workspaceSlug}/projects/${projectId}/issues/${issue.id}` + ).then(() => { + setToastAlert({ + type: "success", + title: "Link Copied!", + message: "Issue link copied to clipboard.", }); + }); }; const isNotAllowed = userAuth.isGuest || userAuth.isViewer; @@ -196,6 +192,24 @@ export const SingleListIssue: React.FC = ({ {issue.sub_issues_count} {issue.sub_issues_count === 1 ? "sub-issue" : "sub-issues"}
)} + {properties.labels && ( +
+ {issue.label_details.map((label) => ( + + + {label.name} + + ))} +
+ )} {properties.assignee && ( = ({ )} {type && !isNotAllowed && ( - Edit + Edit issue {type !== "issue" && removeIssue && ( <>Remove from {type} )} handleDeleteIssue(issue)}> - Delete permanently + Delete issue Copy issue link diff --git a/apps/app/components/core/sidebar/links-list.tsx b/apps/app/components/core/sidebar/links-list.tsx index 2a30510eb01..55f41775c6e 100644 --- a/apps/app/components/core/sidebar/links-list.tsx +++ b/apps/app/components/core/sidebar/links-list.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; // icons import { LinkIcon, TrashIcon } from "@heroicons/react/24/outline"; +import { ExternalLinkIcon } from "components/icons"; // helpers import { timeAgo } from "helpers/date-time.helper"; // types @@ -26,9 +27,17 @@ export const LinksList: React.FC = ({ links, handleDeleteLink, userAuth } return ( <> {links.map((link) => ( -
+
{!isNotAllowed && ( -
+
+ + + + +
)} - - + +
-
{link.title}
- {/*

- Added {timeAgo(link.created_at)} ago by {link.created_by_detail.email} -

*/} +
{link.title}
+

+ Added {timeAgo(link.created_at)} +
+ by {link.created_by_detail.email} +

diff --git a/apps/app/components/cycles/single-cycle-card.tsx b/apps/app/components/cycles/single-cycle-card.tsx index 86589995fc5..40be88dc6e3 100644 --- a/apps/app/components/cycles/single-cycle-card.tsx +++ b/apps/app/components/cycles/single-cycle-card.tsx @@ -70,19 +70,16 @@ export const SingleCycleCard: React.FC = (props) => { const handleCopyText = () => { const originURL = typeof window !== "undefined" && window.location.origin ? window.location.origin : ""; - copyTextToClipboard(`${originURL}/${workspaceSlug}/projects/${projectId}/cycles/${cycle.id}`) - .then(() => { - setToastAlert({ - type: "success", - title: "Cycle link copied to clipboard", - }); - }) - .catch(() => { - setToastAlert({ - type: "error", - title: "Some error occurred", - }); + + copyTextToClipboard( + `${originURL}/${workspaceSlug}/projects/${projectId}/cycles/${cycle.id}` + ).then(() => { + setToastAlert({ + type: "success", + title: "Link Copied!", + message: "Cycle link copied to clipboard.", }); + }); }; return ( @@ -99,11 +96,9 @@ export const SingleCycleCard: React.FC = (props) => { - Copy cycle link Edit cycle - - Delete cycle permanently - + Delete cycle + Copy cycle link
diff --git a/apps/app/components/icons/external-link-icon.tsx b/apps/app/components/icons/external-link-icon.tsx new file mode 100644 index 00000000000..1782880b125 --- /dev/null +++ b/apps/app/components/icons/external-link-icon.tsx @@ -0,0 +1,38 @@ +import React from "react"; + +import type { Props } from "./types"; + +export const ExternalLinkIcon: React.FC = ({ + width = "24", + height = "24", + className, + color = "black", +}) => ( + + + + + + // + // + // +); diff --git a/apps/app/components/icons/index.ts b/apps/app/components/icons/index.ts index 66ad36664b4..dfcb2c5dcc8 100644 --- a/apps/app/components/icons/index.ts +++ b/apps/app/components/icons/index.ts @@ -1,19 +1,26 @@ export * from "./attachment-icon"; export * from "./blocked-icon"; export * from "./blocker-icon"; +export * from "./bolt-icon"; export * from "./calendar-month-icon"; export * from "./cancel-icon"; export * from "./clipboard-icon"; +export * from "./comment-icon"; export * from "./completed-cycle-icon"; export * from "./current-cycle-icon"; export * from "./cycle-icon"; +export * from "./discord-icon"; +export * from "./document-icon"; export * from "./edit-icon"; export * from "./ellipsis-horizontal-icon"; +export * from "./external-link-icon"; +export * from "./github-icon"; export * from "./heartbeat-icon"; export * from "./layer-diagonal-icon"; export * from "./lock-icon"; export * from "./menu-icon"; export * from "./plus-icon"; +export * from "./question-mark-circle-icon"; export * from "./setting-icon"; export * from "./signal-cellular-icon"; export * from "./tag-icon"; @@ -22,9 +29,3 @@ export * from "./upcoming-cycle-icon"; export * from "./user-group-icon"; export * from "./user-icon-circle"; export * from "./user-icon"; -export * from "./question-mark-circle-icon"; -export * from "./bolt-icon"; -export * from "./document-icon"; -export * from "./discord-icon"; -export * from "./github-icon"; -export * from "./comment-icon"; diff --git a/apps/app/components/issues/description-form.tsx b/apps/app/components/issues/description-form.tsx index 2caf5b63550..2a82ec4da65 100644 --- a/apps/app/components/issues/description-form.tsx +++ b/apps/app/components/issues/description-form.tsx @@ -1,4 +1,4 @@ -import { FC, useCallback, useEffect, useMemo } from "react"; +import { FC, useCallback, useEffect, useMemo, useState } from "react"; import dynamic from "next/dynamic"; @@ -18,7 +18,6 @@ const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor }); // types import { IIssue, UserAuth } from "types"; -import useToast from "hooks/use-toast"; export interface IssueDescriptionFormValues { name: string; @@ -37,7 +36,7 @@ export const IssueDescriptionForm: FC = ({ handleFormSubmit, userAuth, }) => { - const { setToastAlert } = useToast(); + const [characterLimit, setCharacterLimit] = useState(false); const { handleSubmit, @@ -55,23 +54,7 @@ export const IssueDescriptionForm: FC = ({ const handleDescriptionFormSubmit = useCallback( (formData: Partial) => { - if (!formData.name || formData.name === "") { - setToastAlert({ - type: "error", - title: "Error in saving!", - message: "Title is required.", - }); - return; - } - - if (formData.name.length > 255) { - setToastAlert({ - type: "error", - title: "Error in saving!", - message: "Title cannot have more than 255 characters.", - }); - return; - } + if (!formData.name || formData.name.length === 0 || formData.name.length > 255) return; handleFormSubmit({ name: formData.name ?? "", @@ -79,7 +62,7 @@ export const IssueDescriptionForm: FC = ({ description_html: formData.description_html ?? "

", }); }, - [handleFormSubmit, setToastAlert] + [handleFormSubmit] ); const debounceHandler = useMemo( @@ -105,21 +88,37 @@ export const IssueDescriptionForm: FC = ({ return (
-