Merge pull request #381 from the-luap/chore/external-folder-picker-types

chore(events): type FolderTreeNode entries with ExternalEntry
This commit is contained in:
Paul Nothaft
2026-05-04 13:31:11 +02:00
committed by GitHub
@@ -66,7 +66,7 @@ import { api } from '../../config/api';
import { buildResourceUrl, buildShareLinkUrl } from '../../utils/url'; import { buildResourceUrl, buildShareLinkUrl } from '../../utils/url';
import { isGalleryPublic, normalizeRequirePassword } from '../../utils/accessControl'; import { isGalleryPublic, normalizeRequirePassword } from '../../utils/accessControl';
import { archiveService } from '../../services/archive.service'; import { archiveService } from '../../services/archive.service';
import { externalMediaService } from '../../services/externalMedia.service'; import { externalMediaService, type ExternalEntry } from '../../services/externalMedia.service';
import { photosService, AdminPhoto, type PhotoFilters as PhotoFilterParams, type FeedbackFilters } from '../../services/photos.service'; import { photosService, AdminPhoto, type PhotoFilters as PhotoFilterParams, type FeedbackFilters } from '../../services/photos.service';
import { feedbackService, FeedbackSettings as FeedbackSettingsType } from '../../services/feedback.service'; import { feedbackService, FeedbackSettings as FeedbackSettingsType } from '../../services/feedback.service';
import { cssTemplatesService, type EnabledTemplate } from '../../services/cssTemplates.service'; import { cssTemplatesService, type EnabledTemplate } from '../../services/cssTemplates.service';
@@ -92,7 +92,7 @@ const FolderTreeNode: React.FC<{
staleTime: 30_000 staleTime: 30_000
}); });
const dirs = (data?.entries || []).filter((e: any) => e.type === 'dir'); const dirs: ExternalEntry[] = (data?.entries || []).filter((e: ExternalEntry) => e.type === 'dir');
const showEmpty = isExpanded && !isLoading && !isError && dirs.length === 0; const showEmpty = isExpanded && !isLoading && !isError && dirs.length === 0;
const indentStyle = { paddingLeft: depth * 16 + 4 }; const indentStyle = { paddingLeft: depth * 16 + 4 };
const childIndentStyle = { paddingLeft: (depth + 1) * 16 + 4 }; const childIndentStyle = { paddingLeft: (depth + 1) * 16 + 4 };
@@ -158,7 +158,7 @@ const FolderTreeNode: React.FC<{
{t('events.externalFolderEmpty', 'No subfolders')} {t('events.externalFolderEmpty', 'No subfolders')}
</div> </div>
)} )}
{dirs.map((d: any) => { {dirs.map((d) => {
const childPath = path ? `${path}/${d.name}` : d.name; const childPath = path ? `${path}/${d.name}` : d.name;
return ( return (
<FolderTreeNode <FolderTreeNode