@visns-studio/visns-components 4.7.8 → 4.7.10
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/Field.jsx +36 -2
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.7.
|
|
78
|
+
"version": "4.7.10",
|
|
79
79
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
80
80
|
"main": "src/index.js",
|
|
81
81
|
"files": [
|
|
@@ -554,8 +554,25 @@ function Field({
|
|
|
554
554
|
className={styles.buttonRight}
|
|
555
555
|
onClick={(e) => {
|
|
556
556
|
e.preventDefault();
|
|
557
|
+
let allow = false;
|
|
557
558
|
|
|
558
|
-
|
|
559
|
+
if (settings.create.parent_id) {
|
|
560
|
+
if (
|
|
561
|
+
formData[settings.create.parent_id]
|
|
562
|
+
) {
|
|
563
|
+
allow = true;
|
|
564
|
+
}
|
|
565
|
+
} else {
|
|
566
|
+
allow = true;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
if (allow) {
|
|
570
|
+
handleAddEntry(settings.create);
|
|
571
|
+
} else {
|
|
572
|
+
toast.warning(
|
|
573
|
+
'Please select a parent item first'
|
|
574
|
+
);
|
|
575
|
+
}
|
|
559
576
|
}}
|
|
560
577
|
>
|
|
561
578
|
<CirclePlus strokeWidth={2} size={16} />
|
|
@@ -897,8 +914,25 @@ function Field({
|
|
|
897
914
|
className={styles.buttonRight}
|
|
898
915
|
onClick={(e) => {
|
|
899
916
|
e.preventDefault();
|
|
917
|
+
let allow = false;
|
|
900
918
|
|
|
901
|
-
|
|
919
|
+
if (settings.create.parent_id) {
|
|
920
|
+
if (
|
|
921
|
+
formData[settings.create.parent_id]
|
|
922
|
+
) {
|
|
923
|
+
allow = true;
|
|
924
|
+
}
|
|
925
|
+
} else {
|
|
926
|
+
allow = true;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
if (allow) {
|
|
930
|
+
handleAddEntry(settings.create);
|
|
931
|
+
} else {
|
|
932
|
+
toast.warning(
|
|
933
|
+
'Please select a parent item first'
|
|
934
|
+
);
|
|
935
|
+
}
|
|
902
936
|
}}
|
|
903
937
|
>
|
|
904
938
|
<CirclePlus strokeWidth={2} size={16} />
|