diff --git a/README.md b/README.md index 768dfb3..64905a8 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ type File = { | `fileUploadConfig` | { url: string; headers?: { [key: string]: string } } | Configuration object for file uploads. It includes the upload URL (`url`) and an optional `headers` object for setting custom HTTP headers in the upload request. The `headers` object can accept any standard or custom headers required by the server. Example: `{ url: "https://example.com/fileupload", headers: { Authorization: "Bearer" + TOKEN, "X-Custom-Header": "value" } }` | | `files` | Array<[File](#-file-structure)> | An array of file and folder objects representing the current directory structure. Each object includes `name`, `isDirectory`, and `path` properties. | | `height` | string \| number | The height of the component `default: 600px`. Can be a string (e.g., `'100%'`, `'10rem'`) or a number (in pixels). | -| `initialPath` | string | The path of the directory to be loaded initially.This path should be a path of a folder which is included in `files` array. | +| `initialPath` | string | The path of the directory to be loaded initially e.g. `/Documents`. This should be the path of a folder which is included in `files` array. Default value is `""` | | `isLoading` | boolean | A boolean state indicating whether the application is currently performing an operation, such as creating, renaming, or deleting a file/folder. Displays a loading state if set `true`. | | `layout` | "list" \| "grid" | Specifies the default layout style for the file manager. Can be either "list" or "grid". Default value is "grid". | | `maxFileSize` | number | For limiting the maximum upload file size in bytes. | diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 0000000..2ffab02 --- /dev/null +++ b/frontend/.env.example @@ -0,0 +1,2 @@ +VITE_API_BASE_URL=http://localhost:3000/api/file-system +VITE_API_FILES_BASE_URL=http://localhost:3000 \ No newline at end of file diff --git a/frontend/README.md b/frontend/README.md index 9b2aaa5..64905a8 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -96,6 +96,7 @@ type File = { | `fileUploadConfig` | { url: string; headers?: { [key: string]: string } } | Configuration object for file uploads. It includes the upload URL (`url`) and an optional `headers` object for setting custom HTTP headers in the upload request. The `headers` object can accept any standard or custom headers required by the server. Example: `{ url: "https://example.com/fileupload", headers: { Authorization: "Bearer" + TOKEN, "X-Custom-Header": "value" } }` | | `files` | Array<[File](#-file-structure)> | An array of file and folder objects representing the current directory structure. Each object includes `name`, `isDirectory`, and `path` properties. | | `height` | string \| number | The height of the component `default: 600px`. Can be a string (e.g., `'100%'`, `'10rem'`) or a number (in pixels). | +| `initialPath` | string | The path of the directory to be loaded initially e.g. `/Documents`. This should be the path of a folder which is included in `files` array. Default value is `""` | | `isLoading` | boolean | A boolean state indicating whether the application is currently performing an operation, such as creating, renaming, or deleting a file/folder. Displays a loading state if set `true`. | | `layout` | "list" \| "grid" | Specifies the default layout style for the file manager. Can be either "list" or "grid". Default value is "grid". | | `maxFileSize` | number | For limiting the maximum upload file size in bytes. | diff --git a/frontend/src/FileManager/FileList/FilesHeader.jsx b/frontend/src/FileManager/FileList/FilesHeader.jsx index 95a2207..753aae4 100644 --- a/frontend/src/FileManager/FileList/FilesHeader.jsx +++ b/frontend/src/FileManager/FileList/FilesHeader.jsx @@ -10,7 +10,7 @@ const FilesHeader = ({ unselectFiles }) => { const { currentPathFiles } = useFileNavigation(); const allFilesSelected = useMemo(() => { - return selectedFiles.length === currentPathFiles.length; + return currentPathFiles.length > 0 && selectedFiles.length === currentPathFiles.length; }, [selectedFiles, currentPathFiles]); const handleSelectAll = (e) => { @@ -30,7 +30,7 @@ const FilesHeader = ({ unselectFiles }) => { >