@unimaze/billing 0.21.27 → 0.21.28
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.
|
@@ -82,6 +82,7 @@ var translationMessages = (0, react_intl_1.defineMessages)({
|
|
|
82
82
|
defaultMessage: "File failed to upload",
|
|
83
83
|
},
|
|
84
84
|
});
|
|
85
|
+
// TODO consider removing this component (not used)
|
|
85
86
|
var Attachment = function (props) {
|
|
86
87
|
var fieldName = props.fieldName;
|
|
87
88
|
var handleRemoveFile = function () {
|
|
@@ -50,6 +50,7 @@ var icons_1 = require("@ant-design/icons");
|
|
|
50
50
|
var FileUploadUtility_1 = require("../../../utils/FileUploadUtility");
|
|
51
51
|
var lib_1 = require("antd/lib");
|
|
52
52
|
var formLayout_1 = require("../../consts/formLayout");
|
|
53
|
+
var validationRules_1 = require("../../consts/validationRules");
|
|
53
54
|
var translationMessages = (0, react_intl_1.defineMessages)({
|
|
54
55
|
attachment_title: {
|
|
55
56
|
id: "attachment_title",
|
|
@@ -115,7 +116,7 @@ var AttachmentModal = function (props) {
|
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
118
|
React.useEffect(function () {
|
|
118
|
-
var _isSaveAttachmentsDisabled = props.attachments.length > 0 ? props.attachments.some(function (attachment) { return attachment.fieldValidation !== "success" || !attachment.description; }) : true;
|
|
119
|
+
var _isSaveAttachmentsDisabled = props.attachments.length > 0 ? props.attachments.some(function (attachment) { return attachment.fieldValidation !== "success" || (!attachment.description.trim()); }) : true;
|
|
119
120
|
setIsSaveAttachmentsDisabled(_isSaveAttachmentsDisabled);
|
|
120
121
|
}, [props.attachments]);
|
|
121
122
|
var verifyAttachment = function (info, uploadSizeLimit, formInstance) {
|
|
@@ -184,7 +185,7 @@ var AttachmentModal = function (props) {
|
|
|
184
185
|
props.attachments.length > 0 && (React.createElement(antd_1.Flex, { vertical: true },
|
|
185
186
|
React.createElement(antd_1.Typography.Text, null, props.intl.formatMessage(translationMessages.attachment_title)),
|
|
186
187
|
React.createElement("hr", null),
|
|
187
|
-
props.attachments.map(function (attachment, index) { return (React.createElement(antd_1.Flex, { gap: "middle", vertical: true },
|
|
188
|
+
props.attachments.map(function (attachment, index) { return (React.createElement(antd_1.Flex, { gap: "middle", vertical: true, key: attachment.uid + index },
|
|
188
189
|
React.createElement(antd_1.Flex, { gap: "middle", justify: "space-between" },
|
|
189
190
|
React.createElement(antd_1.Typography.Text, { type: attachment.file.status === "error" ? "danger" : undefined },
|
|
190
191
|
React.createElement(icons_1.PaperClipOutlined, null)),
|
|
@@ -200,6 +201,9 @@ var AttachmentModal = function (props) {
|
|
|
200
201
|
required: true,
|
|
201
202
|
message: props.intl.formatMessage(translationMessages.attachment_labels_Description_requiredMessage),
|
|
202
203
|
},
|
|
204
|
+
{
|
|
205
|
+
validator: (0, validationRules_1.noWhitespaceValidator)(props.intl)
|
|
206
|
+
}
|
|
203
207
|
], name: ["attachments", "file".concat(index + 1), "description"] }),
|
|
204
208
|
React.createElement(antd_1.Input, { prefix: React.createElement(antd_1.Typography.Text, { type: "danger" }, "*"), placeholder: props.intl.formatMessage(translationMessages.attachment_labels_Description), onChange: function (e) { return updateFile(attachment.file, { description: e.target.value }); } }))))); })))));
|
|
205
209
|
};
|