From 4c1aee0cfc130a99d1249d2b8936e04aa7e82d4d Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:20:14 +0530 Subject: [PATCH 1/3] fix: resolve z-index and peek overview component bug (#2624) * fix: resolved z-index issue on peek overview component * fix: fix issue with peekover view in spreadsheet view --------- Co-authored-by: gurusainath --- .../columns/issue/issue-column.tsx | 198 ++++++++++-------- .../issue/spreadsheet-issue-column.tsx | 14 +- .../spreadsheet/spreadsheet-view.tsx | 19 +- .../issues/issue-peek-overview/root.tsx | 2 +- .../issues/issue-peek-overview/view.tsx | 10 +- 5 files changed, 140 insertions(+), 103 deletions(-) diff --git a/web/components/issues/issue-layouts/spreadsheet/columns/issue/issue-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/issue/issue-column.tsx index 18daa039a..3fd042c1d 100644 --- a/web/components/issues/issue-layouts/spreadsheet/columns/issue/issue-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/issue/issue-column.tsx @@ -5,7 +5,6 @@ import { MoreHorizontal, Pencil, Trash2, ChevronRight, Link } from "lucide-react // hooks import useToast from "hooks/use-toast"; // components -import { IssuePeekOverview } from "components/issues/issue-peek-overview"; import { Tooltip } from "@plane/ui"; // helpers import { copyUrlToClipboard } from "helpers/string.helper"; @@ -16,10 +15,16 @@ type Props = { issue: IIssue; expanded: boolean; handleToggleExpand: (issueId: string) => void; - handleUpdateIssue: (issue: IIssue, data: Partial) => void; properties: IIssueDisplayProperties; handleEditIssue: (issue: IIssue) => void; handleDeleteIssue: (issue: IIssue) => void; + setIssuePeekOverView: React.Dispatch< + React.SetStateAction<{ + workspaceSlug: string; + projectId: string; + issueId: string; + } | null> + >; disableUserActions: boolean; nestingLevel: number; }; @@ -28,7 +33,7 @@ export const IssueColumn: React.FC = ({ issue, expanded, handleToggleExpand, - handleUpdateIssue, + setIssuePeekOverView, properties, handleEditIssue, handleDeleteIssue, @@ -53,105 +58,116 @@ export const IssueColumn: React.FC = ({ }); }; + const handleIssuePeekOverview = (issue: IIssue) => { + const { query } = router; + setIssuePeekOverView({ + workspaceSlug: issue?.workspace_detail?.slug, + projectId: issue?.project_detail?.id, + issueId: issue?.id, + }); + router.push({ + pathname: router.pathname, + query: { ...query, peekIssueId: issue?.id }, + }); + }; + const paddingLeft = `${nestingLevel * 54}px`; return ( -
- {properties.key && ( -
-
- - {issue.project_detail?.identifier}-{issue.sequence_id} - + <> +
+ {properties.key && ( +
+
+ + {issue.project_detail?.identifier}-{issue.sequence_id} + - {!disableUserActions && ( -
- setIsOpen(nextOpenState)} - content={ -
- + {!disableUserActions && ( +
+ setIsOpen(nextOpenState)} + content={ +
+ - + - -
- } - placement="bottom-start" + +
+ } + placement="bottom-start" + > + + +
+ )} +
+ + {issue.sub_issues_count > 0 && ( +
+
)}
- - {issue.sub_issues_count > 0 && ( -
- -
- )} -
- )} - handleUpdateIssue(issueToUpdate as IIssue, issueToUpdate)} - > - - -
+ )} +
+ +
handleIssuePeekOverview(issue)} + > {issue.name}
- -
- -
+ +
+
+ ); }; diff --git a/web/components/issues/issue-layouts/spreadsheet/columns/issue/spreadsheet-issue-column.tsx b/web/components/issues/issue-layouts/spreadsheet/columns/issue/spreadsheet-issue-column.tsx index 265925eb0..703174de5 100644 --- a/web/components/issues/issue-layouts/spreadsheet/columns/issue/spreadsheet-issue-column.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/columns/issue/spreadsheet-issue-column.tsx @@ -11,9 +11,15 @@ type Props = { issue: IIssue; expandedIssues: string[]; setExpandedIssues: React.Dispatch>; - handleUpdateIssue: (issue: IIssue, data: Partial) => void; properties: IIssueDisplayProperties; handleIssueAction: (issue: IIssue, action: "copy" | "delete" | "edit") => void; + setIssuePeekOverView: React.Dispatch< + React.SetStateAction<{ + workspaceSlug: string; + projectId: string; + issueId: string; + } | null> + >; disableUserActions: boolean; nestingLevel?: number; }; @@ -22,7 +28,7 @@ export const SpreadsheetIssuesColumn: React.FC = ({ issue, expandedIssues, setExpandedIssues, - handleUpdateIssue, + setIssuePeekOverView, properties, handleIssueAction, disableUserActions, @@ -51,9 +57,9 @@ export const SpreadsheetIssuesColumn: React.FC = ({ expanded={isExpanded} handleToggleExpand={handleToggleExpand} properties={properties} - handleUpdateIssue={handleUpdateIssue} handleEditIssue={() => handleIssueAction(issue, "edit")} handleDeleteIssue={() => handleIssueAction(issue, "delete")} + setIssuePeekOverView={setIssuePeekOverView} disableUserActions={disableUserActions} nestingLevel={nestingLevel} /> @@ -67,10 +73,10 @@ export const SpreadsheetIssuesColumn: React.FC = ({ key={subIssue.id} issue={subIssue} expandedIssues={expandedIssues} - handleUpdateIssue={handleUpdateIssue} setExpandedIssues={setExpandedIssues} properties={properties} handleIssueAction={handleIssueAction} + setIssuePeekOverView={setIssuePeekOverView} disableUserActions={disableUserActions} nestingLevel={nestingLevel + 1} /> diff --git a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx b/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx index 3f49670f3..800383d1d 100644 --- a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx @@ -1,10 +1,10 @@ import React, { useEffect, useRef, useState } from "react"; import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; -import { PlusIcon } from "lucide-react"; // components import { SpreadsheetColumnsList, SpreadsheetIssuesColumn, SpreadsheetInlineCreateIssueForm } from "components/issues"; -import { CustomMenu, Spinner } from "@plane/ui"; +import { IssuePeekOverview } from "components/issues/issue-peek-overview"; +import { Spinner } from "@plane/ui"; // types import { IIssue, @@ -47,6 +47,11 @@ export const SpreadsheetView: React.FC = observer((props) => { } = props; const [expandedIssues, setExpandedIssues] = useState([]); + const [issuePeekOverview, setIssuePeekOverView] = useState<{ + workspaceSlug: string; + projectId: string; + issueId: string; + } | null>(null); const [isInlineCreateIssueFormOpen, setIsInlineCreateIssueFormOpen] = useState(false); @@ -104,11 +109,11 @@ export const SpreadsheetView: React.FC = observer((props) => { key={`${issue.id}_${index}`} issue={issue} expandedIssues={expandedIssues} - handleUpdateIssue={handleUpdateIssue} setExpandedIssues={setExpandedIssues} properties={displayProperties} handleIssueAction={handleIssueAction} disableUserActions={disableUserActions} + setIssuePeekOverView={setIssuePeekOverView} /> ))}
@@ -174,6 +179,14 @@ export const SpreadsheetView: React.FC = observer((props) => { ))} */}
+ {issuePeekOverview && ( + handleUpdateIssue(issueToUpdate as IIssue, issueToUpdate)} + /> + )} ); }); diff --git a/web/components/issues/issue-peek-overview/root.tsx b/web/components/issues/issue-peek-overview/root.tsx index 142adad92..71a5a39e9 100644 --- a/web/components/issues/issue-peek-overview/root.tsx +++ b/web/components/issues/issue-peek-overview/root.tsx @@ -13,7 +13,7 @@ interface IIssuePeekOverview { projectId: string; issueId: string; handleIssue: (issue: Partial) => void; - children: ReactNode; + children?: ReactNode; } export const IssuePeekOverview: FC = observer((props) => { diff --git a/web/components/issues/issue-peek-overview/view.tsx b/web/components/issues/issue-peek-overview/view.tsx index 3f1b0765a..83eb7737a 100644 --- a/web/components/issues/issue-peek-overview/view.tsx +++ b/web/components/issues/issue-peek-overview/view.tsx @@ -1,6 +1,6 @@ import { FC, ReactNode, useState } from "react"; import { useRouter } from "next/router"; -import { PanelRightOpen, Square, SquareCode, MoveRight, MoveDiagonal, Bell, Link2, Trash2 } from "lucide-react"; +import { MoveRight, MoveDiagonal, Bell, Link2, Trash2 } from "lucide-react"; import { observer } from "mobx-react-lite"; import useSWR from "swr"; // components @@ -165,9 +165,11 @@ export const IssueView: FC = observer((props) => { /> )}
-
- {children} -
+ {children && ( +
+ {children} +
+ )} {issueId === peekIssueId && (
Date: Fri, 3 Nov 2023 17:20:49 +0530 Subject: [PATCH 2/3] chore: refactor and improve project member settings (#2625) * fix: project member setting improvement and refactor * fix: typo fix in automations setting --- .../automation/auto-archive-automation.tsx | 2 +- .../automation/auto-close-automation.tsx | 2 +- web/components/project/member-list-item.tsx | 111 +++++++++--------- 3 files changed, 60 insertions(+), 55 deletions(-) diff --git a/web/components/automation/auto-archive-automation.tsx b/web/components/automation/auto-archive-automation.tsx index 30a7c6251..3e664bef4 100644 --- a/web/components/automation/auto-archive-automation.tsx +++ b/web/components/automation/auto-archive-automation.tsx @@ -38,7 +38,7 @@ export const AutoArchiveAutomation: React.FC = ({ projectDetails, handleC

Auto-archive closed issues

- Plane will auto archive issues that have been completed or canceled. + Plane will auto archive issues that have been completed or cancelled.

diff --git a/web/components/automation/auto-close-automation.tsx b/web/components/automation/auto-close-automation.tsx index f5e284ebf..7da250295 100644 --- a/web/components/automation/auto-close-automation.tsx +++ b/web/components/automation/auto-close-automation.tsx @@ -82,7 +82,7 @@ export const AutoCloseAutomation: React.FC = ({ projectDetails, handleCha

Auto-close issues

- Plane will automatically close issue that haven’t been completed or canceled. + Plane will automatically close issue that haven’t been completed or cancelled.

diff --git a/web/components/project/member-list-item.tsx b/web/components/project/member-list-item.tsx index 8ae783c03..f6b0e833b 100644 --- a/web/components/project/member-list-item.tsx +++ b/web/components/project/member-list-item.tsx @@ -11,9 +11,9 @@ import useToast from "hooks/use-toast"; // components import { ConfirmProjectMemberRemove } from "components/project"; // ui -import { CustomMenu, CustomSelect } from "@plane/ui"; +import { CustomSelect, Tooltip } from "@plane/ui"; // icons -import { ChevronDown, X } from "lucide-react"; +import { ChevronDown, XCircle } from "lucide-react"; // constants import { ROLE } from "constants/workspace"; import { TUserProjectRole } from "types"; @@ -46,9 +46,8 @@ export const ProjectMemberListItem: React.FC = observer((props) => { ); // derived values const user = userStore.currentUser; - const { currentProjectRole } = userStore; + const { currentProjectMemberInfo, currentProjectRole } = userStore; const isAdmin = currentProjectRole === 20; - const isOwner = currentProjectRole === 20; const projectMembers = projectStore.members?.[projectId?.toString()!]; const currentUser = projectMembers?.find((item) => item.member.id === user?.id); @@ -69,7 +68,7 @@ export const ProjectMemberListItem: React.FC = observer((props) => { await projectStore.removeMemberFromProject( workspaceSlug.toString(), projectId.toString(), - selectedRemoveMember + selectedRemoveMember.id ); } // if the user is an invite @@ -77,7 +76,7 @@ export const ProjectMemberListItem: React.FC = observer((props) => { await projectInvitationService.deleteProjectInvitation( workspaceSlug.toString(), projectId.toString(), - selectedInviteRemoveMember + selectedInviteRemoveMember.id ); mutate(`PROJECT_INVITATIONS_${projectId.toString()}`); } @@ -89,59 +88,62 @@ export const ProjectMemberListItem: React.FC = observer((props) => { }); }} /> - -
-
+
+
{member.avatar && member.avatar !== "" ? ( -
- {member.display_name} -
- ) : member.display_name || member.email ? ( -
- {(member.display_name || member.email)?.charAt(0)} -
+ + + {member.display_name + + ) : ( -
- ? -
+ + + {(member.display_name ?? member.email ?? "?")[0]} + + )} +
{member.member ? ( - - - {member.first_name} {member.last_name} - - ({member.display_name}) + + {member.first_name} {member.last_name} ) : ( -

{member.display_name || member.email}

+

{member.display_name || member.email}

)} - {isOwner &&

{member.email}

} +

{member.email ?? member.display_name}

-
- {!member.member && ( -
- Pending + +
+ {!member?.status && ( +
+

Pending

)} + +
{ROLE[member.role as keyof typeof ROLE]} - {member.memberId !== user?.id && } + {member.memberId !== currentProjectMemberInfo?.id && ( + + + + )}
} value={member.role} @@ -168,31 +170,34 @@ export const ProjectMemberListItem: React.FC = observer((props) => { !member.member || (currentUser && currentUser.role !== 20 && currentUser.role < member.role) } + placement="bottom-end" > {Object.keys(ROLE).map((key) => { - if (currentUser && currentUser.role !== 20 && currentUser.role < parseInt(key)) return null; + if (currentProjectRole && currentProjectRole !== 20 && currentProjectRole < parseInt(key)) return null; return ( - + <>{ROLE[parseInt(key) as keyof typeof ROLE]} ); })}
- - { - if (member.member) setSelectedRemoveMember(member.id); - else setSelectedInviteRemoveMember(member.id); - }} + {isAdmin && ( + - - - - {member.memberId !== user?.id ? "Remove member" : "Leave project"} - - - + + + )}
From f639e467f84338dc2dcb67bc52c801021e70265a Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:21:38 +0530 Subject: [PATCH 3/3] refactor: replace ui components with plane ui components (#2626) * refactor: replace button component with plane ui component and remove old button component * refactor: replace dropdown component with plane ui component * refactor: replace tooltip, input, textarea, spinner and loader component with plane ui component * refactor: plane ui code refactor --- .../src/breadcrumbs/{index.tsx => index.ts} | 0 .../ui/src/dropdowns/{index.tsx => index.ts} | 0 .../src/form-fields/{index.tsx => index.ts} | 0 packages/ui/src/icons/{index.tsx => index.ts} | 0 .../src/icons/state/{index.tsx => index.ts} | 0 .../ui/src/progress/{index.tsx => index.ts} | 0 .../ui/src/tooltip/{index.tsx => index.ts} | 0 web/components/cycles/cycles-view.tsx | 2 +- web/components/cycles/delete-modal.tsx | 11 ++-- web/components/estimates/estimate-select.tsx | 2 +- web/components/headers/project-views.tsx | 14 ++--- .../roots/project-view-root.tsx | 6 +-- web/components/labels/label-select.tsx | 2 +- .../labels/project-setting-label-group.tsx | 2 +- .../project-setting-label-list-item.tsx | 2 +- web/components/project/members-select.tsx | 4 +- web/components/project/priority-select.tsx | 4 +- web/components/states/create-state-modal.tsx | 3 +- .../states/create-update-state-inline.tsx | 3 +- web/components/states/state-select.tsx | 3 +- web/components/ui/buttons/danger-button.tsx | 36 ------------- web/components/ui/buttons/index.ts | 3 -- web/components/ui/buttons/primary-button.tsx | 32 ----------- .../ui/buttons/secondary-button.tsx | 32 ----------- web/components/ui/buttons/type.d.ts | 10 ---- web/components/ui/index.ts | 1 - web/components/ui/multi-level-dropdown.tsx | 2 +- web/components/ui/product-updates-modal.tsx | 3 +- web/components/views/delete-view-modal.tsx | 10 ++-- web/components/views/form.tsx | 54 ++++++++++++------- web/components/views/views-list.tsx | 4 +- web/components/views/workspace-dashboard.tsx | 8 +-- web/layouts/auth-layout/workspace-wrapper.tsx | 10 ++-- 33 files changed, 85 insertions(+), 178 deletions(-) rename packages/ui/src/breadcrumbs/{index.tsx => index.ts} (100%) rename packages/ui/src/dropdowns/{index.tsx => index.ts} (100%) rename packages/ui/src/form-fields/{index.tsx => index.ts} (100%) rename packages/ui/src/icons/{index.tsx => index.ts} (100%) rename packages/ui/src/icons/state/{index.tsx => index.ts} (100%) rename packages/ui/src/progress/{index.tsx => index.ts} (100%) rename packages/ui/src/tooltip/{index.tsx => index.ts} (100%) delete mode 100644 web/components/ui/buttons/danger-button.tsx delete mode 100644 web/components/ui/buttons/index.ts delete mode 100644 web/components/ui/buttons/primary-button.tsx delete mode 100644 web/components/ui/buttons/secondary-button.tsx delete mode 100644 web/components/ui/buttons/type.d.ts diff --git a/packages/ui/src/breadcrumbs/index.tsx b/packages/ui/src/breadcrumbs/index.ts similarity index 100% rename from packages/ui/src/breadcrumbs/index.tsx rename to packages/ui/src/breadcrumbs/index.ts diff --git a/packages/ui/src/dropdowns/index.tsx b/packages/ui/src/dropdowns/index.ts similarity index 100% rename from packages/ui/src/dropdowns/index.tsx rename to packages/ui/src/dropdowns/index.ts diff --git a/packages/ui/src/form-fields/index.tsx b/packages/ui/src/form-fields/index.ts similarity index 100% rename from packages/ui/src/form-fields/index.tsx rename to packages/ui/src/form-fields/index.ts diff --git a/packages/ui/src/icons/index.tsx b/packages/ui/src/icons/index.ts similarity index 100% rename from packages/ui/src/icons/index.tsx rename to packages/ui/src/icons/index.ts diff --git a/packages/ui/src/icons/state/index.tsx b/packages/ui/src/icons/state/index.ts similarity index 100% rename from packages/ui/src/icons/state/index.tsx rename to packages/ui/src/icons/state/index.ts diff --git a/packages/ui/src/progress/index.tsx b/packages/ui/src/progress/index.ts similarity index 100% rename from packages/ui/src/progress/index.tsx rename to packages/ui/src/progress/index.ts diff --git a/packages/ui/src/tooltip/index.tsx b/packages/ui/src/tooltip/index.ts similarity index 100% rename from packages/ui/src/tooltip/index.tsx rename to packages/ui/src/tooltip/index.ts diff --git a/web/components/cycles/cycles-view.tsx b/web/components/cycles/cycles-view.tsx index cacd23905..4eea43e6d 100644 --- a/web/components/cycles/cycles-view.tsx +++ b/web/components/cycles/cycles-view.tsx @@ -6,7 +6,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; // components import { CyclesBoard, CyclesList, CyclesListGanttChartView } from "components/cycles"; // ui components -import { Loader } from "components/ui"; +import { Loader } from "@plane/ui"; // types import { TCycleLayout } from "types"; diff --git a/web/components/cycles/delete-modal.tsx b/web/components/cycles/delete-modal.tsx index 02d6126fe..b7f25028d 100644 --- a/web/components/cycles/delete-modal.tsx +++ b/web/components/cycles/delete-modal.tsx @@ -3,7 +3,7 @@ import { Dialog, Transition } from "@headlessui/react"; import { observer } from "mobx-react-lite"; import { AlertTriangle } from "lucide-react"; // components -import { DangerButton, SecondaryButton } from "components/ui"; +import { Button } from "@plane/ui"; // hooks import useToast from "hooks/use-toast"; // types @@ -101,10 +101,13 @@ export const CycleDeleteModal: React.FC = observer((props) => {

- Cancel - + + +
diff --git a/web/components/estimates/estimate-select.tsx b/web/components/estimates/estimate-select.tsx index 5ac283b83..e02cfaf89 100644 --- a/web/components/estimates/estimate-select.tsx +++ b/web/components/estimates/estimate-select.tsx @@ -3,7 +3,7 @@ import { usePopper } from "react-popper"; import { Combobox } from "@headlessui/react"; import { Check, ChevronDown, Search, Triangle } from "lucide-react"; // types -import { Tooltip } from "components/ui"; +import { Tooltip } from "@plane/ui"; import { Placement } from "@popperjs/core"; // constants import { IEstimatePoint } from "types"; diff --git a/web/components/headers/project-views.tsx b/web/components/headers/project-views.tsx index 52aa23c2f..a50e0774b 100644 --- a/web/components/headers/project-views.tsx +++ b/web/components/headers/project-views.tsx @@ -8,9 +8,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; // components import { CreateUpdateProjectViewModal } from "components/views"; // components -import { Breadcrumbs, BreadcrumbItem } from "@plane/ui"; -// ui -import { PrimaryButton } from "components/ui"; +import { Breadcrumbs, BreadcrumbItem, Button } from "@plane/ui"; // helpers import { truncateText } from "helpers/string.helper"; @@ -59,10 +57,14 @@ export const ProjectViewsHeader: React.FC = observer(() => {
- setCreateViewModal(true)}> - +
diff --git a/web/components/issues/issue-layouts/filters/applied-filters/roots/project-view-root.tsx b/web/components/issues/issue-layouts/filters/applied-filters/roots/project-view-root.tsx index 368b6b6fa..c8ee36fe7 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/roots/project-view-root.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/roots/project-view-root.tsx @@ -7,7 +7,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; // components import { AppliedFiltersList } from "components/issues"; // ui -import { PrimaryButton } from "components/ui"; +import { Button } from "@plane/ui"; // helpers import { areFiltersDifferent } from "helpers/filter.helper"; // types @@ -102,9 +102,9 @@ export const ProjectViewAppliedFiltersRoot: React.FC = observer(() => { states={projectStore.states?.[projectId?.toString() ?? ""]} /> {storedFilters && viewDetails && areFiltersDifferent(storedFilters, viewDetails.query_data ?? {}) && ( - + )}
); diff --git a/web/components/labels/label-select.tsx b/web/components/labels/label-select.tsx index c70aa8d29..162c78b96 100644 --- a/web/components/labels/label-select.tsx +++ b/web/components/labels/label-select.tsx @@ -4,7 +4,7 @@ import { Placement } from "@popperjs/core"; import { Combobox } from "@headlessui/react"; import { Check, ChevronDown, Search } from "lucide-react"; // ui -import { Tooltip } from "components/ui"; +import { Tooltip } from "@plane/ui"; // types import { IIssueLabels } from "types"; diff --git a/web/components/labels/project-setting-label-group.tsx b/web/components/labels/project-setting-label-group.tsx index 675bcee72..a9949bb00 100644 --- a/web/components/labels/project-setting-label-group.tsx +++ b/web/components/labels/project-setting-label-group.tsx @@ -6,7 +6,7 @@ import { Disclosure, Transition } from "@headlessui/react"; import { observer } from "mobx-react-lite"; import { useMobxStore } from "lib/mobx/store-provider"; // ui -import { CustomMenu } from "components/ui"; +import { CustomMenu } from "@plane/ui"; // icons import { ChevronDown, Component, Pencil, Plus, Trash2, X } from "lucide-react"; // types diff --git a/web/components/labels/project-setting-label-list-item.tsx b/web/components/labels/project-setting-label-list-item.tsx index 41b4a8cb7..1729a6d8b 100644 --- a/web/components/labels/project-setting-label-list-item.tsx +++ b/web/components/labels/project-setting-label-list-item.tsx @@ -3,7 +3,7 @@ import React, { useRef, useState } from "react"; //hook import useOutsideClickDetector from "hooks/use-outside-click-detector"; // ui -import { CustomMenu } from "components/ui"; +import { CustomMenu } from "@plane/ui"; // types import { IIssueLabels } from "types"; //icons diff --git a/web/components/project/members-select.tsx b/web/components/project/members-select.tsx index b08e2ce00..457dd7d80 100644 --- a/web/components/project/members-select.tsx +++ b/web/components/project/members-select.tsx @@ -3,10 +3,8 @@ import { usePopper } from "react-popper"; import { Placement } from "@popperjs/core"; import { Combobox } from "@headlessui/react"; import { Check, ChevronDown, Search, User2 } from "lucide-react"; -// components -import { Tooltip } from "components/ui"; // ui -import { Avatar, AvatarGroup } from "@plane/ui"; +import { Avatar, AvatarGroup, Tooltip } from "@plane/ui"; // types import { IUserLite } from "types"; diff --git a/web/components/project/priority-select.tsx b/web/components/project/priority-select.tsx index 38a51ff6e..322938579 100644 --- a/web/components/project/priority-select.tsx +++ b/web/components/project/priority-select.tsx @@ -3,9 +3,7 @@ import { usePopper } from "react-popper"; import { Placement } from "@popperjs/core"; import { Combobox } from "@headlessui/react"; import { Check, ChevronDown, Search } from "lucide-react"; -import { PriorityIcon } from "@plane/ui"; -// components -import { Tooltip } from "components/ui"; +import { PriorityIcon, Tooltip } from "@plane/ui"; // helpers import { capitalizeFirstLetter } from "helpers/string.helper"; // types diff --git a/web/components/states/create-state-modal.tsx b/web/components/states/create-state-modal.tsx index c89937c07..46e36898d 100644 --- a/web/components/states/create-state-modal.tsx +++ b/web/components/states/create-state-modal.tsx @@ -10,8 +10,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; // hooks import useToast from "hooks/use-toast"; // ui -import { CustomSelect } from "components/ui"; -import { Button, Input, TextArea } from "@plane/ui"; +import { Button, CustomSelect, Input, TextArea } from "@plane/ui"; // icons import { ChevronDown } from "lucide-react"; // types diff --git a/web/components/states/create-update-state-inline.tsx b/web/components/states/create-update-state-inline.tsx index 8c910daa4..15a268272 100644 --- a/web/components/states/create-update-state-inline.tsx +++ b/web/components/states/create-update-state-inline.tsx @@ -11,8 +11,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; // hooks import useToast from "hooks/use-toast"; // ui -import { CustomSelect } from "components/ui"; -import { Button, Input, Tooltip } from "@plane/ui"; +import { Button, CustomSelect, Input, Tooltip } from "@plane/ui"; // types import type { IState } from "types"; // fetch-keys diff --git a/web/components/states/state-select.tsx b/web/components/states/state-select.tsx index b3765e767..8f1872f19 100644 --- a/web/components/states/state-select.tsx +++ b/web/components/states/state-select.tsx @@ -4,8 +4,7 @@ import { Placement } from "@popperjs/core"; import { Combobox } from "@headlessui/react"; import { Check, ChevronDown, Search } from "lucide-react"; // ui -import { StateGroupIcon } from "@plane/ui"; -import { Tooltip } from "components/ui"; +import { StateGroupIcon, Tooltip } from "@plane/ui"; // types import { IState } from "types"; diff --git a/web/components/ui/buttons/danger-button.tsx b/web/components/ui/buttons/danger-button.tsx deleted file mode 100644 index 3adb7012b..000000000 --- a/web/components/ui/buttons/danger-button.tsx +++ /dev/null @@ -1,36 +0,0 @@ -// types -import { ButtonProps } from "./type"; - -export const DangerButton: React.FC = ({ - children, - className = "", - onClick, - type = "button", - disabled = false, - loading = false, - size = "sm", - outline = false, -}) => ( - -); diff --git a/web/components/ui/buttons/index.ts b/web/components/ui/buttons/index.ts deleted file mode 100644 index 0ce5c556a..000000000 --- a/web/components/ui/buttons/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./danger-button"; -export * from "./primary-button"; -export * from "./secondary-button"; diff --git a/web/components/ui/buttons/primary-button.tsx b/web/components/ui/buttons/primary-button.tsx deleted file mode 100644 index 8817679b4..000000000 --- a/web/components/ui/buttons/primary-button.tsx +++ /dev/null @@ -1,32 +0,0 @@ -// types -import { ButtonProps } from "./type"; - -export const PrimaryButton: React.FC = ({ - children, - className = "", - onClick, - type = "button", - disabled = false, - loading = false, - size = "sm", - outline = false, -}) => ( - -); diff --git a/web/components/ui/buttons/secondary-button.tsx b/web/components/ui/buttons/secondary-button.tsx deleted file mode 100644 index a642dd65f..000000000 --- a/web/components/ui/buttons/secondary-button.tsx +++ /dev/null @@ -1,32 +0,0 @@ -// types -import { ButtonProps } from "./type"; - -export const SecondaryButton: React.FC = ({ - children, - className = "", - onClick, - type = "button", - disabled = false, - loading = false, - size = "sm", - outline = false, -}) => ( - -); diff --git a/web/components/ui/buttons/type.d.ts b/web/components/ui/buttons/type.d.ts deleted file mode 100644 index b227887ef..000000000 --- a/web/components/ui/buttons/type.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type ButtonProps = { - children: React.ReactNode; - className?: string; - onClick?: (e: any) => void; - type?: "button" | "submit" | "reset"; - disabled?: boolean; - loading?: boolean; - size?: "sm" | "md" | "lg"; - outline?: boolean; -}; diff --git a/web/components/ui/index.ts b/web/components/ui/index.ts index 9aa134642..e92fbf6f8 100644 --- a/web/components/ui/index.ts +++ b/web/components/ui/index.ts @@ -1,4 +1,3 @@ -export * from "./buttons"; export * from "./dropdowns"; export * from "./graphs"; export * from "./input"; diff --git a/web/components/ui/multi-level-dropdown.tsx b/web/components/ui/multi-level-dropdown.tsx index dfc743811..13ed5c29c 100644 --- a/web/components/ui/multi-level-dropdown.tsx +++ b/web/components/ui/multi-level-dropdown.tsx @@ -3,7 +3,7 @@ import { Fragment, useState } from "react"; // headless ui import { Menu, Transition } from "@headlessui/react"; // ui -import { Loader } from "components/ui"; +import { Loader } from "@plane/ui"; // icons import { Check, ChevronDown, ChevronLeft, ChevronRight } from "lucide-react"; diff --git a/web/components/ui/product-updates-modal.tsx b/web/components/ui/product-updates-modal.tsx index f5298be6e..4cd2bfc56 100644 --- a/web/components/ui/product-updates-modal.tsx +++ b/web/components/ui/product-updates-modal.tsx @@ -7,7 +7,8 @@ import { Dialog, Transition } from "@headlessui/react"; // services import { WorkspaceService } from "services/workspace.service"; // components -import { Loader, MarkdownRenderer } from "components/ui"; +import { MarkdownRenderer } from "components/ui"; +import { Loader } from "@plane/ui"; // icons import { X } from "lucide-react"; // helpers diff --git a/web/components/views/delete-view-modal.tsx b/web/components/views/delete-view-modal.tsx index b4167e369..5d0f6bd96 100644 --- a/web/components/views/delete-view-modal.tsx +++ b/web/components/views/delete-view-modal.tsx @@ -8,7 +8,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; // hooks import useToast from "hooks/use-toast"; // ui -import { DangerButton, SecondaryButton } from "components/ui"; +import { Button } from "@plane/ui"; // icons import { AlertTriangle } from "lucide-react"; // types @@ -112,10 +112,12 @@ export const DeleteProjectViewModal: React.FC = observer((props) => {
- Cancel - + +
diff --git a/web/components/views/form.tsx b/web/components/views/form.tsx index 9ec5b16f7..55ccb2fee 100644 --- a/web/components/views/form.tsx +++ b/web/components/views/form.tsx @@ -7,7 +7,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; // components import { AppliedFiltersList, FilterSelection, FiltersDropdown } from "components/issues"; // ui -import { Input, PrimaryButton, SecondaryButton, TextArea } from "components/ui"; +import { Button, Input, TextArea } from "@plane/ui"; // types import { IProjectView } from "types"; // constants @@ -32,7 +32,6 @@ export const ProjectViewForm: React.FC = observer(({ handleFormSubmit, ha control, formState: { errors, isSubmitting }, handleSubmit, - register, reset, setValue, watch, @@ -70,32 +69,45 @@ export const ProjectViewForm: React.FC = observer(({ handleFormSubmit, ha

{data ? "Update" : "Create"} View

- ( + + )} />
-