@visns-studio/visns-components 4.6.4 → 4.6.6

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.
@@ -128,6 +128,7 @@ const DataGrid = forwardRef(
128
128
  setRowsSelected,
129
129
  style,
130
130
  tableSetting,
131
+ userProfile = null,
131
132
  },
132
133
  ref
133
134
  ) => {
@@ -2343,6 +2344,20 @@ const DataGrid = forwardRef(
2343
2344
  filterName += column.nameFrom;
2344
2345
  }
2345
2346
 
2347
+ let filterValue = '';
2348
+
2349
+ if (column.filter.hasOwnProperty('value')) {
2350
+ if (
2351
+ column.filter.value === '' &&
2352
+ column.filter.param === 'profileId' &&
2353
+ userProfile?.id
2354
+ ) {
2355
+ filterValue = userProfile.id;
2356
+ } else {
2357
+ filterValue = column.filter.value;
2358
+ }
2359
+ }
2360
+
2346
2361
  return {
2347
2362
  key: column.filter.key
2348
2363
  ? column.filter.key
@@ -2350,9 +2365,7 @@ const DataGrid = forwardRef(
2350
2365
  name: filterName,
2351
2366
  operator: column.filter.operator,
2352
2367
  type: column.filter.type,
2353
- value: column.filter.value
2354
- ? column.filter.value
2355
- : '',
2368
+ value: filterValue,
2356
2369
  reset: column.filter.reset
2357
2370
  ? column.filter.reset
2358
2371
  : [],
@@ -385,15 +385,18 @@ const GenericDynamic = ({
385
385
  });
386
386
  }
387
387
 
388
- const res = await CustomFetch(setting.add, 'POST', {
389
- client_id: data.id,
390
- form_name: type,
391
- });
392
- if (res.data.error === '') {
393
- if (showToast) {
394
- toast.success('Form added successfully');
388
+ if (setting.add) {
389
+ const res = await CustomFetch(setting.add, 'POST', {
390
+ client_id: data.id,
391
+ form_name: type,
392
+ });
393
+
394
+ if (res.data.error === '') {
395
+ if (showToast) {
396
+ toast.success('Form added successfully');
397
+ }
398
+ fetchData();
395
399
  }
396
- fetchData();
397
400
  }
398
401
  } catch (err) {
399
402
  console.error(err);
@@ -222,6 +222,7 @@ function GenericIndex({ layout = 'full', setting, userProfile }) {
222
222
  setConfig={setConfig}
223
223
  setTotal={setTotal}
224
224
  style={userProfile?.settings?.style || {}}
225
+ userProfile={userProfile}
225
226
  />
226
227
  ) : null,
227
228
  [config, windowHeight, userProfile, setConfig, setTotal]
@@ -168,7 +168,7 @@
168
168
 
169
169
  .app-nav .nav-item > ul li a {
170
170
  background: rgba(var(--primary-color-rgb), 0.9);
171
- color: var(--tertiary-color);
171
+ color: var(--tertiary-color) !important;
172
172
  }
173
173
 
174
174
  .app-nav .nav-item-alternate > ul li a {
package/package.json CHANGED
@@ -58,7 +58,7 @@
58
58
  "react-dom": "^17.0.1"
59
59
  },
60
60
  "name": "@visns-studio/visns-components",
61
- "version": "4.6.4",
61
+ "version": "4.6.6",
62
62
  "description": "Various packages to assist in the development of our Custom Applications.",
63
63
  "main": "index.js",
64
64
  "scripts": {