Show info text when no available migration destination sources
This commit is contained in:
@@ -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}
|
||||
@@ -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}
|
||||
|
||||
@@ -522,7 +522,7 @@ msgstr "Automatically refresh metadata"
|
||||
msgid "Automatically use webtoon mode for entries that are detected to likely use the long strip format"
|
||||
msgstr "Automatically use webtoon mode for entries that are detected to likely use the long strip format"
|
||||
|
||||
#: src/features/migration/components/MigrationSourceList.tsx
|
||||
#: src/features/migration/components/MigrationDestinationSourceList.tsx
|
||||
msgid "Available"
|
||||
msgstr "Available"
|
||||
|
||||
@@ -1144,7 +1144,7 @@ msgstr "Creating theme…"
|
||||
msgid "Crimson"
|
||||
msgstr "Crimson"
|
||||
|
||||
#: src/features/migration/components/MigrationSourceList.tsx
|
||||
#: src/features/migration/components/MigrationDestinationSourceList.tsx
|
||||
msgid "Current source"
|
||||
msgstr "Current source"
|
||||
|
||||
@@ -1436,7 +1436,7 @@ msgstr "Downloading"
|
||||
msgid "Downloads"
|
||||
msgstr "Downloads"
|
||||
|
||||
#: src/features/migration/components/MigrationSourceList.tsx
|
||||
#: src/features/migration/components/MigrationDestinationSourceList.tsx
|
||||
msgid "Drag to prioritize"
|
||||
msgstr "Drag to prioritize"
|
||||
|
||||
@@ -2464,6 +2464,10 @@ msgstr "No match found"
|
||||
msgid "No pages found"
|
||||
msgstr "No pages found"
|
||||
|
||||
#: src/features/migration/components/MigrationDestinationSourceList.tsx
|
||||
msgid "No sources available to migrate to"
|
||||
msgstr "No sources available to migrate to"
|
||||
|
||||
#: src/features/browse/sources/Sources.tsx
|
||||
msgid "No sources found. Install Some extensions first."
|
||||
msgstr "No sources found. Install Some extensions first."
|
||||
@@ -3066,7 +3070,7 @@ msgstr "Select enabled sources"
|
||||
msgid "Select pinned sources"
|
||||
msgstr "Select pinned sources"
|
||||
|
||||
#: src/features/migration/components/MigrationSourceList.tsx
|
||||
#: src/features/migration/components/MigrationDestinationSourceList.tsx
|
||||
msgid "Selected"
|
||||
msgstr "Selected"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user