@visns-studio/visns-components 4.1.3 → 4.1.5

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,14 +1278,20 @@ function Form({
1255
1278
  </button>
1256
1279
  )}
1257
1280
 
1258
- {formSettings.hasOwnProperty('disableSave') &&
1259
- formSettings.disableSave === true ? null : (
1260
- <button className="btn" onClick={handleSubmit}>
1261
- {formSettings?.save?.button?.label
1262
- ? formSettings.save.button.label
1263
- : 'Save'}
1281
+ {formSettings.hasOwnProperty('sortButton') &&
1282
+ formSettings.sortButton.url ? (
1283
+ <button className="btn" onClick={handleSort}>
1284
+ {formSettings.sortButton.label
1285
+ ? formSettings.sortButton.label
1286
+ : 'Sort'}
1264
1287
  </button>
1265
- )}
1288
+ ) : null}
1289
+
1290
+ <button className="btn" onClick={handleSubmit}>
1291
+ {formSettings?.save?.button?.label
1292
+ ? formSettings.save.button.label
1293
+ : 'Save'}
1294
+ </button>
1266
1295
  </div>
1267
1296
  </div>
1268
1297
  );
@@ -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.5",
61
61
  "description": "Various packages to assist in the development of our Custom Applications.",
62
62
  "main": "index.js",
63
63
  "scripts": {