Skip to content

Commit

Permalink
Proper state/error management for file ingestion (#639)
Browse files Browse the repository at this point in the history
* Separate Upload components for maintainablity; fixed tabs height

* Implemented loading state for file uploading

* Implemented UploadFiles state management

* Added component state

* Normalized asset locations

* Disabled controls while busy

* Recovered folder uploading

* Merged local files button

* Recovered remote file

* Rebased on progress

* Removed unused create actions

* Fixed loading message

* Return file size from the server

* Added large file size message

* Removed unused dialog

* Removed unused AdjustFile dialog

* Removed unused IndexFiles dialog

* Removed unused file actions

* Validating -> Checking Errors

* Fixed merging
  • Loading branch information
roll authored Nov 18, 2024
1 parent aa38f04 commit 021fc2e
Show file tree
Hide file tree
Showing 31 changed files with 539 additions and 824 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Client {
folder?: string
deduplicate?: boolean
}) {
return await this.request<{ path: string }>('/file/create', props)
return await this.request<{ path: string; size: number }>('/file/create', props)
}

async fileDelete(props: { path: string }) {
Expand All @@ -70,7 +70,7 @@ export class Client {
folder?: string
deduplicate?: boolean
}) {
return await this.request<{ path: string }>('/file/fetch', props)
return await this.request<{ path: string; size: number }>('/file/fetch', props)
}

async fileIndex(props: { path: string }) {
Expand Down
16 changes: 8 additions & 8 deletions client/components/Application/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as React from 'react'
import * as store from '@client/store'
import { ClickAwayListener } from '@mui/base'
import Box from '@mui/material/Box'
import Button from '@mui/material/Button'
import Card from '@mui/material/Card'
import CardContent from '@mui/material/CardContent'
import Typography from '@mui/material/Typography'
import { styled } from '@mui/material/styles'
import * as React from 'react'
import { ErrorBoundary } from 'react-error-boundary'
import emptyContentScreenImg from '../../assets/empty_screen.png'
import File from '../Controllers/File'
import Table from '../Controllers/Table'
import Text from '../Controllers/Text'
import SpinnerCard from '../Parts/Cards/Spinner'
import * as store from '@client/store'
import { styled } from '@mui/material/styles'
import Typography from '@mui/material/Typography'
import CardContent from '@mui/material/CardContent'
import Card from '@mui/material/Card'
import Button from '@mui/material/Button'
import emptyContentScreenImg from '../../assets/empty_screen.png'

export default function Content() {
const record = store.useStore((state) => state.record)
Expand Down
14 changes: 4 additions & 10 deletions client/components/Application/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import * as store from '@client/store'
import AddEmptyFolderDialog from './Dialogs/AddEmptyFolder'
import AdjustFileDialog from './Dialogs/AdjustFile'
import CloseWithUnsavedChangesDialog from './Dialogs/CloseWithUnsavedChanges'
import ConfigDialog from './Dialogs/Config'
import CopyFileDialog from './Dialogs/CopyFile'
import CopyFolderDialog from './Dialogs/CopyFolder'
import CreateDialog from './Dialogs/Create'
import DeleteFilesFoldersDialog from './Dialogs/DeleteFilesFolders'
import IndexFilesDialog from './Dialogs/IndexFiles'
import { FileUploadDialog } from './Dialogs/FileUpload'
import OpenLocationDialog from './Dialogs/OpenLocation'
import PublishDialog from './Dialogs/Publish'
import RenameFileDialog from './Dialogs/RenameFile'
import UnsavedChangesDialog from './Dialogs/UnsavedChanges'
import WelcomeBannerDialog from './Dialogs/WelcomeBanner'
import FileUploadDialog from './Dialogs/FileUpload'
import OpenLocationDialog from './Dialogs/OpenLocation'
import RenameFileDialog from './Dialogs/RenameFile'
import * as store from '@client/store'

export default function Dialog() {
const dialog = store.useStore((state) => state.dialog)
Expand All @@ -28,15 +25,12 @@ export default function Dialog() {

const DIALOGS = {
addEmptyFolder: AddEmptyFolderDialog,
adjustFile: AdjustFileDialog,
closeWithUnsavedChanges: CloseWithUnsavedChangesDialog,
config: ConfigDialog,
configProject: ConfigDialog,
copyFile: CopyFileDialog,
copyFolder: CopyFolderDialog,
create: CreateDialog,
deleteFilesFolders: DeleteFilesFoldersDialog,
indexFiles: IndexFilesDialog,
publish: PublishDialog,
unsavedChanges: UnsavedChangesDialog,
welcomeBanner: WelcomeBannerDialog,
Expand Down
44 changes: 0 additions & 44 deletions client/components/Application/Dialogs/AdjustFile.tsx

This file was deleted.

144 changes: 0 additions & 144 deletions client/components/Application/Dialogs/Create.tsx

This file was deleted.

Loading

0 comments on commit 021fc2e

Please sign in to comment.