@visns-studio/visns-components 1.7.6 → 1.7.7

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.
@@ -327,35 +327,33 @@ const DataGrid = forwardRef(
327
327
  ).indexOf(cellElement);
328
328
 
329
329
  if (columnIndex === rowProps.columns.length - 1) {
330
+ // Handle last column click
330
331
  } else {
331
- if (
332
- rowProps.columns[columnIndex].link &&
333
- rowProps.columns[columnIndex].link.url
334
- ) {
335
- if (rowProps.columns[columnIndex].link.folder) {
336
- window.location.href =
337
- rowProps.columns[columnIndex].link.url +
338
- rowProps.data[
339
- rowProps.columns[columnIndex].link.key
340
- ] +
341
- "/" +
332
+ const column = rowProps.columns[columnIndex];
333
+
334
+ if (column.link && column.link.url) {
335
+ const fileRelationArray = column.id.split(".");
336
+ const linkUrl = column.link.url;
337
+ const linkKey = rowProps.columns[columnIndex].link.key;
338
+ const rowData = rowProps.data[linkKey];
339
+
340
+ if (column.link.folder) {
341
+ const linkFolder =
342
342
  rowProps.columns[columnIndex].link.folder;
343
+
344
+ if (rowProps.data[fileRelationArray[0]]) {
345
+ window.location.href = `${linkUrl}${rowData}/${linkFolder}`;
346
+ }
343
347
  } else {
344
- navigate(
345
- `${rowProps.columns[columnIndex].link.url}${
346
- rowProps.data[
347
- rowProps.columns[columnIndex].link.key
348
- ]
349
- }`
350
- );
348
+ navigate(`${linkUrl}${rowData}`);
351
349
  }
352
- } else if (rowProps.columns[columnIndex].link.popup) {
350
+ } else if (column.link && column.link.popup) {
351
+ const linkPopup = column.link.popup;
352
+ const linkKey = rowProps.columns[columnIndex].link.key;
353
+ const rowData = rowProps.data[linkKey];
354
+
353
355
  window.open(
354
- `${rowProps.columns[columnIndex].link.popup}/${
355
- rowProps.data[
356
- rowProps.columns[columnIndex].link.key
357
- ]
358
- }`,
356
+ `${linkPopup}/${rowData}`,
359
357
  "",
360
358
  "width=1440,height=1024,menubar=1,resizable=1,status=1,titlebar=1,toolbar=1"
361
359
  );
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "react-dom": "^17.0.1"
35
35
  },
36
36
  "name": "@visns-studio/visns-components",
37
- "version": "1.7.6",
37
+ "version": "1.7.7",
38
38
  "description": "Various packages to assist in the development of our Custom Applications.",
39
39
  "main": "index.js",
40
40
  "scripts": {