@unimaze/billing 0.6.0-rc.0 → 0.6.0-rc.1
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.
|
@@ -139,6 +139,7 @@ var ReferenceIdentifiers = function (props) {
|
|
|
139
139
|
var newState = referenceIdentifierValue.slice();
|
|
140
140
|
newState.splice(index, 1, a);
|
|
141
141
|
setReferenceIdentifierValue(newState);
|
|
142
|
+
props.formInstance.resetFields([["invoice", "referenceIdentifiers", index, "value"]]);
|
|
142
143
|
} }, getReferenceIdentifier(props.receiverRequirements)))),
|
|
143
144
|
react_1.default.createElement(antd_1.Col, { span: 12 },
|
|
144
145
|
react_1.default.createElement(antd_1.Form.Item, __assign({}, field, { name: [field.name, "value"], fieldKey: [field.fieldKey, "value"], rules: [{ required: true }] }), getReferenceIdentifierValueInput(referenceIdentifierValue[index], props.receiverRequirements, props.rapiBaseUrl))))));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UploadFile } from "antd/es/upload/interface";
|
|
2
|
+
declare const reportIfFileIsValid: (file: UploadFile<any>, errorMessages: {
|
|
3
|
+
uploadFailed: string;
|
|
4
|
+
uploadErrorWrongType: string;
|
|
5
|
+
uploadErrorToLarge: string;
|
|
6
|
+
}) => boolean;
|
|
7
|
+
export { reportIfFileIsValid };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var antd_1 = require("antd");
|
|
4
|
+
var reportIfFileIsValid = function (file, errorMessages) {
|
|
5
|
+
var isFileCorrectType = (file.type === "application/pdf"
|
|
6
|
+
|| file.type === "image/jpeg"
|
|
7
|
+
|| file.type === "image/png"
|
|
8
|
+
|| file.type === "image/gif"
|
|
9
|
+
|| file.type === "image/tiff"
|
|
10
|
+
|| file.type === "text/plain");
|
|
11
|
+
var isFileCorrectSize = (file.size <= 300000);
|
|
12
|
+
if (!isFileCorrectType) {
|
|
13
|
+
antd_1.notification.error({
|
|
14
|
+
message: errorMessages.uploadFailed,
|
|
15
|
+
description: errorMessages.uploadErrorWrongType
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (!isFileCorrectSize) {
|
|
19
|
+
antd_1.notification.error({
|
|
20
|
+
message: errorMessages.uploadFailed,
|
|
21
|
+
description: errorMessages.uploadErrorToLarge
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return isFileCorrectType && isFileCorrectSize;
|
|
25
|
+
};
|
|
26
|
+
exports.reportIfFileIsValid = reportIfFileIsValid;
|