Skip to content

Commit

Permalink
Upgraded Uppy lib, added Uppy restrictions object into the form config.
Browse files Browse the repository at this point in the history
  • Loading branch information
shilob committed Sep 6, 2021
1 parent 55bd03b commit e08d88c
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 96 deletions.
170 changes: 98 additions & 72 deletions angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"owasp-password-strength-test": "1.3.0",
"rxjs": "^5.4.1",
"ts-smart-logger": "^0.0.4",
"uppy": "^0.23.3",
"uppy": "^0.25.6",
"zone.js": "^0.8.14"
},
"devDependencies": {
Expand Down
11 changes: 3 additions & 8 deletions angular/shared/form/field-datalocation.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class DataLocationField extends FieldBase<any> {
maxFileSize: number; // in bytes
maxNumberOfFiles: number;
allowedFileTypes: any[];
restrictions: any;
locationAddText: string;
editNotesButtonText: string;
editNotesTitle: string;
Expand Down Expand Up @@ -99,9 +100,7 @@ export class DataLocationField extends FieldBase<any> {
this.uppyDashboardNote = this.getTranslated(options['uppyDashboardNote'], 'Maximum upload size: 1 Gb per file');
this.columns = options['columns'] || [];

this.maxFileSize = options['maxFileSize'] || null;
this.maxNumberOfFiles = options['maxNumberOfFiles'] || null;
this.allowedFileTypes = options['allowedFileTypes'] || null;
this.restrictions = options['restrictions'] || null;

this.value = options['value'] || this.setEmptyValue();
this.recordsService = this.getFromInjector(RecordsService);
Expand Down Expand Up @@ -230,11 +229,7 @@ export class DataLocationComponent extends SimpleComponent {
const uppyConfig = {
debug: true,
autoProceed: false,
restrictions: {
maxFileSize: this.field.maxFileSize,
maxNumberOfFiles: this.field.maxNumberOfFiles,
allowedFileTypes: this.field.allowedFileTypes
}
restrictions: this.field.restrictions
};
const uppyDashboardNote = this.field.uppyDashboardNote;
console.debug(`Using Uppy config:`);
Expand Down
Loading

0 comments on commit e08d88c

Please sign in to comment.