@visns-studio/visns-components 4.10.38 → 4.10.40

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 CHANGED
@@ -77,7 +77,7 @@
77
77
  "react-dom": "^17.0.0 || ^18.0.0"
78
78
  },
79
79
  "name": "@visns-studio/visns-components",
80
- "version": "4.10.38",
80
+ "version": "4.10.40",
81
81
  "description": "Various packages to assist in the development of our Custom Applications.",
82
82
  "main": "src/index.js",
83
83
  "files": [
@@ -571,16 +571,28 @@ const DataGrid = forwardRef(
571
571
  break;
572
572
  case 'form':
573
573
  if (s.key) {
574
- let fsd = formSettingData;
574
+ console.info('Form Setting Data:', formSettingData);
575
+ let fsd = s.form;
575
576
 
576
577
  if (fsd.fields && fsd.fields.length > 0) {
578
+ console.info(
579
+ 'Form Setting Data Fields:',
580
+ fsd.fields.length
581
+ );
577
582
  fsd.fields.forEach((fItem, fKey) => {
578
583
  if (fItem.id === s.key) {
584
+ console.info(
585
+ 'Form Setting Data Fields ID:',
586
+ fItem.id
587
+ );
579
588
  fsd.fields[fKey].value = d.id;
580
589
  }
581
590
  });
582
591
 
583
- setFormSettingData(fsd);
592
+ setFormSettingData((prevState) => ({
593
+ ...prevState,
594
+ ...fsd,
595
+ }));
584
596
  }
585
597
  }
586
598
  modalSettingOpen('create', 0);
@@ -788,7 +800,13 @@ const DataGrid = forwardRef(
788
800
  }
789
801
  }
790
802
  } else {
791
- navigate(`${linkUrl}${rowData}`);
803
+ if (rowData) {
804
+ navigate(`${linkUrl}${rowData}`);
805
+ } else {
806
+ toast.warn(
807
+ 'No data available for this link.'
808
+ );
809
+ }
792
810
  }
793
811
  } else {
794
812
  if (rowProps.data[column.id]) {
@@ -1197,10 +1215,6 @@ const DataGrid = forwardRef(
1197
1215
  }
1198
1216
  }
1199
1217
 
1200
- if (s.form) {
1201
- setFormSettingData(s.form);
1202
- }
1203
-
1204
1218
  if (allow) {
1205
1219
  switch (s.id) {
1206
1220
  case 'activate':
@@ -574,10 +574,6 @@ function Form({
574
574
  }
575
575
  };
576
576
 
577
- useEffect(() => {
578
- console.info('Form Settings', formSettings);
579
- }, [formSettings]);
580
-
581
577
  const handleSubmit = async (e) => {
582
578
  try {
583
579
  if (e) {
@@ -701,7 +697,6 @@ function Form({
701
697
 
702
698
  if (Array.isArray(formData[fileKey])) {
703
699
  if (fileUpload && formData[fileKey]) {
704
- console.info('File Upload:', formData[fileKey]);
705
700
  const uploadPromises = formData[fileKey].map(
706
701
  async (file) => {
707
702
  const toastId = toast.info(