@visns-studio/visns-components 4.8.8 → 4.8.10

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.8.8",
78
+ "version": "4.8.10",
79
79
  "description": "Various packages to assist in the development of our Custom Applications.",
80
80
  "main": "src/index.js",
81
81
  "files": [
@@ -900,23 +900,19 @@ const DataGrid = forwardRef(
900
900
 
901
901
  const renderRowContextMenu = useCallback(
902
902
  (menuProps, { rowProps, cellProps }) => {
903
- if (
904
- cellProps.link &&
905
- cellProps.link.url &&
906
- cellProps.link.url !== ''
907
- ) {
903
+ const linkUrl = cellProps?.link?.url;
904
+
905
+ if (linkUrl) {
906
+ const baseUrl = window.location.origin;
907
+ const fullUrl = `${baseUrl}${linkUrl}${
908
+ rowProps.data[form.primaryKey]
909
+ }`;
910
+
908
911
  menuProps.autoDismiss = true;
909
912
  menuProps.items = [
910
913
  {
911
914
  label: 'Open Link in a New Tab',
912
- onClick: () => {
913
- window.open(
914
- `${cellProps.link.url}/${
915
- rowProps.data[form.primaryKey]
916
- }`,
917
- '_blank'
918
- );
919
- },
915
+ onClick: () => window.open(fullUrl, '_blank'),
920
916
  },
921
917
  ];
922
918
  }