From 2481706581940ca11d06dcf590adea759b1ac412 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Thu, 23 Nov 2023 15:09:46 +0530 Subject: [PATCH 1/9] chore: optimizations and file name changes (#2845) * fix: deepsource antipatterns * fix: deepsource exclude file patterns * chore: file name changes and removed unwanted variables * fix: changing version number for editor --- .deepsource.toml | 6 + packages/editor/document-editor/package.json | 2 +- .../src/ui/components/heading-component.tsx | 2 + .../document-editor/src/ui/readonly/index.tsx | 2 +- packages/editor/lite-text-editor/package.json | 2 +- packages/editor/rich-text-editor/package.json | 2 +- packages/ui/package.json | 2 +- .../issues/board-views/kanban/block.tsx | 6 +- .../ApiTokenForm/ApiTokenDescription.tsx | 55 --------- .../api-token/ApiTokenForm/ApiTokenExpiry.tsx | 110 ----------------- .../api-token/ApiTokenForm/ApiTokenTitle.tsx | 69 ----------- .../api-token/ApiTokenForm/types.ts | 5 - .../api-token/delete-token-modal.tsx | 13 +- web/components/api-token/empty-state.tsx | 9 +- .../{ApiTokenForm => form}/index.tsx | 65 ++++++---- .../api-token/form/token-description.tsx | 56 +++++++++ .../api-token/form/token-expiry.tsx | 111 ++++++++++++++++++ .../token-key-section.tsx} | 16 ++- web/components/api-token/form/token-title.tsx | 69 +++++++++++ web/components/api-token/index.ts | 4 + ...iTokenListItem.tsx => token-list-item.tsx} | 2 +- web/components/issues/description-form.tsx | 2 +- .../issue-peek-overview/issue-detail.tsx | 2 +- .../issues/issue-peek-overview/view.tsx | 2 +- .../issues/sub-issues/properties.tsx | 4 +- .../labels/project-setting-label-group.tsx | 2 +- .../labels/project-setting-label-item.tsx | 2 +- .../labels/project-setting-label-list.tsx | 2 +- web/components/onboarding/invite-members.tsx | 2 +- web/components/onboarding/tour/sidebar.tsx | 1 + web/components/onboarding/user-details.tsx | 14 +-- web/components/onboarding/workspace.tsx | 5 +- web/components/project/empty-state.tsx | 2 +- web/components/project/member-list.tsx | 2 +- web/components/project/sidebar-list-item.tsx | 2 +- web/components/ui/empty-space.tsx | 2 +- .../web-hooks/delete-webhook-modal.tsx | 10 +- web/components/web-hooks/form/index.tsx | 1 + .../workspace/settings/workspace-details.tsx | 12 +- .../projects/[projectId]/pages/[pageId].tsx | 2 +- .../settings/api-tokens/[tokenId].tsx | 13 +- .../settings/api-tokens/create.tsx | 8 +- .../settings/api-tokens/index.tsx | 17 ++- .../[workspaceSlug]/settings/members.tsx | 2 +- web/pages/me/profile/index.tsx | 1 + web/services/api_token.service.ts | 2 +- web/store/page.store.ts | 8 +- 47 files changed, 381 insertions(+), 349 deletions(-) delete mode 100644 web/components/api-token/ApiTokenForm/ApiTokenDescription.tsx delete mode 100644 web/components/api-token/ApiTokenForm/ApiTokenExpiry.tsx delete mode 100644 web/components/api-token/ApiTokenForm/ApiTokenTitle.tsx delete mode 100644 web/components/api-token/ApiTokenForm/types.ts rename web/components/api-token/{ApiTokenForm => form}/index.tsx (74%) create mode 100644 web/components/api-token/form/token-description.tsx create mode 100644 web/components/api-token/form/token-expiry.tsx rename web/components/api-token/{ApiTokenForm/ApiTokenKeySection.tsx => form/token-key-section.tsx} (86%) create mode 100644 web/components/api-token/form/token-title.tsx create mode 100644 web/components/api-token/index.ts rename web/components/api-token/{ApiTokenListItem.tsx => token-list-item.tsx} (96%) diff --git a/.deepsource.toml b/.deepsource.toml index 85de1a5e8..2b40af672 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -1,5 +1,11 @@ version = 1 +exclude_patterns = [ + "bin/**", + "**/node_modules/", + "**/*.min.js" +] + [[analyzers]] name = "shell" diff --git a/packages/editor/document-editor/package.json b/packages/editor/document-editor/package.json index 5f82a35f7..0016d5261 100644 --- a/packages/editor/document-editor/package.json +++ b/packages/editor/document-editor/package.json @@ -1,6 +1,6 @@ { "name": "@plane/document-editor", - "version": "0.0.1", + "version": "0.1.0", "description": "Package that powers Plane's Pages Editor", "main": "./dist/index.mjs", "module": "./dist/index.mjs", diff --git a/packages/editor/document-editor/src/ui/components/heading-component.tsx b/packages/editor/document-editor/src/ui/components/heading-component.tsx index 629d3b427..2a71beebf 100644 --- a/packages/editor/document-editor/src/ui/components/heading-component.tsx +++ b/packages/editor/document-editor/src/ui/components/heading-component.tsx @@ -8,6 +8,7 @@ export const HeadingComp = ({

{heading}

@@ -23,6 +24,7 @@ export const SubheadingComp = ({

{subHeading}

diff --git a/packages/editor/document-editor/src/ui/readonly/index.tsx b/packages/editor/document-editor/src/ui/readonly/index.tsx index 608179bf4..188d62427 100644 --- a/packages/editor/document-editor/src/ui/readonly/index.tsx +++ b/packages/editor/document-editor/src/ui/readonly/index.tsx @@ -82,7 +82,7 @@ const DocumentReadOnlyEditor = ({ { {/* name */} -
+
{issue.name}
diff --git a/web/components/api-token/ApiTokenForm/ApiTokenDescription.tsx b/web/components/api-token/ApiTokenForm/ApiTokenDescription.tsx deleted file mode 100644 index d17e4662e..000000000 --- a/web/components/api-token/ApiTokenForm/ApiTokenDescription.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { TextArea } from "@plane/ui"; -import { Control, Controller, FieldErrors } from "react-hook-form"; -import { IApiToken } from "types/api_token"; -import { IApiFormFields } from "./types"; -import { Dispatch, SetStateAction } from "react"; - -interface IApiTokenDescription { - generatedToken: IApiToken | null | undefined; - control: Control; - focusDescription: boolean; - setFocusTitle: Dispatch>; - setFocusDescription: Dispatch>; -} - -export const ApiTokenDescription = ({ - generatedToken, - control, - focusDescription, - setFocusTitle, - setFocusDescription, -}: IApiTokenDescription) => ( - - focusDescription ? ( -