@dsivd/prestations-ng 16.1.0-beta.1 → 16.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dsivd-prestations-ng-v16.1.0-beta.2.tgz +0 -0
- package/esm2020/foehn-upload/uploader.helper.mjs +10 -3
- package/fesm2015/dsivd-prestations-ng.mjs +9 -2
- package/fesm2015/dsivd-prestations-ng.mjs.map +1 -1
- package/fesm2020/dsivd-prestations-ng.mjs +9 -2
- package/fesm2020/dsivd-prestations-ng.mjs.map +1 -1
- package/package.json +1 -1
- package/dsivd-prestations-ng-v16.1.0-beta.1.tgz +0 -0
|
@@ -2127,7 +2127,14 @@ class UploaderHelper {
|
|
|
2127
2127
|
this._accept = value;
|
|
2128
2128
|
}
|
|
2129
2129
|
getMaxFileSizeInBytesForFormKey(formKey) {
|
|
2130
|
-
|
|
2130
|
+
const byFormKey = this._fileMaxSizeInBytesByFormKey[formKey];
|
|
2131
|
+
if (!isNaN(byFormKey)) {
|
|
2132
|
+
return byFormKey;
|
|
2133
|
+
}
|
|
2134
|
+
else {
|
|
2135
|
+
const keyAsRegex = Object.keys(this._fileMaxSizeInBytesByFormKey).find(canBeARegex => formKey.match(canBeARegex));
|
|
2136
|
+
return this._fileMaxSizeInBytesByFormKey[keyAsRegex];
|
|
2137
|
+
}
|
|
2131
2138
|
}
|
|
2132
2139
|
isFileTooBig(formKey, fileSizeInBytes) {
|
|
2133
2140
|
return this.isTooBig(fileSizeInBytes, this.getMaxFileSizeInBytesForFormKey(formKey));
|
|
@@ -2348,7 +2355,7 @@ class UploaderHelper {
|
|
|
2348
2355
|
const formattedErrorMsg = errorMsg.replace('%1$s', fileName);
|
|
2349
2356
|
if (errorCode.startsWith('413')) {
|
|
2350
2357
|
// REQUEST_ENTITY_TOO_LARGE_ERROR_MSG
|
|
2351
|
-
const fileMaxSize = (this.
|
|
2358
|
+
const fileMaxSize = (this.getMaxFileSizeInBytesForFormKey(name) /
|
|
2352
2359
|
(1024 * 1024)).toString();
|
|
2353
2360
|
return formattedErrorMsg.replace('%2$s', fileMaxSize);
|
|
2354
2361
|
}
|