@visns-studio/visns-components 1.7.5 → 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
  );
@@ -388,7 +386,11 @@ const DataGrid = forwardRef(
388
386
  className="btn"
389
387
  onClick={() => {
390
388
  if (form.create) {
391
- modalOpen("create", 0);
389
+ if (form.create.url) {
390
+ navigate(form.create.url);
391
+ } else {
392
+ modalOpen("create", 0);
393
+ }
392
394
  } else {
393
395
  if (form.url) {
394
396
  window.open(
@@ -449,7 +449,17 @@ function Form(props) {
449
449
  });
450
450
  }
451
451
 
452
- if (fileUpload === true && formData[fileKey] !== null) {
452
+ console.info(
453
+ fileUpload,
454
+ formData[fileKey],
455
+ formData[fileKey] instanceof File
456
+ );
457
+
458
+ if (
459
+ fileUpload === true &&
460
+ formData[fileKey] !== null &&
461
+ formData[fileKey] instanceof File
462
+ ) {
453
463
  Vapor.store(formData[fileKey], {
454
464
  progress: (progress) => {
455
465
  setUploadProgress(progress * 100);
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.5",
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": {