mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 01:57:41 +02:00
feat(file-manager): split "All Files" into internal-only + External views (#1621)
Reporter linked a NAS and the auto-imported files drowned their own Bambuddy uploads in the "All Files" sidebar listing. There was no filter to escape it — only per-folder clicks. Restore the pre-external semantics: "All Files" now lists managed-storage files only. The combined across-every-external view moves to a new sibling sidebar entry, "External", that only appears when at least one external folder is linked. Backend: GET /api/v1/library/files gains internal_only and external_only query flags. Filter is on LibraryFile.is_external. Both flags set is a 400, not a silent pick-one. Frontend: new topLevelView state on FileManagerPage (default internal); the query passes the scope only when selectedFolderId is null. Mobile selector dropdown uses __top:internal / __top:external sentinels so the same state round-trips through option values. Empty-state copy distinguishes internal-empty from external-empty.
This commit is contained in:
@@ -5541,7 +5541,12 @@ export const api = {
|
||||
getLibraryFoldersByArchive: (archiveId: number) =>
|
||||
request<LibraryFolder[]>(`/library/folders/by-archive/${archiveId}`),
|
||||
|
||||
getLibraryFiles: (folderId?: number | null, includeRoot = true, projectId?: number) => {
|
||||
getLibraryFiles: (
|
||||
folderId?: number | null,
|
||||
includeRoot = true,
|
||||
projectId?: number,
|
||||
scope?: 'internal' | 'external',
|
||||
) => {
|
||||
const params = new URLSearchParams();
|
||||
if (folderId !== undefined && folderId !== null) {
|
||||
params.set('folder_id', String(folderId));
|
||||
@@ -5550,6 +5555,8 @@ export const api = {
|
||||
params.set('project_id', String(projectId));
|
||||
}
|
||||
params.set('include_root', String(includeRoot));
|
||||
if (scope === 'internal') params.set('internal_only', 'true');
|
||||
else if (scope === 'external') params.set('external_only', 'true');
|
||||
return request<LibraryFileListItem[]>(`/library/files?${params}`);
|
||||
},
|
||||
getLibraryFile: (id: number) => request<LibraryFile>(`/library/files/${id}`),
|
||||
|
||||
Reference in New Issue
Block a user