From f8a7eec98f517089fdb9f41bb6246e8b2241cc1b Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Tue, 9 Jan 2024 09:32:16 +1100 Subject: [PATCH] Disable select all checkbox for plugin sources (#4434) --- .../src/components/Settings/ScraperPackageManager.tsx | 1 + .../Shared/PackageManager/PackageManager.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/v2.5/src/components/Settings/ScraperPackageManager.tsx b/ui/v2.5/src/components/Settings/ScraperPackageManager.tsx index 088b5f8bfa0..4d35aef0537 100644 --- a/ui/v2.5/src/components/Settings/ScraperPackageManager.tsx +++ b/ui/v2.5/src/components/Settings/ScraperPackageManager.tsx @@ -161,6 +161,7 @@ export const AvailableScraperPackages: React.FC = () => { addSource={addSource} editSource={editSource} deleteSource={deleteSource} + allowSelectAll /> diff --git a/ui/v2.5/src/components/Shared/PackageManager/PackageManager.tsx b/ui/v2.5/src/components/Shared/PackageManager/PackageManager.tsx index 2a7d6a8df7a..2c36704cf1a 100644 --- a/ui/v2.5/src/components/Shared/PackageManager/PackageManager.tsx +++ b/ui/v2.5/src/components/Shared/PackageManager/PackageManager.tsx @@ -623,6 +623,7 @@ const SourcePackagesList: React.FC<{ loadSource: () => Promise; selectedOnly: boolean; selectedPackages: RemotePackage[]; + allowSelectAll?: boolean; setSelectedPackages: React.Dispatch>; renderDescription?: (pkg: RemotePackage) => React.ReactNode; editSource: () => void; @@ -630,6 +631,7 @@ const SourcePackagesList: React.FC<{ }> = ({ source, loadSource, + allowSelectAll, selectedOnly, selectedPackages, setSelectedPackages, @@ -788,7 +790,7 @@ const SourcePackagesList: React.FC<{ <> - {packages !== undefined ? ( + {allowSelectAll && packages !== undefined ? ( toggleSource()} @@ -847,6 +849,7 @@ const AvailablePackagesList: React.FC<{ React.SetStateAction> >; selectedOnly: boolean; + allowSourceSelectAll?: boolean; addSource: (src: GQL.PackageSource) => void; editSource: (existing: GQL.PackageSource, changed: GQL.PackageSource) => void; deleteSource: (source: GQL.PackageSource) => void; @@ -862,6 +865,7 @@ const AvailablePackagesList: React.FC<{ addSource, editSource, deleteSource, + allowSourceSelectAll, }) => { const [deletingSource, setDeletingSource] = useState(); const [editingSource, setEditingSource] = useState(); @@ -923,6 +927,7 @@ const AvailablePackagesList: React.FC<{ setSelectedPackages={(v) => setSelectedSourcePackages(src, v)} editSource={() => setEditingSource(src)} deleteSource={() => setDeletingSource(src)} + allowSelectAll={allowSourceSelectAll} /> ))} @@ -1006,6 +1011,7 @@ export const AvailablePackages: React.FC<{ addSource: (src: GQL.PackageSource) => void; editSource: (existing: GQL.PackageSource, changed: GQL.PackageSource) => void; deleteSource: (source: GQL.PackageSource) => void; + allowSelectAll?: boolean; }> = ({ sources, loadSource, @@ -1015,6 +1021,7 @@ export const AvailablePackages: React.FC<{ addSource, editSource, deleteSource, + allowSelectAll, }) => { const [checkedPackages, setCheckedPackages] = useState< Record @@ -1066,6 +1073,7 @@ export const AvailablePackages: React.FC<{ addSource={addSource} editSource={editSource} deleteSource={deleteSource} + allowSourceSelectAll={allowSelectAll} /> );