From 5eb7740833f2a5265761007e363b5459934b96d3 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Wed, 29 Nov 2023 20:32:10 +0530 Subject: [PATCH] fix: removed unused packages and upgraded to next 14 (#2944) * fix: upgrading next package and removed unused deps * chore: unused variable removed * chore: next image icon fix * chore: unused component removed * chore: next image icon fix * chore: replace use-debounce with lodash debounce * chore: unused component removed * resolved: fixed issue with next link component * fix: updates in next config * fix: updating types pages --------- Co-authored-by: Anmol Singh Bhatia --- package.json | 2 +- packages/editor/core/package.json | 2 +- packages/editor/document-editor/package.json | 2 +- packages/editor/extensions/package.json | 2 +- packages/editor/lite-text-editor/package.json | 2 +- packages/editor/rich-text-editor/package.json | 2 +- packages/editor/types/package.json | 2 +- packages/ui/package.json | 2 +- .../accounts/email-password-form.tsx | 8 +- space/components/issues/navbar/index.tsx | 4 +- .../issues/peek-overview/issue-activity.tsx | 4 +- space/package.json | 2 +- web/components/account/email-signup-form.tsx | 4 +- .../custom-analytics/graph/index.tsx | 3 +- .../auth-screens/not-authorized-view.tsx | 4 +- .../auth-screens/workspace/not-a-member.tsx | 8 +- web/components/breadcrumbs/index.tsx | 4 +- web/components/common/empty-state.tsx | 2 +- web/components/common/new-empty-state.tsx | 4 +- .../cycles/active-cycle-details.tsx | 4 +- web/components/cycles/cycles-board-card.tsx | 4 +- web/components/cycles/cycles-list-item.tsx | 4 +- web/components/cycles/delete-modal.tsx | 40 ++-- web/components/exporter/guide.tsx | 4 +- web/components/headers/global-issues.tsx | 4 +- web/components/headers/project-issues.tsx | 4 +- web/components/icons/audio-file-icon.tsx | 10 +- web/components/icons/cmd-icon.tsx | 7 +- web/components/icons/css-file-icon.tsx | 7 +- web/components/icons/csv-file-icon.tsx | 7 +- web/components/icons/default-file-icon.tsx | 7 +- web/components/icons/doc-file-icon.tsx | 7 +- web/components/icons/figma-file-icon.tsx | 7 +- web/components/icons/html-file-icon.tsx | 7 +- web/components/icons/img-file-icon.tsx | 7 +- web/components/icons/jpg-file-icon.tsx | 7 +- web/components/icons/js-file-icon.tsx | 7 +- web/components/icons/pdf-file-icon.tsx | 7 +- web/components/icons/png-file-icon.tsx | 7 +- web/components/icons/sheet-file-icon.tsx | 7 +- web/components/icons/svg-file-icon.tsx | 7 +- web/components/icons/txt-file-icon.tsx | 7 +- web/components/icons/types.d.ts | 5 + web/components/icons/video-file-icon.tsx | 7 +- web/components/inbox/issue-card.tsx | 4 +- web/components/instance/general-form.tsx | 2 +- web/components/instance/help-section.tsx | 9 +- .../instance/instance-admin-restriction.tsx | 4 +- web/components/instance/sidebar-dropdown.tsx | 12 +- web/components/instance/sidebar-menu.tsx | 4 +- web/components/integration/github/root.tsx | 4 +- web/components/integration/guide.tsx | 4 +- .../integration/jira/give-details.tsx | 14 +- web/components/integration/jira/root.tsx | 6 +- web/components/issues/activity.tsx | 4 +- .../issues/attachment/attachments.tsx | 6 +- web/components/issues/description-form.tsx | 4 +- .../empty-states/project-view.tsx | 4 - .../issue-layouts/empty-states/project.tsx | 3 +- .../roots/project-view-root.tsx | 1 - .../header/display-filters/extra-options.tsx | 2 +- .../issues/issue-layouts/kanban/default.tsx | 1 - .../kanban/headers/group-by-card.tsx | 3 - .../issue-layouts/kanban/headers/priority.tsx | 1 - .../kanban/quick-add-issue-form.tsx | 2 +- .../issues/issue-layouts/list/default.tsx | 2 +- .../issue-layouts/properties/assignee.tsx | 2 - .../issue-layouts/properties/labels.tsx | 2 - .../issues/issue-layouts/properties/state.tsx | 2 - .../issue-peek-overview/activity/card.tsx | 4 +- .../issue-peek-overview/issue-detail.tsx | 4 +- web/components/issues/modal.tsx | 2 +- web/components/modules/module-card-item.tsx | 4 +- web/components/modules/module-list-item.tsx | 4 +- web/components/modules/modules-list-view.tsx | 1 - web/components/onboarding/invitations.tsx | 22 +- web/components/onboarding/join-workspaces.tsx | 2 +- .../page-views/workspace-dashboard.tsx | 3 - web/components/pages/pages-list/list-item.tsx | 4 +- web/components/profile/navbar.tsx | 4 +- web/components/profile/overview/stats.tsx | 4 +- web/components/profile/sidebar.tsx | 4 +- web/components/project/card-list.tsx | 2 - web/components/project/empty-state.tsx | 2 +- web/components/project/member-list-item.tsx | 12 +- .../project/send-project-invitation-modal.tsx | 24 +-- web/components/project/sidebar-list-item.tsx | 10 +- .../states/create-update-state-inline.tsx | 63 +++--- web/components/states/delete-state-modal.tsx | 25 +-- web/components/ui/circular-progress.tsx | 39 ---- web/components/ui/dropdowns/context-menu.tsx | 123 ------------ web/components/ui/dropdowns/custom-menu.tsx | 162 --------------- .../ui/dropdowns/custom-search-select.tsx | 188 ------------------ web/components/ui/dropdowns/custom-select.tsx | 130 ------------ web/components/ui/dropdowns/index.ts | 5 - web/components/ui/dropdowns/types.d.ts | 18 -- web/components/ui/empty-space.tsx | 4 +- web/components/ui/icon.tsx | 10 - web/components/ui/index.ts | 11 - web/components/ui/input/index.tsx | 52 ----- web/components/ui/input/types.d.ts | 15 -- .../ui/linear-progress-indicator.tsx | 39 ---- web/components/ui/loader.tsx | 25 --- web/components/ui/progress-bar.tsx | 68 ------- web/components/ui/spinner.tsx | 23 --- web/components/ui/text-area/index.tsx | 83 -------- web/components/ui/text-area/types.d.ts | 13 -- web/components/ui/toggle-switch.tsx | 39 ---- web/components/ui/tooltip.tsx | 68 ------- web/components/views/view-list-item.tsx | 4 +- .../web-hooks/webhooks-list-item.tsx | 4 +- .../workspace/create-workspace-form.tsx | 2 - .../workspace/delete-workspace-modal.tsx | 36 ++-- web/components/workspace/help-section.tsx | 9 +- web/components/workspace/issues-list.tsx | 4 +- .../workspace/settings/members-list-item.tsx | 12 +- web/components/workspace/sidebar-dropdown.tsx | 8 +- web/components/workspace/sidebar-menu.tsx | 4 +- .../views/default-view-list-item.tsx | 4 +- web/components/workspace/views/header.tsx | 8 +- .../workspace/views/view-list-item.tsx | 4 +- web/layouts/auth-layout/workspace-wrapper.tsx | 8 +- .../settings-layout/profile/sidebar.tsx | 4 +- .../settings-layout/project/sidebar.tsx | 4 +- .../settings-layout/workspace/sidebar.tsx | 4 +- web/lib/wrappers/posthog-wrapper.tsx | 2 +- web/next.config.js | 6 - web/package.json | 8 +- web/pages/404.tsx | 4 +- web/pages/[workspaceSlug]/analytics.tsx | 1 - .../projects/[projectId]/cycles/index.tsx | 3 +- .../projects/[projectId]/pages/[pageId].tsx | 4 +- web/pages/god-mode/authorization.tsx | 2 +- web/pages/invitations/index.tsx | 4 +- web/pages/profile/activity.tsx | 6 +- web/pages/profile/index.tsx | 4 +- yarn.lock | 159 +++++++++++---- 137 files changed, 469 insertions(+), 1524 deletions(-) delete mode 100644 web/components/ui/circular-progress.tsx delete mode 100644 web/components/ui/dropdowns/context-menu.tsx delete mode 100644 web/components/ui/dropdowns/custom-menu.tsx delete mode 100644 web/components/ui/dropdowns/custom-search-select.tsx delete mode 100644 web/components/ui/dropdowns/custom-select.tsx delete mode 100644 web/components/ui/dropdowns/index.ts delete mode 100644 web/components/ui/dropdowns/types.d.ts delete mode 100644 web/components/ui/icon.tsx delete mode 100644 web/components/ui/input/index.tsx delete mode 100644 web/components/ui/input/types.d.ts delete mode 100644 web/components/ui/linear-progress-indicator.tsx delete mode 100644 web/components/ui/loader.tsx delete mode 100644 web/components/ui/progress-bar.tsx delete mode 100644 web/components/ui/spinner.tsx delete mode 100644 web/components/ui/text-area/index.tsx delete mode 100644 web/components/ui/text-area/types.d.ts delete mode 100644 web/components/ui/toggle-switch.tsx delete mode 100644 web/components/ui/tooltip.tsx diff --git a/package.json b/package.json index 86f010f3f..db4c072a2 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "turbo": "^1.10.16" }, "resolutions": { - "@types/react": "18.2.0" + "@types/react": "18.2.39" }, "packageManager": "yarn@1.22.19" } diff --git a/packages/editor/core/package.json b/packages/editor/core/package.json index cb6b73a52..83ae6b7a4 100644 --- a/packages/editor/core/package.json +++ b/packages/editor/core/package.json @@ -65,7 +65,7 @@ "postcss": "^8.4.29", "eslint-config-next": "13.2.4", "@types/node": "18.15.3", - "@types/react": "^18.2.5", + "@types/react": "^18.2.39", "@types/react-dom": "18.0.11", "tailwind-config-custom": "*", "tsconfig": "*", diff --git a/packages/editor/document-editor/package.json b/packages/editor/document-editor/package.json index d1ee6ceb0..4cd7e40bd 100644 --- a/packages/editor/document-editor/package.json +++ b/packages/editor/document-editor/package.json @@ -35,7 +35,7 @@ "@tiptap/core": "^2.1.7", "@tiptap/extension-placeholder": "^2.1.11", "@types/node": "18.15.3", - "@types/react": "^18.2.5", + "@types/react": "^18.2.39", "@types/react-dom": "18.0.11", "eslint": "8.36.0", "eslint-config-next": "13.2.4", diff --git a/packages/editor/extensions/package.json b/packages/editor/extensions/package.json index 54733949e..bc1826c96 100644 --- a/packages/editor/extensions/package.json +++ b/packages/editor/extensions/package.json @@ -41,7 +41,7 @@ }, "devDependencies": { "@types/node": "18.15.3", - "@types/react": "^18.2.35", + "@types/react": "^18.2.39", "@types/react-dom": "^18.2.14", "eslint": "^7.32.0", "postcss": "^8.4.29", diff --git a/packages/editor/lite-text-editor/package.json b/packages/editor/lite-text-editor/package.json index 32e4cde27..439381a8b 100644 --- a/packages/editor/lite-text-editor/package.json +++ b/packages/editor/lite-text-editor/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/node": "18.15.3", - "@types/react": "^18.2.35", + "@types/react": "^18.2.39", "@types/react-dom": "^18.2.14", "eslint": "^7.32.0", "postcss": "^8.4.29", diff --git a/packages/editor/rich-text-editor/package.json b/packages/editor/rich-text-editor/package.json index 14ef30c3a..358a210da 100644 --- a/packages/editor/rich-text-editor/package.json +++ b/packages/editor/rich-text-editor/package.json @@ -38,7 +38,7 @@ }, "devDependencies": { "@types/node": "18.15.3", - "@types/react": "^18.2.35", + "@types/react": "^18.2.39", "@types/react-dom": "^18.2.14", "eslint": "^7.32.0", "postcss": "^8.4.29", diff --git a/packages/editor/types/package.json b/packages/editor/types/package.json index 97c243690..3b947035f 100644 --- a/packages/editor/types/package.json +++ b/packages/editor/types/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/node": "18.15.3", - "@types/react": "^18.2.35", + "@types/react": "^18.2.39", "@types/react-dom": "^18.2.14", "eslint": "^7.32.0", "tsconfig": "*", diff --git a/packages/ui/package.json b/packages/ui/package.json index 32e0a3a43..2dc4fd6de 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "@types/node": "^20.5.2", - "@types/react": "^18.2.37", + "@types/react": "^18.2.39", "@types/react-color": "^3.0.9", "@types/react-dom": "^18.2.15", "classnames": "^2.3.2", diff --git a/space/components/accounts/email-password-form.tsx b/space/components/accounts/email-password-form.tsx index b00740a15..775f1a3c2 100644 --- a/space/components/accounts/email-password-form.tsx +++ b/space/components/accounts/email-password-form.tsx @@ -77,7 +77,9 @@ export const EmailPasswordForm: React.FC = ({ onSubmit }) => {
{isSignUpPage ? ( - Already have an account? Sign in. + + Already have an account? Sign in. + ) : (
diff --git a/space/components/issues/navbar/index.tsx b/space/components/issues/navbar/index.tsx index 03f082f33..8cc25090a 100644 --- a/space/components/issues/navbar/index.tsx +++ b/space/components/issues/navbar/index.tsx @@ -130,11 +130,11 @@ const IssueNavbar = observer(() => { ) : (
- + Sign in - +
)} diff --git a/space/components/issues/peek-overview/issue-activity.tsx b/space/components/issues/peek-overview/issue-activity.tsx index fde2fd878..5bb846214 100644 --- a/space/components/issues/peek-overview/issue-activity.tsx +++ b/space/components/issues/peek-overview/issue-activity.tsx @@ -53,9 +53,9 @@ export const PeekOverviewIssueActivity: React.FC = observer((props) => { Sign in to add your comment

- + Sign in - + )} diff --git a/space/package.json b/space/package.json index 6bd61d41b..9d2521e01 100644 --- a/space/package.json +++ b/space/package.json @@ -44,7 +44,7 @@ "@types/js-cookie": "^3.0.3", "@types/node": "18.14.1", "@types/nprogress": "^0.2.0", - "@types/react": "18.2.35", + "@types/react": "18.2.39", "@types/react-dom": "18.0.11", "@types/uuid": "^9.0.1", "@typescript-eslint/eslint-plugin": "^5.48.2", diff --git a/web/components/account/email-signup-form.tsx b/web/components/account/email-signup-form.tsx index a60a83230..48c67bbf2 100644 --- a/web/components/account/email-signup-form.tsx +++ b/web/components/account/email-signup-form.tsx @@ -114,7 +114,9 @@ export const EmailSignUpForm: React.FC = (props) => {
- Already have an account? Sign in. + + Already have an account? Sign in. +
diff --git a/web/components/analytics/custom-analytics/graph/index.tsx b/web/components/analytics/custom-analytics/graph/index.tsx index 0908609c9..0e2949d3c 100644 --- a/web/components/analytics/custom-analytics/graph/index.tsx +++ b/web/components/analytics/custom-analytics/graph/index.tsx @@ -2,8 +2,9 @@ import { BarDatum } from "@nivo/bar"; // components import { CustomTooltip } from "./custom-tooltip"; +import { Tooltip } from "@plane/ui"; // ui -import { BarGraph, Tooltip } from "components/ui"; +import { BarGraph } from "components/ui"; // helpers import { findStringWithMostCharacters } from "helpers/array.helper"; import { generateBarColor, generateDisplayName } from "helpers/analytics.helper"; diff --git a/web/components/auth-screens/not-authorized-view.tsx b/web/components/auth-screens/not-authorized-view.tsx index 509bc1e84..353bb8fce 100644 --- a/web/components/auth-screens/not-authorized-view.tsx +++ b/web/components/auth-screens/not-authorized-view.tsx @@ -38,7 +38,7 @@ export const NotAuthorizedView: React.FC = ({ actionButton, type }) => {

You have signed in as {user.email}.
- Sign in + Sign in {" "} with different account that has access to this page.

@@ -46,7 +46,7 @@ export const NotAuthorizedView: React.FC = ({ actionButton, type }) => {

You need to{" "} - Sign in + Sign in {" "} with an account that has access to this page.

diff --git a/web/components/auth-screens/workspace/not-a-member.tsx b/web/components/auth-screens/workspace/not-a-member.tsx index 6737115a0..502f06115 100644 --- a/web/components/auth-screens/workspace/not-a-member.tsx +++ b/web/components/auth-screens/workspace/not-a-member.tsx @@ -18,14 +18,14 @@ export const NotAWorkspaceMember = () => (
diff --git a/web/components/breadcrumbs/index.tsx b/web/components/breadcrumbs/index.tsx index 2702b8e68..eed78fcf6 100644 --- a/web/components/breadcrumbs/index.tsx +++ b/web/components/breadcrumbs/index.tsx @@ -45,12 +45,12 @@ const BreadcrumbItem: React.FC = ({ <> {link ? ( - +

{icon ?? null} {title}

-
+ ) : (
diff --git a/web/components/common/empty-state.tsx b/web/components/common/empty-state.tsx index bf49ed776..a64690c95 100644 --- a/web/components/common/empty-state.tsx +++ b/web/components/common/empty-state.tsx @@ -28,7 +28,7 @@ export const EmptyState: React.FC = ({ }) => (
- {primaryButton?.text} + {primaryButton?.text
{title}
{description &&

{description}

}
diff --git a/web/components/common/new-empty-state.tsx b/web/components/common/new-empty-state.tsx index 49caff097..d11604d37 100644 --- a/web/components/common/new-empty-state.tsx +++ b/web/components/common/new-empty-state.tsx @@ -20,7 +20,6 @@ type Props = { text: string; onClick: () => void; }; - secondaryButton?: React.ReactNode; disabled?: boolean; }; @@ -29,7 +28,6 @@ export const NewEmptyState: React.FC = ({ description, image, primaryButton, - secondaryButton, disabled = false, comicBox, }) => { @@ -48,7 +46,7 @@ export const NewEmptyState: React.FC = ({

{title}

{description &&

{description}

}
- {primaryButton?.text} + {primaryButton?.text
diff --git a/web/components/cycles/active-cycle-details.tsx b/web/components/cycles/active-cycle-details.tsx index 71a174f18..7c536f09a 100644 --- a/web/components/cycles/active-cycle-details.tsx +++ b/web/components/cycles/active-cycle-details.tsx @@ -317,9 +317,9 @@ export const ActiveCycleDetails: React.FC = observer((props
- + View Cycle - +
diff --git a/web/components/cycles/cycles-board-card.tsx b/web/components/cycles/cycles-board-card.tsx index da8641f66..8a74565d5 100644 --- a/web/components/cycles/cycles-board-card.tsx +++ b/web/components/cycles/cycles-board-card.tsx @@ -152,7 +152,7 @@ export const CyclesBoardCard: FC = (props) => { /> - +
@@ -268,7 +268,7 @@ export const CyclesBoardCard: FC = (props) => {
- +
); diff --git a/web/components/cycles/cycles-list-item.tsx b/web/components/cycles/cycles-list-item.tsx index 929e0a564..531a637aa 100644 --- a/web/components/cycles/cycles-list-item.tsx +++ b/web/components/cycles/cycles-list-item.tsx @@ -153,7 +153,7 @@ export const CyclesListItem: FC = (props) => { projectId={projectId} /> - +
@@ -262,7 +262,7 @@ export const CyclesListItem: FC = (props) => {
-
+ ); diff --git a/web/components/cycles/delete-modal.tsx b/web/components/cycles/delete-modal.tsx index 61667659f..f709c67a9 100644 --- a/web/components/cycles/delete-modal.tsx +++ b/web/components/cycles/delete-modal.tsx @@ -24,7 +24,10 @@ interface ICycleDelete { export const CycleDeleteModal: React.FC = observer((props) => { const { isOpen, handleClose, cycle, workspaceSlug, projectId } = props; // store - const { cycle: cycleStore, trackEvent: { postHogEventTracker } } = useMobxStore(); + const { + cycle: cycleStore, + trackEvent: { postHogEventTracker }, + } = useMobxStore(); // toast const { setToastAlert } = useToast(); // states @@ -36,26 +39,23 @@ export const CycleDeleteModal: React.FC = observer((props) => { setLoader(true); if (cycle?.id) try { - await cycleStore.removeCycle(workspaceSlug, projectId, cycle?.id).then((res) => { - setToastAlert({ - type: "success", - title: "Success!", - message: "Cycle deleted successfully.", + await cycleStore + .removeCycle(workspaceSlug, projectId, cycle?.id) + .then(() => { + setToastAlert({ + type: "success", + title: "Success!", + message: "Cycle deleted successfully.", + }); + postHogEventTracker("CYCLE_DELETE", { + state: "SUCCESS", + }); + }) + .catch(() => { + postHogEventTracker("CYCLE_DELETE", { + state: "FAILED", + }); }); - postHogEventTracker( - "CYCLE_DELETE", - { - state: "SUCCESS" - } - ); - }).catch((error) => { - postHogEventTracker( - "CYCLE_DELETE", - { - state: "FAILED" - } - ); - }); if (cycleId || peekCycle) router.push(`/${workspaceSlug}/projects/${projectId}/cycles`); diff --git a/web/components/exporter/guide.tsx b/web/components/exporter/guide.tsx index 2d7eb9d65..afa36ebd2 100644 --- a/web/components/exporter/guide.tsx +++ b/web/components/exporter/guide.tsx @@ -67,11 +67,11 @@ const IntegrationGuide = () => {
diff --git a/web/components/headers/global-issues.tsx b/web/components/headers/global-issues.tsx index 52a60540f..bb692b4f4 100644 --- a/web/components/headers/global-issues.tsx +++ b/web/components/headers/global-issues.tsx @@ -119,7 +119,7 @@ export const GlobalIssuesHeader: React.FC = observer((props) => {
{GLOBAL_VIEW_LAYOUTS.map((layout) => ( - +
= observer((props) => { />
-
+ ))}
diff --git a/web/components/headers/project-issues.tsx b/web/components/headers/project-issues.tsx index 65d13a58d..4f64dbb08 100644 --- a/web/components/headers/project-issues.tsx +++ b/web/components/headers/project-issues.tsx @@ -185,7 +185,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => { {projectId && inboxStore.isInboxEnabled && inboxDetails && ( - + - + )} - + diff --git a/web/components/instance/sidebar-dropdown.tsx b/web/components/instance/sidebar-dropdown.tsx index 383950ef3..c860b539e 100644 --- a/web/components/instance/sidebar-dropdown.tsx +++ b/web/components/instance/sidebar-dropdown.tsx @@ -78,9 +78,9 @@ export const InstanceSidebarDropdown = observer(() => {
- + - +
@@ -119,10 +119,10 @@ export const InstanceSidebarDropdown = observer(() => { {PROFILE_LINKS.map((link) => ( - + {link.name} - + ))} @@ -142,9 +142,9 @@ export const InstanceSidebarDropdown = observer(() => { diff --git a/web/components/instance/sidebar-menu.tsx b/web/components/instance/sidebar-menu.tsx index ad26480db..8feaa44c2 100644 --- a/web/components/instance/sidebar-menu.tsx +++ b/web/components/instance/sidebar-menu.tsx @@ -54,7 +54,7 @@ export const InstanceAdminSidebarMenu = () => { return ( - +
{ )}
-
+ ); })} diff --git a/web/components/integration/github/root.tsx b/web/components/integration/github/root.tsx index 705a41255..2816650b2 100644 --- a/web/components/integration/github/root.tsx +++ b/web/components/integration/github/root.tsx @@ -165,10 +165,10 @@ export const GithubImporterRoot: React.FC = () => {
-
+
Cancel import & go back
-
+
diff --git a/web/components/integration/guide.tsx b/web/components/integration/guide.tsx index e521ca8f5..afc3f8341 100644 --- a/web/components/integration/guide.tsx +++ b/web/components/integration/guide.tsx @@ -89,9 +89,9 @@ const IntegrationGuide = () => {
diff --git a/web/components/integration/jira/give-details.tsx b/web/components/integration/jira/give-details.tsx index 5575a10e1..2ada332fc 100644 --- a/web/components/integration/jira/give-details.tsx +++ b/web/components/integration/jira/give-details.tsx @@ -16,7 +16,11 @@ export const JiraGetImportDetail: React.FC = observer(() => { const router = useRouter(); const { workspaceSlug } = router.query; - const { project: projectStore, commandPalette: commandPaletteStore, trackEvent: { setTrackElement } } = useMobxStore(); + const { + project: projectStore, + commandPalette: commandPaletteStore, + trackEvent: { setTrackElement }, + } = useMobxStore(); const projects = workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined; const { @@ -31,10 +35,8 @@ export const JiraGetImportDetail: React.FC = observer(() => {

Jira Personal Access Token

Get to know your access token by navigating to{" "} - - - Atlassian Settings - + + Atlassian Settings

@@ -192,7 +194,7 @@ export const JiraGetImportDetail: React.FC = observer(() => { type="button" onClick={() => { setTrackElement("JIRA_IMPORT_DETAIL"); - commandPaletteStore.toggleCreateProjectModal(true) + commandPaletteStore.toggleCreateProjectModal(true); }} className="flex cursor-pointer select-none items-center space-x-2 truncate rounded px-1 py-1.5 text-custom-text-200" > diff --git a/web/components/integration/jira/root.tsx b/web/components/integration/jira/root.tsx index 3651a97d9..4cc37db6f 100644 --- a/web/components/integration/jira/root.tsx +++ b/web/components/integration/jira/root.tsx @@ -5,7 +5,7 @@ import { useRouter } from "next/router"; import { mutate } from "swr"; import { FormProvider, useForm } from "react-hook-form"; // icons -import { ArrowLeft, Check, List, Settings, Users2 } from "lucide-react"; +import { ArrowLeft, Check, List, Settings } from "lucide-react"; // services import { JiraImporterService } from "services/integrations"; // fetch keys @@ -100,12 +100,12 @@ export const JiraImporterRoot: React.FC = () => { return (
-
+
Cancel import & go back
-
+
diff --git a/web/components/issues/activity.tsx b/web/components/issues/activity.tsx index b49e11972..dff64ba41 100644 --- a/web/components/issues/activity.tsx +++ b/web/components/issues/activity.tsx @@ -105,11 +105,11 @@ export const IssueActivitySection: React.FC = ({ {activityItem.actor_detail.first_name} Bot ) : ( - + {activityItem.actor_detail.is_bot ? activityItem.actor_detail.first_name : activityItem.actor_detail.display_name} - + )}{" "} {message}{" "} diff --git a/web/components/issues/attachment/attachments.tsx b/web/components/issues/attachment/attachments.tsx index ae3b4534d..d2f592f2e 100644 --- a/web/components/issues/attachment/attachments.tsx +++ b/web/components/issues/attachment/attachments.tsx @@ -59,8 +59,8 @@ export const IssueAttachments = () => { key={file.id} className="flex h-[60px] items-center justify-between gap-1 rounded-md border-[2px] border-custom-border-200 bg-custom-background-100 px-4 py-2 text-sm" > - - + +
{getFileIcon(getFileExtension(file.asset))}
@@ -85,7 +85,7 @@ export const IssueAttachments = () => {
- +
- + ); diff --git a/web/components/modules/module-list-item.tsx b/web/components/modules/module-list-item.tsx index 9c4a16322..70c489b68 100644 --- a/web/components/modules/module-list-item.tsx +++ b/web/components/modules/module-list-item.tsx @@ -128,7 +128,7 @@ export const ModuleListItem: React.FC = observer((props) => { )} setDeleteModal(false)} /> - +
@@ -225,7 +225,7 @@ export const ModuleListItem: React.FC = observer((props) => {
-
+ ); diff --git a/web/components/modules/modules-list-view.tsx b/web/components/modules/modules-list-view.tsx index 612ed6a91..f5b2886d8 100644 --- a/web/components/modules/modules-list-view.tsx +++ b/web/components/modules/modules-list-view.tsx @@ -7,7 +7,6 @@ import { useMobxStore } from "lib/mobx/store-provider"; import useLocalStorage from "hooks/use-local-storage"; // components import { ModuleCardItem, ModuleListItem, ModulePeekOverview, ModulesListGanttChartView } from "components/modules"; -import { EmptyState } from "components/common"; // ui import { Loader } from "@plane/ui"; // assets diff --git a/web/components/onboarding/invitations.tsx b/web/components/onboarding/invitations.tsx index 5472595f5..8f650eefd 100644 --- a/web/components/onboarding/invitations.tsx +++ b/web/components/onboarding/invitations.tsx @@ -32,14 +32,12 @@ export const Invitations: React.FC = (props) => { const { workspace: workspaceStore, user: { currentUser, updateCurrentUser }, - trackEvent: { postHogEventTracker } + trackEvent: { postHogEventTracker }, } = useMobxStore(); - const { - data: invitations, - mutate: mutateInvitations, - isLoading, - } = useSWR(USER_WORKSPACE_INVITATIONS, () => workspaceService.userWorkspaceInvitations()); + const { data: invitations, mutate: mutateInvitations } = useSWR(USER_WORKSPACE_INVITATIONS, () => + workspaceService.userWorkspaceInvitations() + ); const handleInvitation = (workspace_invitation: IWorkspaceMemberInvitation, action: "accepted" | "withdraw") => { if (action === "accepted") { @@ -74,7 +72,8 @@ export const Invitations: React.FC = (props) => { .catch((error) => { console.log(error); postHogEventTracker("WORKSPACE_USER_INVITE_ACCEPT", { state: "FAILED" }); - }).finally(() => setIsJoiningWorkspaces(false)); + }) + .finally(() => setIsJoiningWorkspaces(false)); }; return invitations && invitations.length > 0 ? ( @@ -89,10 +88,11 @@ export const Invitations: React.FC = (props) => { return (
handleInvitation(invitation, isSelected ? "withdraw" : "accepted")} >
diff --git a/web/components/onboarding/join-workspaces.tsx b/web/components/onboarding/join-workspaces.tsx index cb2f3ee71..214f3b709 100644 --- a/web/components/onboarding/join-workspaces.tsx +++ b/web/components/onboarding/join-workspaces.tsx @@ -20,7 +20,7 @@ export const JoinWorkspaces: React.FC = ({ stepChange, setTryDiffAccount control, setValue, watch, - formState: { errors, isSubmitting, isValid }, + formState: { errors, isSubmitting }, } = useForm({ defaultValues: { name: "", diff --git a/web/components/page-views/workspace-dashboard.tsx b/web/components/page-views/workspace-dashboard.tsx index d0116469f..4593f1c75 100644 --- a/web/components/page-views/workspace-dashboard.tsx +++ b/web/components/page-views/workspace-dashboard.tsx @@ -1,5 +1,4 @@ import { useState } from "react"; -import Image from "next/image"; import { useRouter } from "next/router"; import useSWR from "swr"; import { observer } from "mobx-react-lite"; @@ -9,9 +8,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; import { TourRoot } from "components/onboarding"; import { UserGreetingsView } from "components/user"; import { CompletedIssuesGraph, IssuesList, IssuesPieChart, IssuesStats } from "components/workspace"; -import { Button } from "@plane/ui"; // images -import emptyDashboard from "public/empty-state/dashboard.svg"; import { NewEmptyState } from "components/common/new-empty-state"; import emptyProject from "public/empty-state/dashboard_empty_project.webp"; diff --git a/web/components/pages/pages-list/list-item.tsx b/web/components/pages/pages-list/list-item.tsx index c4f9f9f16..7fa2c75f8 100644 --- a/web/components/pages/pages-list/list-item.tsx +++ b/web/components/pages/pages-list/list-item.tsx @@ -157,7 +157,7 @@ export const PagesListItem: FC = observer((props) => { setDeletePageModal(false)} data={page} />
  • - +
    @@ -295,7 +295,7 @@ export const PagesListItem: FC = observer((props) => {
    -
    +
  • diff --git a/web/components/profile/navbar.tsx b/web/components/profile/navbar.tsx index 7a6128190..23eea6222 100644 --- a/web/components/profile/navbar.tsx +++ b/web/components/profile/navbar.tsx @@ -50,7 +50,7 @@ export const ProfileNavbar: React.FC = (props) => {
    {tabsList.map((tab) => ( - = (props) => { }`} > {tab.label} - + ))}
    diff --git a/web/components/profile/overview/stats.tsx b/web/components/profile/overview/stats.tsx index b109b508d..850d8b4e2 100644 --- a/web/components/profile/overview/stats.tsx +++ b/web/components/profile/overview/stats.tsx @@ -43,7 +43,7 @@ export const ProfileStats: React.FC = ({ userProfile }) => { - + ))}
    diff --git a/web/components/profile/sidebar.tsx b/web/components/profile/sidebar.tsx index c6d183011..14a863857 100644 --- a/web/components/profile/sidebar.tsx +++ b/web/components/profile/sidebar.tsx @@ -68,9 +68,9 @@ export const ProfileSidebar = () => { {user?.id === userId && (
    - + - +
    )} diff --git a/web/components/project/card-list.tsx b/web/components/project/card-list.tsx index 7bcc559c4..162b66610 100644 --- a/web/components/project/card-list.tsx +++ b/web/components/project/card-list.tsx @@ -4,12 +4,10 @@ import { observer } from "mobx-react-lite"; import { useMobxStore } from "lib/mobx/store-provider"; // components import { ProjectCard } from "components/project"; -import { EmptyState } from "components/project/empty-state"; import { Loader } from "@plane/ui"; // images import emptyProject from "public/empty-state/empty_project.webp"; // icons -import { Plus } from "lucide-react"; import { NewEmptyState } from "components/common/new-empty-state"; export interface IProjectCardList { diff --git a/web/components/project/empty-state.tsx b/web/components/project/empty-state.tsx index 2b6401892..60625f3dc 100644 --- a/web/components/project/empty-state.tsx +++ b/web/components/project/empty-state.tsx @@ -28,7 +28,7 @@ export const EmptyState: React.FC = ({ }) => (
    - {primaryButton?.text} + {primaryButton?.text
    {title}
    diff --git a/web/components/project/member-list-item.tsx b/web/components/project/member-list-item.tsx index df60c75ec..6c231779e 100644 --- a/web/components/project/member-list-item.tsx +++ b/web/components/project/member-list-item.tsx @@ -76,27 +76,27 @@ export const ProjectMemberListItem: React.FC = observer((props) => {
    {memberDetails.avatar && memberDetails.avatar !== "" ? ( - + {memberDetails.display_name - + ) : ( - + {(memberDetails.display_name ?? memberDetails.email ?? "?")[0]} - + )}
    - + {memberDetails.first_name} {memberDetails.last_name} - +

    {memberDetails.display_name}

    diff --git a/web/components/project/send-project-invitation-modal.tsx b/web/components/project/send-project-invitation-modal.tsx index 5e57e55ba..8ad55ebec 100644 --- a/web/components/project/send-project-invitation-modal.tsx +++ b/web/components/project/send-project-invitation-modal.tsx @@ -12,8 +12,6 @@ import { Avatar, Button, CustomSelect, CustomSearchSelect } from "@plane/ui"; import { ProjectMemberService } from "services/project"; // hooks import useToast from "hooks/use-toast"; -// helpers -import { trackEvent } from "helpers/event-tracker.helper"; // types import { IProjectMember, TUserProjectRole } from "types"; // constants @@ -58,7 +56,7 @@ export const SendProjectInvitationModal: React.FC = observer((props) => { const { user: { currentProjectRole }, workspaceMember: { workspaceMembers }, - trackEvent: { postHogEventTracker } + trackEvent: { postHogEventTracker }, } = useMobxStore(); const { @@ -94,22 +92,16 @@ export const SendProjectInvitationModal: React.FC = observer((props) => { type: "success", message: "Member added successfully", }); - postHogEventTracker( - 'PROJECT_MEMBER_INVITE', - { - ...res, - state: "SUCCESS" - } - ); + postHogEventTracker("PROJECT_MEMBER_INVITE", { + ...res, + state: "SUCCESS", + }); }) .catch((error) => { console.log(error); - postHogEventTracker( - 'PROJECT_MEMBER_INVITE', - { - state: "FAILED", - } - ); + postHogEventTracker("PROJECT_MEMBER_INVITE", { + state: "FAILED", + }); }) .finally(() => { reset(defaultValues); diff --git a/web/components/project/sidebar-list-item.tsx b/web/components/project/sidebar-list-item.tsx index 961ad49cf..488ae571a 100644 --- a/web/components/project/sidebar-list-item.tsx +++ b/web/components/project/sidebar-list-item.tsx @@ -75,7 +75,11 @@ export const ProjectSidebarListItem: React.FC = observer((props) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars const { project, provided, snapshot, handleCopyText, shortContextMenu = false } = props; // store - const { project: projectStore, theme: themeStore, trackEvent: { setTrackElement } } = useMobxStore(); + const { + project: projectStore, + theme: themeStore, + trackEvent: { setTrackElement }, + } = useMobxStore(); // router const router = useRouter(); const { workspaceSlug, projectId } = router.query; @@ -308,7 +312,7 @@ export const ProjectSidebarListItem: React.FC = observer((props) => { return ( - + = observer((props) => { {!isCollapsed && item.name}
    - + ); })} diff --git a/web/components/states/create-update-state-inline.tsx b/web/components/states/create-update-state-inline.tsx index dcaa0b5ba..50f624cbe 100644 --- a/web/components/states/create-update-state-inline.tsx +++ b/web/components/states/create-update-state-inline.tsx @@ -18,7 +18,6 @@ import type { IState } from "types"; import { STATES_LIST } from "constants/fetch-keys"; // constants import { GROUP_CHOICES } from "constants/project"; -import { stat } from "fs"; type Props = { data: IState | null; @@ -44,7 +43,10 @@ export const CreateUpdateStateInline: React.FC = observer((props) => { const { workspaceSlug, projectId } = router.query; // store - const { projectState: projectStateStore, trackEvent: { postHogEventTracker, setTrackElement } } = useMobxStore(); + const { + projectState: projectStateStore, + trackEvent: { postHogEventTracker, setTrackElement }, + } = useMobxStore(); // hooks const { setToastAlert } = useToast(); @@ -95,13 +97,10 @@ export const CreateUpdateStateInline: React.FC = observer((props) => { title: "Success!", message: "State created successfully.", }); - postHogEventTracker( - 'STATE_CREATE', - { - ...res, - state: "SUCCESS" - } - ); + postHogEventTracker("STATE_CREATE", { + ...res, + state: "SUCCESS", + }); }) .catch((error) => { if (error.status === 400) @@ -116,12 +115,9 @@ export const CreateUpdateStateInline: React.FC = observer((props) => { title: "Error!", message: "State could not be created. Please try again.", }); - postHogEventTracker( - 'STATE_CREATE', - { - state: "FAILED" - } - ); + postHogEventTracker("STATE_CREATE", { + state: "FAILED", + }); }); }; @@ -133,13 +129,10 @@ export const CreateUpdateStateInline: React.FC = observer((props) => { .then((res) => { mutate(STATES_LIST(projectId.toString())); handleClose(); - postHogEventTracker( - 'STATE_UPDATE', - { - ...res, - state: "SUCCESS", - } - ); + postHogEventTracker("STATE_UPDATE", { + ...res, + state: "SUCCESS", + }); setToastAlert({ type: "success", title: "Success!", @@ -159,12 +152,9 @@ export const CreateUpdateStateInline: React.FC = observer((props) => { title: "Error!", message: "State could not be updated. Please try again.", }); - postHogEventTracker( - 'STATE_UPDATE', - { - state: "FAILED", - } - ); + postHogEventTracker("STATE_UPDATE", { + state: "FAILED", + }); }); }; @@ -187,8 +177,9 @@ export const CreateUpdateStateInline: React.FC = observer((props) => { {({ open }) => ( <> {watch("color") && watch("color") !== "" && ( = observer((props) => { - diff --git a/web/components/states/delete-state-modal.tsx b/web/components/states/delete-state-modal.tsx index b8d58de73..057d0ee02 100644 --- a/web/components/states/delete-state-modal.tsx +++ b/web/components/states/delete-state-modal.tsx @@ -28,7 +28,10 @@ export const DeleteStateModal: React.FC = observer((props) => { const { workspaceSlug } = router.query; // store - const { projectState: projectStateStore, trackEvent: { postHogEventTracker } } = useMobxStore(); + const { + projectState: projectStateStore, + trackEvent: { postHogEventTracker }, + } = useMobxStore(); // states const [isDeleteLoading, setIsDeleteLoading] = useState(false); @@ -47,13 +50,10 @@ export const DeleteStateModal: React.FC = observer((props) => { await projectStateStore .deleteState(workspaceSlug.toString(), data.project, data.id) - .then((res) => { - postHogEventTracker( - 'STATE_DELETE', - { - state: "SUCCESS" - } - ); + .then(() => { + postHogEventTracker("STATE_DELETE", { + state: "SUCCESS", + }); handleClose(); }) .catch((err) => { @@ -70,12 +70,9 @@ export const DeleteStateModal: React.FC = observer((props) => { title: "Error!", message: "State could not be deleted. Please try again.", }); - postHogEventTracker( - 'STATE_DELETE', - { - state: "FAILED" - } - ) + postHogEventTracker("STATE_DELETE", { + state: "FAILED", + }); }) .finally(() => { setIsDeleteLoading(false); diff --git a/web/components/ui/circular-progress.tsx b/web/components/ui/circular-progress.tsx deleted file mode 100644 index af808ee8a..000000000 --- a/web/components/ui/circular-progress.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React, { useEffect, useState } from "react"; - -export const CircularProgress = ({ progress }: { progress: number }) => { - const [circumference, setCircumference] = useState(0); - - useEffect(() => { - const radius = 40; - const calcCircumference = 2 * Math.PI * radius; - setCircumference(calcCircumference); - }, []); - - const progressAngle = (progress / 100) * 360 >= 360 ? 359.9 : (progress / 100) * 360; - const progressX = 50 + Math.cos((progressAngle - 90) * (Math.PI / 180)) * 40; - const progressY = 50 + Math.sin((progressAngle - 90) * (Math.PI / 180)) * 40; - - return ( -
    - - - 50 ? 1 : 0} 1 ${progressX} ${progressY} - L50 50 Z`} - strokeWidth="12" - strokeLinecap="round" - /> - -
    - ); -}; diff --git a/web/components/ui/dropdowns/context-menu.tsx b/web/components/ui/dropdowns/context-menu.tsx deleted file mode 100644 index 7809c81cd..000000000 --- a/web/components/ui/dropdowns/context-menu.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import React, { useEffect, useRef } from "react"; - -import Link from "next/link"; - -// hooks -import useOutsideClickDetector from "hooks/use-outside-click-detector"; - -type Props = { - clickEvent: React.MouseEvent | null; - children: React.ReactNode; - title?: string | JSX.Element; - isOpen: boolean; - setIsOpen: React.Dispatch>; -}; - -const ContextMenu = ({ clickEvent, children, title, isOpen, setIsOpen }: Props) => { - const contextMenuRef = useRef(null); - - // Close the context menu when clicked outside - useOutsideClickDetector(contextMenuRef, () => { - if (isOpen) setIsOpen(false); - }); - - useEffect(() => { - const hideContextMenu = () => { - if (isOpen) setIsOpen(false); - }; - - const escapeKeyEvent = (e: KeyboardEvent) => { - if (e.key === "Escape") hideContextMenu(); - }; - - window.addEventListener("click", hideContextMenu); - window.addEventListener("keydown", escapeKeyEvent); - - return () => { - window.removeEventListener("click", hideContextMenu); - window.removeEventListener("keydown", escapeKeyEvent); - }; - }, [isOpen, setIsOpen]); - - useEffect(() => { - const contextMenu = contextMenuRef.current; - - if (contextMenu && isOpen) { - const contextMenuWidth = contextMenu.clientWidth; - const contextMenuHeight = contextMenu.clientHeight; - - const clickX = clickEvent?.pageX || 0; - const clickY = clickEvent?.pageY || 0; - - let top = clickY; - // check if there's enough space at the bottom, otherwise show at the top - if (clickY + contextMenuHeight > window.innerHeight) top = clickY - contextMenuHeight; - - // check if there's enough space on the right, otherwise show on the left - let left = clickX; - if (clickX + contextMenuWidth > window.innerWidth) left = clickX - contextMenuWidth; - - contextMenu.style.top = `${top}px`; - contextMenu.style.left = `${left}px`; - } - }, [clickEvent, isOpen]); - - return ( -
    -
    - {title && ( -

    {title}

    - )} - {children} -
    -
    - ); -}; - -type MenuItemProps = { - children: JSX.Element | string; - renderAs?: "button" | "a"; - href?: string; - onClick?: () => void; - className?: string; - Icon?: any; -}; - -const MenuItem: React.FC = ({ children, renderAs, href = "", onClick, className = "", Icon }) => ( - <> - {renderAs === "a" ? ( - - - <> - {Icon && } - {children} - - - - ) : ( - - )} - -); - -ContextMenu.Item = MenuItem; - -export { ContextMenu }; diff --git a/web/components/ui/dropdowns/custom-menu.tsx b/web/components/ui/dropdowns/custom-menu.tsx deleted file mode 100644 index 46c15ae64..000000000 --- a/web/components/ui/dropdowns/custom-menu.tsx +++ /dev/null @@ -1,162 +0,0 @@ -import React, { useState } from "react"; - -import Link from "next/link"; - -// react-poppper -import { usePopper } from "react-popper"; -// headless ui -import { Menu } from "@headlessui/react"; -// ui -import { DropdownProps } from "components/ui"; -// icons -import { ChevronDown, MoreHorizontal } from "lucide-react"; - -export type CustomMenuProps = DropdownProps & { - children: React.ReactNode; - ellipsis?: boolean; - noBorder?: boolean; - verticalEllipsis?: boolean; - menuButtonOnClick?: (...args: any) => void; -}; - -const CustomMenu = ({ - buttonClassName = "", - customButtonClassName = "", - placement, - children, - className = "", - customButton, - disabled = false, - ellipsis = false, - label, - maxHeight = "md", - noBorder = false, - noChevron = false, - optionsClassName = "", - verticalEllipsis = false, - width = "auto", - menuButtonOnClick, -}: CustomMenuProps) => { - const [referenceElement, setReferenceElement] = useState(null); - const [popperElement, setPopperElement] = useState(null); - - const { styles, attributes } = usePopper(referenceElement, popperElement, { - placement: placement ?? "bottom-start", - }); - return ( - - {({ open }) => ( - <> - {customButton ? ( - - - - ) : ( - <> - {ellipsis || verticalEllipsis ? ( - - - - ) : ( - - - - )} - - )} - -
    -
    {children}
    -
    -
    - - )} -
    - ); -}; - -type MenuItemProps = { - children: React.ReactNode; - renderAs?: "button" | "a"; - href?: string; - onClick?: (args?: any) => void; - className?: string; -}; - -const MenuItem: React.FC = ({ children, renderAs, href, onClick, className = "" }) => ( - - {({ active, close }) => - renderAs === "a" ? ( - - - {children} - - - ) : ( - - ) - } - -); - -CustomMenu.MenuItem = MenuItem; - -export { CustomMenu }; diff --git a/web/components/ui/dropdowns/custom-search-select.tsx b/web/components/ui/dropdowns/custom-search-select.tsx deleted file mode 100644 index 09db05d10..000000000 --- a/web/components/ui/dropdowns/custom-search-select.tsx +++ /dev/null @@ -1,188 +0,0 @@ -import React, { useState } from "react"; - -// react-popper -import { usePopper } from "react-popper"; -// headless ui -import { Combobox } from "@headlessui/react"; -// icons -import { Check, ChevronDown, Search } from "lucide-react"; -// types -import { DropdownProps } from "./types"; - -export type CustomSearchSelectProps = DropdownProps & { - footerOption?: JSX.Element; - onChange: any; - options: - | { - value: any; - query: string; - content: React.ReactNode; - }[] - | undefined; -} & ( - | { multiple?: false; value: any } // if multiple is false, value can be anything - | { - multiple?: true; - value: any[] | null; // if multiple is true, value should be an array - } - ); - -export const CustomSearchSelect = ({ - customButtonClassName = "", - buttonClassName = "", - className = "", - customButton, - placement, - disabled = false, - footerOption, - input = false, - label, - maxHeight = "md", - multiple = false, - noChevron = false, - onChange, - options, - onOpen, - optionsClassName = "", - value, - width = "auto", -}: CustomSearchSelectProps) => { - const [query, setQuery] = useState(""); - - const [referenceElement, setReferenceElement] = useState(null); - const [popperElement, setPopperElement] = useState(null); - - const { styles, attributes } = usePopper(referenceElement, popperElement, { - placement: placement ?? "bottom-start", - }); - - const filteredOptions = - query === "" ? options : options?.filter((option) => option.query.toLowerCase().includes(query.toLowerCase())); - - const props: any = { - value, - onChange, - disabled, - }; - - if (multiple) props.multiple = true; - - return ( - - {({ open }: { open: boolean }) => { - if (open && onOpen) onOpen(); - - return ( - <> - {customButton ? ( - - - - ) : ( - - - - )} - -
    -
    - - setQuery(e.target.value)} - placeholder="Type to search..." - displayValue={(assigned: any) => assigned?.name} - /> -
    -
    - {filteredOptions ? ( - filteredOptions.length > 0 ? ( - filteredOptions.map((option) => ( - - `flex items-center justify-between gap-2 cursor-pointer select-none truncate rounded px-1 py-1.5 ${ - active || selected ? "bg-custom-background-80" : "" - } ${selected ? "text-custom-text-100" : "text-custom-text-200"}` - } - > - {({ active, selected }) => ( - <> - {option.content} - {multiple ? ( -
    - -
    - ) : ( - - )} - - )} -
    - )) - ) : ( - -

    No matching results

    -
    - ) - ) : ( -

    Loading...

    - )} -
    - {footerOption} -
    -
    - - ); - }} -
    - ); -}; diff --git a/web/components/ui/dropdowns/custom-select.tsx b/web/components/ui/dropdowns/custom-select.tsx deleted file mode 100644 index 422356a95..000000000 --- a/web/components/ui/dropdowns/custom-select.tsx +++ /dev/null @@ -1,130 +0,0 @@ -import React, { useState } from "react"; - -// react-popper -import { usePopper } from "react-popper"; -// headless ui -import { Listbox } from "@headlessui/react"; -// icons -import { Check, ChevronDown } from "lucide-react"; -// types -import { DropdownProps } from "./types"; - -export type CustomSelectProps = DropdownProps & { - children: React.ReactNode; - value: any; - onChange: any; -}; - -const CustomSelect = ({ - customButtonClassName = "", - buttonClassName = "", - placement, - children, - className = "", - customButton, - disabled = false, - input = false, - label, - maxHeight = "md", - noChevron = false, - onChange, - optionsClassName = "", - value, - width = "auto", -}: CustomSelectProps) => { - const [referenceElement, setReferenceElement] = useState(null); - const [popperElement, setPopperElement] = useState(null); - - const { styles, attributes } = usePopper(referenceElement, popperElement, { - placement: placement ?? "bottom-start", - }); - - return ( - - <> - {customButton ? ( - - - - ) : ( - - - - )} - - -
    -
    {children}
    -
    -
    -
    - ); -}; - -type OptionProps = { - children: React.ReactNode; - value: any; - className?: string; -}; - -const Option: React.FC = ({ children, value, className }) => ( - - `cursor-pointer select-none truncate rounded px-1 py-1.5 ${active || selected ? "bg-custom-background-80" : ""} ${ - selected ? "text-custom-text-100" : "text-custom-text-200" - } ${className}` - } - > - {({ selected }) => ( -
    -
    {children}
    - {selected && } -
    - )} -
    -); - -CustomSelect.Option = Option; - -export { CustomSelect }; diff --git a/web/components/ui/dropdowns/index.ts b/web/components/ui/dropdowns/index.ts deleted file mode 100644 index 6b85a71a1..000000000 --- a/web/components/ui/dropdowns/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./context-menu"; -export * from "./custom-menu"; -export * from "./custom-search-select"; -export * from "./custom-select"; -export * from "./types.d"; diff --git a/web/components/ui/dropdowns/types.d.ts b/web/components/ui/dropdowns/types.d.ts deleted file mode 100644 index 4b153e6c1..000000000 --- a/web/components/ui/dropdowns/types.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Placement } from "@popperjs/core"; - -export type DropdownProps = { - customButtonClassName?: string; - buttonClassName?: string; - customButtonClassName?: string; - className?: string; - customButton?: JSX.Element; - disabled?: boolean; - input?: boolean; - label?: string | JSX.Element; - maxHeight?: "sm" | "rg" | "md" | "lg"; - noChevron?: boolean; - onOpen?: () => void; - optionsClassName?: string; - width?: "auto" | string; - placement?: Placement; -}; diff --git a/web/components/ui/empty-space.tsx b/web/components/ui/empty-space.tsx index 0806db5e5..cfdc181e9 100644 --- a/web/components/ui/empty-space.tsx +++ b/web/components/ui/empty-space.tsx @@ -30,10 +30,10 @@ const EmptySpace: React.FC = ({ title, description, children, I {link ? ( ) : null} diff --git a/web/components/ui/icon.tsx b/web/components/ui/icon.tsx deleted file mode 100644 index 418186291..000000000 --- a/web/components/ui/icon.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; - -type Props = { - iconName: string; - className?: string; -}; - -export const Icon: React.FC = ({ iconName, className = "" }) => ( - {iconName} -); diff --git a/web/components/ui/index.ts b/web/components/ui/index.ts index e92fbf6f8..27d00b376 100644 --- a/web/components/ui/index.ts +++ b/web/components/ui/index.ts @@ -1,23 +1,12 @@ -export * from "./dropdowns"; export * from "./graphs"; -export * from "./input"; -export * from "./text-area"; export * from "./date"; export * from "./datepicker"; export * from "./empty-space"; -export * from "./icon"; export * from "./labels-list"; -export * from "./linear-progress-indicator"; -export * from "./loader"; export * from "./multi-level-dropdown"; export * from "./multi-level-select"; -export * from "./progress-bar"; -export * from "./spinner"; -export * from "./tooltip"; -export * from "./toggle-switch"; export * from "./markdown-to-component"; export * from "./product-updates-modal"; export * from "./integration-and-import-export-banner"; export * from "./range-datepicker"; -export * from "./circular-progress"; export * from "./profile-empty-state"; diff --git a/web/components/ui/input/index.tsx b/web/components/ui/input/index.tsx deleted file mode 100644 index 867712a29..000000000 --- a/web/components/ui/input/index.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import * as React from "react"; - -// types -import { Props } from "./types"; - -export const Input: React.FC = ({ - label, - value, - name, - register, - validations, - error, - mode = "primary", - onChange, - className = "", - type, - id, - size = "rg", - fullWidth = true, - ...rest -}) => ( - <> - {label && ( - - )} - { - register && register(name ?? "").onChange(e); - onChange && onChange(e); - }} - className={`block rounded-md bg-transparent text-sm focus:outline-none placeholder-custom-text-400 ${ - mode === "primary" - ? "rounded-md border border-custom-border-200" - : mode === "transparent" - ? "rounded border-none bg-transparent ring-0 transition-all focus:ring-1 focus:ring-custom-primary" - : mode === "trueTransparent" - ? "rounded border-none bg-transparent ring-0" - : "" - } ${error ? "border-red-500" : ""} ${error && mode === "primary" ? "bg-red-500/20" : ""} ${ - fullWidth ? "w-full" : "" - } ${size === "rg" ? "px-3 py-2" : size === "lg" ? "p-3" : ""} ${className}`} - {...rest} - /> - {error?.message &&
    {error.message}
    } - -); diff --git a/web/components/ui/input/types.d.ts b/web/components/ui/input/types.d.ts deleted file mode 100644 index 77a48b4b9..000000000 --- a/web/components/ui/input/types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as React from "react"; -import type { UseFormRegister, RegisterOptions } from "react-hook-form"; - -export interface Props extends React.ComponentPropsWithoutRef<"input"> { - label?: string; - name?: string; - value?: string | number | readonly string[]; - mode?: "primary" | "transparent" | "trueTransparent" | "secondary" | "disabled"; - register?: UseFormRegister; - validations?: RegisterOptions; - error?: any; - className?: string; - size?: "rg" | "lg"; - fullWidth?: boolean; -} diff --git a/web/components/ui/linear-progress-indicator.tsx b/web/components/ui/linear-progress-indicator.tsx deleted file mode 100644 index ac61f255f..000000000 --- a/web/components/ui/linear-progress-indicator.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from "react"; -import { Tooltip } from "@plane/ui"; - -type Props = { - data: any; - noTooltip?: boolean; -}; - -export const LinearProgressIndicator: React.FC = ({ data, noTooltip = false }) => { - const total = data.reduce((acc: any, cur: any) => acc + cur.value, 0); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let progress = 0; - - const bars = data.map((item: any) => { - const width = `${(item.value / total) * 100}%`; - const style = { - width, - backgroundColor: item.color, - }; - progress += item.value; - if (noTooltip) return
    ; - else - return ( - -
    - - ); - }); - - return ( -
    - {total === 0 ? ( -
    {bars}
    - ) : ( -
    {bars}
    - )} -
    - ); -}; diff --git a/web/components/ui/loader.tsx b/web/components/ui/loader.tsx deleted file mode 100644 index b9d13883a..000000000 --- a/web/components/ui/loader.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; - -type Props = { - children: React.ReactNode; - className?: string; -}; - -const Loader = ({ children, className = "" }: Props) => ( -
    - {children} -
    -); - -type ItemProps = { - height?: string; - width?: string; -}; - -const Item: React.FC = ({ height = "auto", width = "auto" }) => ( -
    -); - -Loader.Item = Item; - -export { Loader }; diff --git a/web/components/ui/progress-bar.tsx b/web/components/ui/progress-bar.tsx deleted file mode 100644 index b92b568ac..000000000 --- a/web/components/ui/progress-bar.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React from "react"; - -type Props = { - maxValue?: number; - value?: number; - radius?: number; - strokeWidth?: number; - activeStrokeColor?: string; - inactiveStrokeColor?: string; -}; - -export const ProgressBar: React.FC = ({ - maxValue = 0, - value = 0, - radius = 8, - strokeWidth = 2, - activeStrokeColor = "#3e98c7", - inactiveStrokeColor = "#ddd", -}) => { - // PIE Calc Fn - const generatePie = (value: any) => { - const x = radius - Math.cos((2 * Math.PI) / (100 / value)) * radius; - const y = radius + Math.sin((2 * Math.PI) / (100 / value)) * radius; - const long = value <= 50 ? 0 : 1; - const d = `M${radius} ${radius} L${radius} ${0} A${radius} ${radius} 0 ${long} 1 ${y} ${x} Z`; - - return d; - }; - - // ---- PIE Area Calc -------- - const calculatePieValue = (numberOfBars: any) => { - const angle = 360 / numberOfBars; - const pieValue = Math.floor(angle / 4); - return pieValue < 1 ? 1 : Math.floor(angle / 4); - }; - - // ---- PIE Render Fn -------- - const renderPie = (i: any) => { - const DIRECTION = -1; - // Rotation Calc - const primaryRotationAngle = (maxValue - 1) * (360 / maxValue); - const rotationAngle = -1 * DIRECTION * primaryRotationAngle + i * DIRECTION * primaryRotationAngle; - const rotationTransformation = `rotate(${rotationAngle}, ${radius}, ${radius})`; - const pieValue = calculatePieValue(maxValue); - const dValue = generatePie(pieValue); - const fillColor = value > 0 && i <= value ? activeStrokeColor : inactiveStrokeColor; - - return ( - - ); - }; - - // combining the Pies - const renderOuterCircle = () => [...Array(maxValue + 1)].map((e, i) => renderPie(i)); - - return ( - - {renderOuterCircle()} - - - ); -}; diff --git a/web/components/ui/spinner.tsx b/web/components/ui/spinner.tsx deleted file mode 100644 index b96188030..000000000 --- a/web/components/ui/spinner.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from "react"; - -export const Spinner: React.FC = () => ( -
    - - Loading... -
    -); diff --git a/web/components/ui/text-area/index.tsx b/web/components/ui/text-area/index.tsx deleted file mode 100644 index bd6f749d3..000000000 --- a/web/components/ui/text-area/index.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { useState, useRef, useEffect } from "react"; - -// types -import { Props } from "./types"; - -// Updates the height of a