@visns-studio/visns-components 3.2.1 → 3.2.3

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.
@@ -611,6 +611,7 @@ const DataGrid = forwardRef(
611
611
 
612
612
  const res = await Download(form.export.url, 'POST', {
613
613
  filter: filterValue,
614
+ paramId: paramValue || '',
614
615
  });
615
616
 
616
617
  if (res.data.error) {
@@ -668,7 +669,7 @@ const DataGrid = forwardRef(
668
669
  {(form.create &&
669
670
  form.create.title &&
670
671
  form.create.title !== '') ||
671
- form.url ? (
672
+ (form.url && form.create.title) ? (
672
673
  <button
673
674
  className="btn"
674
675
  onClick={(e) => {
@@ -193,10 +193,21 @@ function Navigation({
193
193
  );
194
194
  };
195
195
 
196
+ const getFirstRolePermissions = () => {
197
+ if (
198
+ userProfile.roles &&
199
+ userProfile.roles.length > 0 &&
200
+ userProfile.roles[0].permissions.length > 0
201
+ ) {
202
+ return userProfile.roles[0].permissions.map(
203
+ (permission) => permission.name
204
+ );
205
+ }
206
+ return [];
207
+ };
208
+
196
209
  useEffect(() => {
197
- const permissions = userProfile.roles[0].permissions.map(
198
- (permission) => permission.name
199
- );
210
+ const permissions = getFirstRolePermissions();
200
211
 
201
212
  setNavData((prevNavData) => {
202
213
  const updatePermissions = (nav) => {
package/package.json CHANGED
@@ -49,7 +49,7 @@
49
49
  "react-dom": "^17.0.1"
50
50
  },
51
51
  "name": "@visns-studio/visns-components",
52
- "version": "3.2.1",
52
+ "version": "3.2.3",
53
53
  "description": "Various packages to assist in the development of our Custom Applications.",
54
54
  "main": "index.js",
55
55
  "scripts": {