Show info text when no available migration destination sources

This commit is contained in:
schroda
2026-05-16 02:49:07 +02:00
parent 05a722de8d
commit 8d90a91537
4 changed files with 17 additions and 7 deletions

View File

@@ -35,6 +35,7 @@ import DragHandle from '@mui/icons-material/DragHandle';
import { languageCodeToName } from '@/base/utils/Languages.ts';
import { DEFAULT_FULL_FAB_HEIGHT } from '@/base/components/buttons/StyledFab.tsx';
import Stack from '@mui/material/Stack';
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
const SourceCard = memo(
({
@@ -88,7 +89,7 @@ const SourceCard = memo(
},
);
export const MigrationSourceList = ({
export const MigrationDestinationSourceList = ({
sources,
handleSelection,
selectedSourceIds,
@@ -161,6 +162,10 @@ export const MigrationSourceList = ({
handlePriorityChange(oldIndex, newIndex);
};
if (!allSources.length) {
return <EmptyViewAbsoluteCentered message={t`No sources available to migrate to`} />;
}
return (
<DndContext
sensors={dndSensors}

View File

@@ -13,7 +13,6 @@ import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewA
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { MigrationManager } from '@/features/migration/MigrationManager.ts';
import { MigrationSourceList } from '@/features/migration/components/MigrationSourceList.tsx';
import { useSelectableCollection } from '@/base/collection/hooks/useSelectableCollection.ts';
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
import { useCallback, useMemo } from 'react';
@@ -30,6 +29,7 @@ import ToggleOnIcon from '@mui/icons-material/ToggleOn';
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
import { MigrationBulkSearchOptionsDialog } from '@/features/migration/components/MigrationBulkSearchOptionsDialog.tsx';
import { AwaitableComponent } from 'awaitable-component';
import { MigrationDestinationSourceList } from '@/features/migration/components/MigrationDestinationSourceList.tsx';
export const MigrationSelectDestinationSources = () => {
const { t } = useLingui();
@@ -155,7 +155,7 @@ export const MigrationSelectDestinationSources = () => {
return (
<>
<MigrationSourceList
<MigrationDestinationSourceList
sources={sources}
selectedSourceIds={selectedItemIds}
handleSelection={handleSelection}