@uppy/dashboard: remove deprecated autoOpenFileEditor option (#5200)

This commit is contained in:
Mikael Finstad 2024-05-28 23:38:06 +02:00 committed by Antoine du Hamel
parent 388f8b78ae
commit 06df65eb43
No known key found for this signature in database
GPG key ID: 21D900FFDB233756

View file

@ -131,8 +131,6 @@ export interface DashboardInlineOptions {
interface DashboardMiscOptions<M extends Meta, B extends Body>
extends UIPluginOptions {
autoOpen?: 'metaEditor' | 'imageEditor' | null
/** @deprecated use option autoOpen instead */
autoOpenFileEditor?: boolean
defaultPickerIcon?: typeof defaultPickerIcon
disabled?: boolean
disableInformer?: boolean
@ -211,7 +209,6 @@ const defaultOptions = {
showNativeVideoCameraButton: false,
theme: 'light',
autoOpen: null,
autoOpenFileEditor: false,
disabled: false,
disableLocalFiles: false,
@ -265,16 +262,7 @@ export default class Dashboard<M extends Meta, B extends Body> extends UIPlugin<
private removeDragOverClassTimeout!: ReturnType<typeof setTimeout>
constructor(uppy: Uppy<M, B>, opts?: DashboardOptions<M, B>) {
// support for the legacy `autoOpenFileEditor` option,
// TODO: we can remove this code when we update the Uppy major version
let autoOpen: DashboardOptions<M, B>['autoOpen']
if (!opts) {
autoOpen = null
} else if (opts.autoOpen === undefined) {
autoOpen = opts.autoOpenFileEditor ? 'imageEditor' : null
} else {
autoOpen = opts.autoOpen
}
const autoOpen = opts?.autoOpen ?? null
super(uppy, { ...defaultOptions, ...opts, autoOpen })
this.id = this.opts.id || 'Dashboard'
this.title = 'Dashboard'