@visns-studio/visns-components 4.5.2 → 4.5.4

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.
@@ -16,7 +16,7 @@ const CustomFetch = (
16
16
  'Content-Type': 'application/json',
17
17
  };
18
18
  const MAX_PAYLOAD_SIZE_MB =
19
- parseFloat(process.env.REACT_APP_MAX_PAYLOAD_SIZE_MB) || 4.5;
19
+ parseFloat(import.meta.env.VITE_MAX_PAYLOAD_SIZE_MB) || 4.5;
20
20
  const MAX_PAYLOAD_SIZE = MAX_PAYLOAD_SIZE_MB * 1024 * 1024; // Convert MB to bytes
21
21
 
22
22
  // Estimate headers size
@@ -256,10 +256,6 @@ const GenericDynamic = ({
256
256
  });
257
257
  };
258
258
 
259
- useEffect(() => {
260
- console.info(activeForm);
261
- }, [activeForm]);
262
-
263
259
  const handleChangeAddTableTextRow = (id) => {
264
260
  setActiveForm((prevActiveForm) => {
265
261
  // Find the key of the form that matches the id
@@ -593,10 +589,24 @@ const GenericDynamic = ({
593
589
  }
594
590
  }, [activeForm]);
595
591
 
592
+ const shouldDisplayFormList = (data, type) => {
593
+ console.info(data[type]);
594
+
595
+ if (!data[type] || !Array.isArray(data[type])) {
596
+ return false;
597
+ }
598
+ return (
599
+ data[type].length !== 1 ||
600
+ moment(data[type][0].updated_at).isAfter(
601
+ moment(data[type][0].created_at)
602
+ )
603
+ );
604
+ };
605
+
596
606
  return (
597
607
  <>
598
608
  <div className={styles.formSplit}>
599
- {multiple && (
609
+ {multiple && shouldDisplayFormList(data, type) && (
600
610
  <>
601
611
  <div className={styles.gridtxt__header}>
602
612
  <span>Form List</span>
package/package.json CHANGED
@@ -58,7 +58,7 @@
58
58
  "react-dom": "^17.0.1"
59
59
  },
60
60
  "name": "@visns-studio/visns-components",
61
- "version": "4.5.2",
61
+ "version": "4.5.4",
62
62
  "description": "Various packages to assist in the development of our Custom Applications.",
63
63
  "main": "index.js",
64
64
  "scripts": {