@visns-studio/visns-components 4.1.3 → 4.1.4

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.
@@ -468,6 +468,29 @@ function Form({
468
468
  }
469
469
  };
470
470
 
471
+ const handleSort = async (e) => {
472
+ try {
473
+ if (e) {
474
+ e.preventDefault();
475
+ }
476
+
477
+ const url = formSettings.sortButton.url;
478
+ const method = 'POST';
479
+
480
+ const res = await CustomFetch(url, method, {
481
+ id: formData[formSettings.primaryKey],
482
+ });
483
+
484
+ if (res.data.error === '') {
485
+ toast.success('Files successfully sorted by name.');
486
+
487
+ fetchData();
488
+ }
489
+ } catch (err) {
490
+ console.info(err);
491
+ }
492
+ };
493
+
471
494
  const handleSubmit = async (e) => {
472
495
  try {
473
496
  if (e) {
@@ -1255,8 +1278,14 @@ function Form({
1255
1278
  </button>
1256
1279
  )}
1257
1280
 
1258
- {formSettings.hasOwnProperty('disableSave') &&
1259
- formSettings.disableSave === true ? null : (
1281
+ {formSettings.hasOwnProperty('sortButton') &&
1282
+ formSettings.sortButton.url ? (
1283
+ <button className="btn" onClick={handleSort}>
1284
+ {formSettings.sortButton.label
1285
+ ? formSettings.sortButton.label
1286
+ : 'Sort'}
1287
+ </button>
1288
+ ) : (
1260
1289
  <button className="btn" onClick={handleSubmit}>
1261
1290
  {formSettings?.save?.button?.label
1262
1291
  ? formSettings.save.button.label
@@ -41,7 +41,7 @@
41
41
  }
42
42
 
43
43
  .link:hover {
44
- background: var(--item-color) !important;
44
+ background: var(--primary-color) !important;
45
45
  }
46
46
 
47
47
  .activetab button {
package/package.json CHANGED
@@ -57,7 +57,7 @@
57
57
  "react-dom": "^17.0.1"
58
58
  },
59
59
  "name": "@visns-studio/visns-components",
60
- "version": "4.1.3",
60
+ "version": "4.1.4",
61
61
  "description": "Various packages to assist in the development of our Custom Applications.",
62
62
  "main": "index.js",
63
63
  "scripts": {