@visns-studio/visns-components 5.0.26 → 5.0.28

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.
package/package.json CHANGED
@@ -77,7 +77,7 @@
77
77
  "react-dom": "^17.0.0 || ^18.0.0"
78
78
  },
79
79
  "name": "@visns-studio/visns-components",
80
- "version": "5.0.26",
80
+ "version": "5.0.28",
81
81
  "description": "Various packages to assist in the development of our Custom Applications.",
82
82
  "main": "src/index.js",
83
83
  "files": [
@@ -285,10 +285,11 @@ function GenericDashboard({ setting }) {
285
285
  widget.props.keys = widgetData.keys;
286
286
  }
287
287
 
288
- const barData = widgetData.bar?.data || widgetData;
288
+ const barData =
289
+ widgetData.bar?.data || widgetData.data || widgetData;
289
290
 
290
291
  return (
291
- <div style={{ height: '600px' }}>
292
+ <div style={{ height: widget.height || '600px' }}>
292
293
  <ResponsiveBar data={barData} {...widget.props} />
293
294
  </div>
294
295
  );
@@ -1644,6 +1644,7 @@ function GenericDetail({
1644
1644
  dataId={routeParams[urlParam]}
1645
1645
  modalOpen={modalOpen}
1646
1646
  preloadedOptions={preloadedOptions}
1647
+ setData={setData}
1647
1648
  />
1648
1649
  );
1649
1650
  default:
@@ -1681,7 +1682,15 @@ function GenericDetail({
1681
1682
  const options = {};
1682
1683
  for (const column of ajaxColumns) {
1683
1684
  try {
1684
- const res = await CustomFetch(column.url, 'POST');
1685
+ let params = {};
1686
+
1687
+ if (column.fields) {
1688
+ params.fields = column.fields;
1689
+ }
1690
+
1691
+ const res = await CustomFetch(column.url, 'POST', {
1692
+ ...params,
1693
+ });
1685
1694
  options[column.id] = res.data.data || res.data || []; // Assume API returns options in the expected format
1686
1695
  } catch (error) {
1687
1696
  console.error(
@@ -18,6 +18,7 @@ const GenericEditableTable = ({
18
18
  dataId,
19
19
  modalOpen,
20
20
  preloadedOptions,
21
+ setData,
21
22
  }) => {
22
23
  const { columns, rows, form } = schedulingConfig;
23
24
 
@@ -42,7 +43,10 @@ const GenericEditableTable = ({
42
43
  updatedData
43
44
  );
44
45
  if (!res.error) {
45
- toast.success('Template updated successfully');
46
+ if (res.data?.data) {
47
+ setData(res.data.data);
48
+ }
49
+ // toast.success('Template updated successfully');
46
50
  } else {
47
51
  toast.error(res.error);
48
52
  }
@@ -157,20 +157,21 @@
157
157
  border-top: 1px solid transparent !important;
158
158
  border-left: 1px solid transparent !important;
159
159
  border-right: 1px solid transparent !important;
160
- border-bottom: 4px solid rgba(var(--primary-color-rgb), 0.9) !important;
160
+ border-bottom: 4px solid rgba(var(--secondary-rgb), 0.9) !important;
161
161
 
162
162
  h2 {
163
163
  color: var(--highlight-color) !important;
164
164
  }
165
165
 
166
166
  .widgetTitle {
167
- border-bottom: 1px dashed rgba(#dadce0, 0.15);
167
+ padding-bottom: 10px;
168
+ border-bottom: 1px solid rgba(var(--secondary-rgb), 0.5);
168
169
  }
169
170
  }
170
171
 
171
172
  .dashwidget--highlight {
172
- background: var(--primary-color) !important;
173
- border-bottom: 4px solid rgba(var(--primary-color-rgb), 0.85) !important;
173
+ background: var(--secondary-color) !important;
174
+ border-bottom: 4px solid rgba(var(--secondary-rgb), 0.85) !important;
174
175
  }
175
176
 
176
177
  .widgetNo {