@visns-studio/visns-components 4.10.27 → 4.10.29

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.27",
80
+ "version": "4.10.29",
81
81
  "description": "Various packages to assist in the development of our Custom Applications.",
82
82
  "main": "src/index.js",
83
83
  "files": [
@@ -6,7 +6,6 @@ import moment from 'moment';
6
6
  function Breadcrumb({ data, page }) {
7
7
  // Function to get nested data, handling array of keys
8
8
  const getNestedData = (data, keys) => {
9
- console.info(page);
10
9
  return Array.isArray(keys)
11
10
  ? keys.reduce(
12
11
  (acc, key) => (acc && acc[key] ? acc[key] : null),
@@ -304,12 +304,16 @@ function GenericDetail({
304
304
 
305
305
  const renderDateTime = () => formatDateTimeValue(value);
306
306
 
307
- const renderFile = () =>
308
- value ? (
309
- <a href={value} target="_blank">
307
+ const renderFile = () => {
308
+ // Check if value is a non-empty string and looks like a valid URL (optional)
309
+ const isValidUrl = value && value.startsWith('http');
310
+
311
+ return isValidUrl ? (
312
+ <a href={value} target="_blank" rel="noopener noreferrer">
310
313
  Download
311
314
  </a>
312
315
  ) : null;
316
+ };
313
317
 
314
318
  const renderExist = () => (truncatedValue ? 'Yes' : 'No');
315
319
 
@@ -978,6 +982,24 @@ function GenericDetail({
978
982
  </button>
979
983
  </div>
980
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
+ )}
981
1003
  </>
982
1004
  );
983
1005
  case 'qrCode':