Skip to content

Commit

Permalink
Disable select all checkbox for plugin sources (stashapp#4434)
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored and dogwithakeyboard committed Feb 18, 2024
1 parent 6625780 commit f8a7eec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions ui/v2.5/src/components/Settings/ScraperPackageManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const AvailableScraperPackages: React.FC = () => {
addSource={addSource}
editSource={editSource}
deleteSource={deleteSource}
allowSelectAll
/>
</div>
</SettingSection>
Expand Down
10 changes: 9 additions & 1 deletion ui/v2.5/src/components/Shared/PackageManager/PackageManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -623,13 +623,15 @@ const SourcePackagesList: React.FC<{
loadSource: () => Promise<RemotePackage[]>;
selectedOnly: boolean;
selectedPackages: RemotePackage[];
allowSelectAll?: boolean;
setSelectedPackages: React.Dispatch<React.SetStateAction<RemotePackage[]>>;
renderDescription?: (pkg: RemotePackage) => React.ReactNode;
editSource: () => void;
deleteSource: () => void;
}> = ({
source,
loadSource,
allowSelectAll,
selectedOnly,
selectedPackages,
setSelectedPackages,
Expand Down Expand Up @@ -788,7 +790,7 @@ const SourcePackagesList: React.FC<{
<>
<tr className="package-source">
<td>
{packages !== undefined ? (
{allowSelectAll && packages !== undefined ? (
<Form.Check
checked={sourceChecked ?? false}
onChange={() => toggleSource()}
Expand Down Expand Up @@ -847,6 +849,7 @@ const AvailablePackagesList: React.FC<{
React.SetStateAction<Record<string, RemotePackage[]>>
>;
selectedOnly: boolean;
allowSourceSelectAll?: boolean;
addSource: (src: GQL.PackageSource) => void;
editSource: (existing: GQL.PackageSource, changed: GQL.PackageSource) => void;
deleteSource: (source: GQL.PackageSource) => void;
Expand All @@ -862,6 +865,7 @@ const AvailablePackagesList: React.FC<{
addSource,
editSource,
deleteSource,
allowSourceSelectAll,
}) => {
const [deletingSource, setDeletingSource] = useState<GQL.PackageSource>();
const [editingSource, setEditingSource] = useState<GQL.PackageSource>();
Expand Down Expand Up @@ -923,6 +927,7 @@ const AvailablePackagesList: React.FC<{
setSelectedPackages={(v) => setSelectedSourcePackages(src, v)}
editSource={() => setEditingSource(src)}
deleteSource={() => setDeletingSource(src)}
allowSelectAll={allowSourceSelectAll}
/>
))}
<tr className="add-package-source">
Expand Down Expand Up @@ -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,
Expand All @@ -1015,6 +1021,7 @@ export const AvailablePackages: React.FC<{
addSource,
editSource,
deleteSource,
allowSelectAll,
}) => {
const [checkedPackages, setCheckedPackages] = useState<
Record<string, RemotePackage[]>
Expand Down Expand Up @@ -1066,6 +1073,7 @@ export const AvailablePackages: React.FC<{
addSource={addSource}
editSource={editSource}
deleteSource={deleteSource}
allowSourceSelectAll={allowSelectAll}
/>
</div>
);
Expand Down

0 comments on commit f8a7eec

Please sign in to comment.