@visns-studio/visns-components 5.0.27 → 5.0.29

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.27",
80
+ "version": "5.0.29",
81
81
  "description": "Various packages to assist in the development of our Custom Applications.",
82
82
  "main": "src/index.js",
83
83
  "files": [
@@ -70,9 +70,9 @@ function GenericDashboard({ setting }) {
70
70
  }
71
71
  };
72
72
 
73
- useEffect(() => {
74
- fetchData(filters); // Fetch initial data
75
- }, [setting]);
73
+ // useEffect(() => {
74
+ // fetchData(filters); // Fetch initial data
75
+ // }, [setting]);
76
76
 
77
77
  const openModal = (widgetId) => {
78
78
  setModalContent(widgetId);
@@ -165,6 +165,7 @@ function GenericDashboard({ setting }) {
165
165
  useEffect(() => {
166
166
  // Fetch data whenever filters are updated
167
167
  if (Object.keys(filters).length > 0) {
168
+ console.info(filters);
168
169
  fetchData(filters);
169
170
  }
170
171
  }, [filters]);
@@ -244,14 +245,6 @@ function GenericDashboard({ setting }) {
244
245
  }
245
246
  })}
246
247
  <div className={styles['filter-actions']}>
247
- {/* <button
248
- className={`${styles.btn} ${styles['btn-primary']}`}
249
- onClick={() => {
250
- fetchData(filters); // Trigger fetchData with the current filters
251
- }}
252
- >
253
- Apply Filters
254
- </button> */}
255
248
  <button
256
249
  className={`${styles.btn} ${styles['btn-secondary']}`}
257
250
  onClick={() => {
@@ -285,10 +278,11 @@ function GenericDashboard({ setting }) {
285
278
  widget.props.keys = widgetData.keys;
286
279
  }
287
280
 
288
- const barData = widgetData.bar?.data || widgetData;
281
+ const barData =
282
+ widgetData.bar?.data || widgetData.data || widgetData;
289
283
 
290
284
  return (
291
- <div style={{ height: '600px' }}>
285
+ <div style={{ height: widget.height || '600px' }}>
292
286
  <ResponsiveBar data={barData} {...widget.props} />
293
287
  </div>
294
288
  );
@@ -1682,7 +1682,15 @@ function GenericDetail({
1682
1682
  const options = {};
1683
1683
  for (const column of ajaxColumns) {
1684
1684
  try {
1685
- 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
+ });
1686
1694
  options[column.id] = res.data.data || res.data || []; // Assume API returns options in the expected format
1687
1695
  } catch (error) {
1688
1696
  console.error(
@@ -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 {