Skip to content

Commit

Permalink
chore: optimizations and file name changes (makeplane#2845)
Browse files Browse the repository at this point in the history
* fix: deepsource antipatterns

* fix: deepsource exclude file patterns

* chore: file name changes and removed unwanted variables

* fix: changing version number for editor
  • Loading branch information
sriramveeraghanta committed Dec 7, 2023
1 parent d6abb87 commit fa8ae6b
Show file tree
Hide file tree
Showing 47 changed files with 379 additions and 347 deletions.
6 changes: 6 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
version = 1

exclude_patterns = [
"bin/**",
"**/node_modules/",
"**/*.min.js"
]

[[analyzers]]
name = "shell"

Expand Down
2 changes: 1 addition & 1 deletion packages/editor/document-editor/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const HeadingComp = ({
<h3
onClick={onClick}
className="ml-4 mt-3 cursor-pointer text-sm font-bold font-medium leading-[125%] tracking-tight hover:text-custom-primary max-md:ml-2.5"
role="button"
>
{heading}
</h3>
Expand All @@ -23,6 +24,7 @@ export const SubheadingComp = ({
<p
onClick={onClick}
className="ml-6 mt-2 text-xs cursor-pointer font-medium tracking-tight text-gray-400 hover:text-custom-primary"
role="button"
>
{subHeading}
</p>
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/document-editor/src/ui/readonly/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const DocumentReadOnlyEditor = ({
<EditorHeader
isLocked={!pageLockConfig ? false : pageLockConfig.is_locked}
isArchived={!pageArchiveConfig ? false : pageArchiveConfig.is_archived}
readonly={true}
readonly
editor={editor}
sidePeekVisible={sidePeekVisible}
setSidePeekVisible={setSidePeekVisible}
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/lite-text-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plane/lite-text-editor",
"version": "0.0.1",
"version": "0.1.0",
"description": "Package that powers Plane's Comment Editor",
"private": true,
"main": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/rich-text-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plane/rich-text-editor",
"version": "0.0.1",
"version": "0.1.0",
"description": "Rich Text Editor that powers Plane",
"private": true,
"main": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@plane/ui",
"description": "UI components shared across multiple apps internally",
"private": true,
"version": "0.0.1",
"version": "0.1.0",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
Expand Down
6 changes: 5 additions & 1 deletion space/components/issues/board-views/kanban/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export const IssueListBlock = observer(({ issue }: { issue: IIssue }) => {
</div>

{/* name */}
<h6 onClick={handleBlockClick} className="text-sm font-medium break-words line-clamp-2 cursor-pointer">
<h6
onClick={handleBlockClick}
role="button"
className="text-sm font-medium break-words line-clamp-2 cursor-pointer"
>
{issue.name}
</h6>

Expand Down
55 changes: 0 additions & 55 deletions web/components/api-token/ApiTokenForm/ApiTokenDescription.tsx

This file was deleted.

110 changes: 0 additions & 110 deletions web/components/api-token/ApiTokenForm/ApiTokenExpiry.tsx

This file was deleted.

69 changes: 0 additions & 69 deletions web/components/api-token/ApiTokenForm/ApiTokenTitle.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions web/components/api-token/ApiTokenForm/types.ts

This file was deleted.

13 changes: 8 additions & 5 deletions web/components/api-token/delete-token-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Button } from "@plane/ui";
//hooks
import useToast from "hooks/use-toast";
//services
import { ApiTokenService } from "services/api_token.service";
import { APITokenService } from "services/api_token.service";
//headless ui
import { Dialog, Transition } from "@headlessui/react";

Expand All @@ -17,10 +17,15 @@ type Props = {
tokenId?: string;
};

const apiTokenService = new ApiTokenService();
const DeleteTokenModal: FC<Props> = ({ isOpen, handleClose, tokenId }) => {
const apiTokenService = new APITokenService();

export const DeleteTokenModal: FC<Props> = (props) => {
const { isOpen, handleClose, tokenId } = props;
// states
const [deleteLoading, setDeleteLoading] = useState<boolean>(false);
// hooks
const { setToastAlert } = useToast();
// router
const router = useRouter();
const { workspaceSlug, tokenId: tokenIdFromQuery } = router.query;

Expand Down Expand Up @@ -107,5 +112,3 @@ const DeleteTokenModal: FC<Props> = ({ isOpen, handleClose, tokenId }) => {
</Transition.Root>
);
};

export default DeleteTokenModal;
9 changes: 5 additions & 4 deletions web/components/api-token/empty-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import { Button } from "@plane/ui";
// assets
import emptyApiTokens from "public/empty-state/api-token.svg";

const ApiTokenEmptyState = () => {
export const APITokenEmptyState = () => {
const router = useRouter();

return (
<div className={`flex items-center justify-center mx-auto rounded-sm border border-custom-border-200 bg-custom-background-90 py-10 px-16 w-full`}>
<div
className={`flex items-center justify-center mx-auto rounded-sm border border-custom-border-200 bg-custom-background-90 py-10 px-16 w-full`}
>
<div className="text-center flex flex-col items-center w-full">
<Image src={emptyApiTokens} className="w-52 sm:w-60" alt="empty" />
<h6 className="text-xl font-semibold mt-6 sm:mt-8 mb-3">No API Tokens</h6>
Expand All @@ -32,5 +35,3 @@ const ApiTokenEmptyState = () => {
</div>
);
};

export default ApiTokenEmptyState;
Loading

0 comments on commit fa8ae6b

Please sign in to comment.