@visns-studio/visns-components 4.9.5 → 4.9.7

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
@@ -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.5",
78
+ "version": "4.9.7",
79
79
  "description": "Various packages to assist in the development of our Custom Applications.",
80
80
  "main": "src/index.js",
81
81
  "files": [
@@ -566,7 +566,10 @@ function Form({
566
566
  }
567
567
 
568
568
  if (item.required) {
569
- if (!formData[item.id]) {
569
+ if (
570
+ formData[item.id] === null ||
571
+ formData[item.id] === ''
572
+ ) {
570
573
  if (
571
574
  item.hasOwnProperty('required_check') &&
572
575
  item.required_check &&
@@ -575,6 +578,7 @@ function Form({
575
578
  validation += `${item.label} is a required field.<br/>`;
576
579
  _inputClass[item.id] = styles.inputError;
577
580
  } else {
581
+ console.info('b', formData, item.id);
578
582
  validation += `${item.label} is a required field.<br/>`;
579
583
  _inputClass[item.id] = styles.inputError;
580
584
  }
@@ -585,7 +589,8 @@ function Form({
585
589
  item.hasOwnProperty('required_rely') &&
586
590
  item.required_rely &&
587
591
  formData[item.required_rely] &&
588
- !formData[item.id]
592
+ (formData[item.id] === null ||
593
+ formData[item.id] === '')
589
594
  ) {
590
595
  validation += `${item.label} is a required field.<br/>`;
591
596
  _inputClass[item.id] = styles.inputError;
@@ -604,6 +609,7 @@ function Form({
604
609
  let method = 'POST';
605
610
  let fileUpload = false;
606
611
  let fileKey = '';
612
+ let fileFieldSetting = '';
607
613
 
608
614
  if (formSettings.customUrl && formSettings.customMethod) {
609
615
  url = formSettings.customUrl;
@@ -645,6 +651,14 @@ function Form({
645
651
  if (formData[item] instanceof File) {
646
652
  fileUpload = true;
647
653
  fileKey = item;
654
+
655
+ if (formSettings.fields.length > 0) {
656
+ formSettings.fields.forEach((field) => {
657
+ if (field.id === item) {
658
+ fileFieldSetting = field;
659
+ }
660
+ });
661
+ }
648
662
  }
649
663
  });
650
664
  }
@@ -666,6 +680,8 @@ function Form({
666
680
  filesize: file.size,
667
681
  extension: fileRes.extension,
668
682
  file_relationship: fileKey,
683
+ fileable_field:
684
+ fileFieldSetting.fileable_field,
669
685
  };
670
686
  }
671
687
  );
@@ -688,6 +704,8 @@ function Form({
688
704
  formData['filesize'] = formData[fileKey].size;
689
705
  formData['extension'] = fileRes.extension;
690
706
  formData['file_relationship'] = fileKey;
707
+ formData['fileable_field'] =
708
+ fileFieldSetting.fileable_field;
691
709
  }
692
710
  }
693
711
 
@@ -9,6 +9,8 @@ import Reveal from 'react-reveal/Reveal';
9
9
 
10
10
  import CustomFetch from '../Fetch';
11
11
 
12
+ import styles from './styles/Verify.module.scss';
13
+
12
14
  const Verify = ({ logo }) => {
13
15
  const navigate = useNavigate();
14
16
  const { code } = useParams();