Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Sep 7, 2024
1 parent 62ca09a commit 54f1b08
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 26 deletions.
11 changes: 0 additions & 11 deletions ui2/src/features/nodes/apiSlice.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
import {apiSlice} from "@/features/api/slice"
import type {Paginated, FolderType, NodeType} from "@/types"
import {
uploaderFileItemAdded,
uploaderFileItemFailed,
UpdateFileStatusArg
} from "@/features/ui/uiSlice"

type CreateFolderType = {
title: string
parent_id: string
ctype: "folder"
}

type CreateDocumentNodesType = {
source_files: File[]
target: FolderType
ocr: boolean
}

type RenameFolderType = {
title: string
id: string
Expand Down
7 changes: 4 additions & 3 deletions ui2/src/features/nodes/components/Commander.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ import {useDisclosure} from "@mantine/hooks"
import {useAppSelector, useAppDispatch} from "@/app/hooks"
import {useNavigate} from "react-router-dom"

import FolderNodeActions from "@/features/nodes/components/FolderNodeActions"
import Node from "@/features/nodes/components/Node"
import {
setCurrentNode,
selectLastPageSize,
selectCurrentFolderID,
fetchPaginatedDocument,
selectFilterText
} from "@/slices/dualPanel/dualPanel"
import {DropFilesModal} from "@/features/nodes/components/DropFiles"

import type {NType, NodeType, PanelMode} from "@/types"
import Breadcrumbs from "@/components/Breadcrumbs"
Expand All @@ -27,6 +24,10 @@ import {
useGetPaginatedNodesQuery
} from "@/features/nodes/apiSlice"

import Node from "./Node"
import {DropFilesModal} from "./DropFiles"
import FolderNodeActions from "./FolderNodeActions"

export default function Commander() {
const [opened, {open, close}] = useDisclosure(false)
const [dragOver, setDragOver] = useState<boolean>(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
selectSelectedNodeIds,
clearNodesSelection
} from "@/slices/dualPanel/dualPanel"
import {EditNodeTagsModal} from "@/components/modals/EditNodeTags"
import {EditNodeTagsModal} from "@/features/nodes/components/EditNodeTags"

import type {RootState} from "@/app/types"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
selectSelectedNodeIds,
clearNodesSelection
} from "@/slices/dualPanel/dualPanel"
import {EditNodeTitleModal} from "@/components/modals/EditNodeTitle"
import {EditNodeTitleModal} from "@/features/nodes/components/EditNodeTitle"

import type {RootState} from "@/app/types"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import {updateActionPanel} from "@/features/ui/uiSlice"
import type {RootState} from "@/app/types"
import type {PanelMode} from "@/types"
import ToggleSecondaryPanel from "@/components/DualPanel/ToggleSecondaryPanel"
import DeleteButton from "@/features/nodes/components/DeleteButton"
import NewFolderButton from "@/features/nodes/components/NewFolderButton"
import UploadButton from "@/features/nodes/components/UploadButton"

import PanelContext from "@/contexts/PanelContext"
import EditNodeTagsButton from "@/components/SinglePanel/EditNodeTagsButton"
import EditNodeTitleButton from "@/components/SinglePanel/EditNodeTitleButton"
import QuickFilter from "@/features/nodes/components/QuickFilter"

import QuickFilter from "./QuickFilter"
import DeleteButton from "./DeleteButton"
import NewFolderButton from "./NewFolderButton"
import UploadButton from "./UploadButton"
import EditNodeTagsButton from "./EditNodeTagsButton"
import EditNodeTitleButton from "./EditNodeTitleButton"

export default function FolderNodeActions() {
const {height, width} = useViewportSize()
Expand Down
3 changes: 0 additions & 3 deletions ui2/src/features/nodes/components/FolderNodeActions/index.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion ui2/src/features/nodes/components/UploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {PanelMode} from "@/types"
import {selectCurrentFolderID} from "@/slices/dualPanel/dualPanel"
import {useGetFolderQuery} from "../apiSlice"

import {DropFilesModal} from "@/features/nodes/components/DropFiles"
import {DropFilesModal} from "./DropFiles"

const MIME_TYPES = [
"image/png",
Expand Down

0 comments on commit 54f1b08

Please sign in to comment.