Skip to content

Commit 4d3114a

Browse files
author
JelteMX
committed
Bump version to 1.4.0
1 parent 1ebae57 commit 4d3114a

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "filedropper",
33
"widgetName": "FileDropper",
4-
"version": "1.3.2",
4+
"version": "1.4.0",
55
"description": "Drop files in your Mendix Application",
66
"copyright": "Mendix 2020",
77
"author": "Jelte Lagendijk",

src/FileDropper.tsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,12 @@ class FileDropperContainer extends Component<FileDropperContainerProps, {}> {
321321
| undefined;
322322

323323
if (typeof verifyError !== "undefined" && verifyError !== "" && verifyError !== null) {
324-
const errorText = this.store.texts.FILESREJECTEDBYSERVER
325-
.replace(/%%FILENAME%%/g, file.name)
326-
.replace(/%%ERROR%%/g, verifyError);
324+
const errorText = this.store.texts.FILESREJECTEDBYSERVER.replace(
325+
/%%FILENAME%%/g,
326+
file.name
327+
).replace(/%%ERROR%%/g, verifyError);
327328

328-
this.store.addValidationMessage(
329-
new ValidationMessage(errorText, "warning")
330-
);
329+
this.store.addValidationMessage(new ValidationMessage(errorText, "warning"));
331330
this.store.deleteFile(file);
332331
return false;
333332
}

src/components/FileDropper.tsx

+6-11
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,20 @@ export class FileDropper extends Component<FileDropperProps, {}> {
7272
const otherRejected: File[] = [];
7373
fileRejections.forEach(reject => {
7474
if (maxSize !== null && reject && reject.file.size && reject.file.size > maxSize) {
75-
const text = FILERECTEDSIZE
76-
.replace(/%%FILENAME%%/g, reject.file.name)
77-
.replace(/%%MAXSIZE%%/g, fileSize(maxSize));
78-
79-
const message = new ValidationMessage(
80-
text,
81-
"warning"
75+
const text = FILERECTEDSIZE.replace(/%%FILENAME%%/g, reject.file.name).replace(
76+
/%%MAXSIZE%%/g,
77+
fileSize(maxSize)
8278
);
79+
80+
const message = new ValidationMessage(text, "warning");
8381
store.addValidationMessage(message);
8482
} else {
8583
otherRejected.push(reject.file);
8684
}
8785
});
8886

8987
if (otherRejected.length > 0) {
90-
mx.ui.info(
91-
[FILESREJECTED, "", ...otherRejected.map(file => file.name)].join("\n"),
92-
true
93-
);
88+
mx.ui.info([FILESREJECTED, "", ...otherRejected.map(file => file.name)].join("\n"), true);
9489
}
9590
}
9691

src/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="FileDropper" version="1.3.2" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="FileDropper" version="1.4.0" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="FileDropper.xml"/>
66
</widgetFiles>

src/store/fileDropperFile.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class FileDropperFile implements IFileDropperFile {
5757
this.status = "error";
5858
}
5959
// @ts-ignore
60-
} catch (error: any) {
60+
} catch (error) {
6161
this.error = error;
6262
this.status = error;
6363
}
@@ -82,7 +82,7 @@ export class FileDropperFile implements IFileDropperFile {
8282
this.hash = md5(base64);
8383
}
8484
// @ts-ignore
85-
} catch (error: any) {
85+
} catch (error) {
8686
this.status = "error";
8787
this.error = error.message || "unknown error";
8888
this.data = this.base64 = null;

0 commit comments

Comments
 (0)