Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Restrictions parameter declaration #1731

Closed
wants to merge 1 commit into from
Closed

Fix Restrictions parameter declaration #1731

wants to merge 1 commit into from

Conversation

Steveb-p
Copy link

Restrictions interface requires all parameters to be passed, even though they can be safely omitted.

See:

const defaultOptions = {
id: 'uppy',
autoProceed: false,
allowMultipleUploads: true,
debug: false,
restrictions: {
maxFileSize: null,
maxNumberOfFiles: null,
minNumberOfFiles: null,
allowedFileTypes: null
},
meta: {},
onBeforeFileAdded: (currentFile, files) => currentFile,
onBeforeUpload: (files) => files,
store: DefaultStore(),
logger: nullLogger
}
// Merge default options with the ones set by user
this.opts = Object.assign({}, defaultOptions, opts)
this.opts.restrictions = Object.assign({}, defaultOptions.restrictions, this.opts.restrictions)

@goto-bus-stop
Copy link
Contributor

goto-bus-stop commented Jul 15, 2019

Thanks for the PR! Isn't this handled by the Partial<Restrictions> use here?

interface UppyOptions {
id: string;
autoProceed: boolean;
allowMultipleUploads: boolean;
debug: boolean;
restrictions: Partial<Restrictions>;
target: string | Plugin;

e; Oh, I think the above change didn't yet make it into a release. 🙈 but it will be in the next, which we should do soon…

@Steveb-p
Copy link
Author

@goto-bus-stop It should. As you said, it's just a matter of it not being yet released :) Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants