@visns-studio/visns-components 4.9.7 → 4.9.8
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/package.json +1 -1
- package/src/components/crm/Form.jsx +37 -0
package/package.json
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
76
76
|
},
|
|
77
77
|
"name": "@visns-studio/visns-components",
|
|
78
|
-
"version": "4.9.
|
|
78
|
+
"version": "4.9.8",
|
|
79
79
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
80
80
|
"main": "src/index.js",
|
|
81
81
|
"files": [
|
|
@@ -667,11 +667,29 @@ function Form({
|
|
|
667
667
|
if (Array.isArray(formData[fileKey])) {
|
|
668
668
|
const uploadPromises = formData[fileKey].map(
|
|
669
669
|
async (file) => {
|
|
670
|
+
const toastId = toast.info(
|
|
671
|
+
`Uploading ${file.name}`,
|
|
672
|
+
{
|
|
673
|
+
progress: 0,
|
|
674
|
+
autoClose: false,
|
|
675
|
+
}
|
|
676
|
+
);
|
|
677
|
+
|
|
670
678
|
const fileRes = await Vapor.store(file, {
|
|
671
679
|
progress: (progress) => {
|
|
672
680
|
setUploadProgress(progress * 100);
|
|
681
|
+
toast.update(toastId, {
|
|
682
|
+
progress,
|
|
683
|
+
});
|
|
673
684
|
},
|
|
674
685
|
});
|
|
686
|
+
|
|
687
|
+
toast.update(toastId, {
|
|
688
|
+
render: `${file.name} uploaded successfully!`,
|
|
689
|
+
type: toast.TYPE.SUCCESS,
|
|
690
|
+
autoClose: 3000,
|
|
691
|
+
});
|
|
692
|
+
|
|
675
693
|
return {
|
|
676
694
|
uuid: fileRes.uuid,
|
|
677
695
|
key: fileRes.key,
|
|
@@ -685,18 +703,37 @@ function Form({
|
|
|
685
703
|
};
|
|
686
704
|
}
|
|
687
705
|
);
|
|
706
|
+
|
|
688
707
|
formData['uploadedFiles'] = await Promise.all(
|
|
689
708
|
uploadPromises
|
|
690
709
|
);
|
|
691
710
|
} else {
|
|
711
|
+
const toastId = toast.info(
|
|
712
|
+
`Uploading ${formData[fileKey].name}`,
|
|
713
|
+
{
|
|
714
|
+
progress: 0,
|
|
715
|
+
autoClose: false,
|
|
716
|
+
}
|
|
717
|
+
);
|
|
718
|
+
|
|
692
719
|
const fileRes = await Vapor.store(
|
|
693
720
|
formData[fileKey],
|
|
694
721
|
{
|
|
695
722
|
progress: (progress) => {
|
|
696
723
|
setUploadProgress(progress * 100);
|
|
724
|
+
toast.update(toastId, {
|
|
725
|
+
progress,
|
|
726
|
+
});
|
|
697
727
|
},
|
|
698
728
|
}
|
|
699
729
|
);
|
|
730
|
+
|
|
731
|
+
toast.update(toastId, {
|
|
732
|
+
render: `${formData[fileKey].name} uploaded successfully!`,
|
|
733
|
+
type: toast.TYPE.SUCCESS,
|
|
734
|
+
autoClose: 3000,
|
|
735
|
+
});
|
|
736
|
+
|
|
700
737
|
formData['uuid'] = fileRes.uuid;
|
|
701
738
|
formData['key'] = fileRes.key;
|
|
702
739
|
formData['bucket'] = fileRes.bucket;
|