diff --git a/packages/@uppy/google-drive/src/DriveProviderViews.ts b/packages/@uppy/google-drive/src/DriveProviderViews.ts deleted file mode 100644 index 7ccbe80920..0000000000 --- a/packages/@uppy/google-drive/src/DriveProviderViews.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ProviderViews } from '@uppy/provider-views' -import type { CompanionFile } from '@uppy/utils/lib/CompanionFile' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' - -export default class DriveProviderViews< - M extends Meta, - B extends Body, -> extends ProviderViews { - toggleCheckbox(e: Event, file: CompanionFile): void { - e.stopPropagation() - e.preventDefault() - - // Shared Drives aren't selectable; for all else, defer to the base ProviderView. - if (!file.custom!.isSharedDrive) { - super.toggleCheckbox(e, file) - } - } -} diff --git a/packages/@uppy/google-drive/src/GoogleDrive.tsx b/packages/@uppy/google-drive/src/GoogleDrive.tsx index 289940f3e2..121bfb672c 100644 --- a/packages/@uppy/google-drive/src/GoogleDrive.tsx +++ b/packages/@uppy/google-drive/src/GoogleDrive.tsx @@ -10,7 +10,6 @@ import { h, type ComponentChild } from 'preact' import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy' -import DriveProviderViews from './DriveProviderViews.ts' import locale from './locale.ts' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json @@ -102,7 +101,7 @@ export default class GoogleDrive< } install(): void { - this.view = new DriveProviderViews(this, { + this.view = new ProviderViews(this, { provider: this.provider, loadAllFiles: true, }) diff --git a/packages/@uppy/provider-views/src/Browser.tsx b/packages/@uppy/provider-views/src/Browser.tsx index f820491da1..2cbbffc834 100644 --- a/packages/@uppy/provider-views/src/Browser.tsx +++ b/packages/@uppy/provider-views/src/Browser.tsx @@ -15,8 +15,6 @@ import SearchFilterInput from './SearchFilterInput.tsx' import FooterActions from './FooterActions.tsx' import Item from './Item/index.tsx' -const VIRTUAL_SHARED_DIR = 'shared-with-me' - type ListItemProps = { currentSelection: any[] uppyFiles: UppyFile[] @@ -60,7 +58,9 @@ function ListItem(props: ListItemProps) { type: 'folder', // TODO: when was this supposed to be true? isDisabled: false, - isCheckboxDisabled: f.id === VIRTUAL_SHARED_DIR, + // Disable checkboxes for GoogleDrive's team drives + // (github.com/transloadit/uppy/issues/5232) + isCheckboxDisabled: !!f.custom?.isSharedDrive, // getNextFolder always exists when f.isFolder is true handleFolderClick: () => getNextFolder!(f), })