@visns-studio/visns-components 4.10.28 → 4.10.30

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.28",
80
+ "version": "4.10.30",
81
81
  "description": "Various packages to assist in the development of our Custom Applications.",
82
82
  "main": "src/index.js",
83
83
  "files": [
@@ -20,6 +20,15 @@ function Breadcrumb({ data, page }) {
20
20
  ? getNestedData(data, page.parentTitleKey)
21
21
  : null;
22
22
 
23
+ // Function to handle titleKey when it's a nested path like 'event_detail.name'
24
+ const getTitleData = (data, titleKey) => {
25
+ if (typeof titleKey === 'string' && titleKey.includes('.')) {
26
+ const keys = titleKey.split('.'); // Split the nested path by "."
27
+ return getNestedData(data, keys); // Use getNestedData to fetch the nested value
28
+ }
29
+ return data[titleKey]; // If not nested, return the direct data
30
+ };
31
+
23
32
  return (
24
33
  <h1>
25
34
  {page?.parentTitle && page?.parentUrl && (
@@ -57,7 +66,7 @@ function Breadcrumb({ data, page }) {
57
66
  // If titleKey is an array, iterate and display each nested value
58
67
  page.titleKey.map((key, index) => (
59
68
  <span key={index}>
60
- {data[key]}
69
+ {getTitleData(data, key)}
61
70
  {index < page.titleKey.length - 1 && ' '}
62
71
  </span>
63
72
  ))
@@ -65,10 +74,10 @@ function Breadcrumb({ data, page }) {
65
74
  // If titleKey is a single string, display the corresponding data
66
75
  <>
67
76
  {page.titleType === 'date'
68
- ? moment(data[page.titleKey]).format(
69
- 'DD-MM-YYYY'
70
- )
71
- : data[page.titleKey]}
77
+ ? moment(
78
+ getTitleData(data, page.titleKey)
79
+ ).format('DD-MM-YYYY')
80
+ : getTitleData(data, page.titleKey)}
72
81
  </>
73
82
  )}
74
83
  </>
@@ -982,6 +982,24 @@ function GenericDetail({
982
982
  </button>
983
983
  </div>
984
984
  )}
985
+
986
+ {activeTabConfig.export && (
987
+ <div className={styles.polActions}>
988
+ <button
989
+ className={styles.btn}
990
+ onClick={() =>
991
+ window.open
992
+ ? window.open(
993
+ `${activeTabConfig.export.url}/${routeParams[urlParam]}`,
994
+ '_blank'
995
+ )
996
+ : (window.location.href = `${activeTabConfig.export.url}/${routeParams[urlParam]}`)
997
+ }
998
+ >
999
+ Export
1000
+ </button>
1001
+ </div>
1002
+ )}
985
1003
  </>
986
1004
  );
987
1005
  case 'qrCode':