@visns-studio/visns-components 2.7.3 → 2.7.5

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.
@@ -372,20 +372,22 @@ const DataGrid = forwardRef(
372
372
  };
373
373
 
374
374
  const handleSort = (value) => {
375
- setConfig((prevState) => {
376
- const { id, dir } = value || {}; // Destructure id and dir from value (if provided)
377
- const sortBy = id || null;
378
- const sort = dir === 1 ? 'asc' : dir === -1 ? 'desc' : null;
379
-
380
- return {
381
- ...prevState,
382
- ajaxSetting: {
383
- ...prevState.ajaxSetting,
384
- sortBy,
385
- sort,
386
- },
387
- };
388
- });
375
+ if ( setConfig ) {
376
+ setConfig((prevState) => {
377
+ const { id, dir } = value || {}; // Destructure id and dir from value (if provided)
378
+ const sortBy = id || null;
379
+ const sort = dir === 1 ? 'asc' : dir === -1 ? 'desc' : null;
380
+
381
+ return {
382
+ ...prevState,
383
+ ajaxSetting: {
384
+ ...prevState.ajaxSetting,
385
+ sortBy,
386
+ sort,
387
+ },
388
+ };
389
+ });
390
+ }
389
391
  };
390
392
 
391
393
  const onRowClick = useCallback((rowProps, event) => {
@@ -53,6 +53,7 @@ function GenericDetail({ setting, urlParam, userProfile }) {
53
53
  setActiveStage(stage.id);
54
54
  } else {
55
55
  if (
56
+ activeTabConfig.stages &&
56
57
  activeTabConfig.stages.url &&
57
58
  activeTabConfig.stages.url !== '' &&
58
59
  activeTabConfig.stages.key &&
@@ -772,7 +773,7 @@ function GenericDetail({ setting, urlParam, userProfile }) {
772
773
  if (activeTab) {
773
774
  const activeTabConfig = tabs.find((t) => t.id === activeTab.id);
774
775
 
775
- if (activeTabConfig.stages && activeTabConfig.stages.key) {
776
+ if (activeTabConfig?.stages?.key) {
776
777
  setActiveStage(data[activeTabConfig.stages.key]);
777
778
  }
778
779
  }
package/package.json CHANGED
@@ -44,7 +44,7 @@
44
44
  "react-dom": "^17.0.1"
45
45
  },
46
46
  "name": "@visns-studio/visns-components",
47
- "version": "2.7.3",
47
+ "version": "2.7.5",
48
48
  "description": "Various packages to assist in the development of our Custom Applications.",
49
49
  "main": "index.js",
50
50
  "scripts": {