Skip to content

Commit

Permalink
Bump version to 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteMX committed Jan 7, 2022
1 parent 1ebae57 commit 4d3114a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "filedropper",
"widgetName": "FileDropper",
"version": "1.3.2",
"version": "1.4.0",
"description": "Drop files in your Mendix Application",
"copyright": "Mendix 2020",
"author": "Jelte Lagendijk",
Expand Down
11 changes: 5 additions & 6 deletions src/FileDropper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,12 @@ class FileDropperContainer extends Component<FileDropperContainerProps, {}> {
| undefined;

if (typeof verifyError !== "undefined" && verifyError !== "" && verifyError !== null) {
const errorText = this.store.texts.FILESREJECTEDBYSERVER
.replace(/%%FILENAME%%/g, file.name)
.replace(/%%ERROR%%/g, verifyError);
const errorText = this.store.texts.FILESREJECTEDBYSERVER.replace(
/%%FILENAME%%/g,
file.name
).replace(/%%ERROR%%/g, verifyError);

this.store.addValidationMessage(
new ValidationMessage(errorText, "warning")
);
this.store.addValidationMessage(new ValidationMessage(errorText, "warning"));
this.store.deleteFile(file);
return false;
}
Expand Down
17 changes: 6 additions & 11 deletions src/components/FileDropper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,20 @@ export class FileDropper extends Component<FileDropperProps, {}> {
const otherRejected: File[] = [];
fileRejections.forEach(reject => {
if (maxSize !== null && reject && reject.file.size && reject.file.size > maxSize) {
const text = FILERECTEDSIZE
.replace(/%%FILENAME%%/g, reject.file.name)
.replace(/%%MAXSIZE%%/g, fileSize(maxSize));

const message = new ValidationMessage(
text,
"warning"
const text = FILERECTEDSIZE.replace(/%%FILENAME%%/g, reject.file.name).replace(
/%%MAXSIZE%%/g,
fileSize(maxSize)
);

const message = new ValidationMessage(text, "warning");
store.addValidationMessage(message);
} else {
otherRejected.push(reject.file);
}
});

if (otherRejected.length > 0) {
mx.ui.info(
[FILESREJECTED, "", ...otherRejected.map(file => file.name)].join("\n"),
true
);
mx.ui.info([FILESREJECTED, "", ...otherRejected.map(file => file.name)].join("\n"), true);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="FileDropper" version="1.3.2" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="FileDropper" version="1.4.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="FileDropper.xml"/>
</widgetFiles>
Expand Down
4 changes: 2 additions & 2 deletions src/store/fileDropperFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class FileDropperFile implements IFileDropperFile {
this.status = "error";
}
// @ts-ignore
} catch (error: any) {
} catch (error) {
this.error = error;
this.status = error;
}
Expand All @@ -82,7 +82,7 @@ export class FileDropperFile implements IFileDropperFile {
this.hash = md5(base64);
}
// @ts-ignore
} catch (error: any) {
} catch (error) {
this.status = "error";
this.error = error.message || "unknown error";
this.data = this.base64 = null;
Expand Down

0 comments on commit 4d3114a

Please sign in to comment.