@visns-studio/visns-components 5.1.16 → 5.1.17
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.1.
|
|
80
|
+
"version": "5.1.17",
|
|
81
81
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
82
82
|
"main": "src/index.js",
|
|
83
83
|
"files": [
|
|
@@ -70,10 +70,6 @@ function GenericDashboard({ setting }) {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
// useEffect(() => {
|
|
74
|
-
// fetchData(filters); // Fetch initial data
|
|
75
|
-
// }, [setting]);
|
|
76
|
-
|
|
77
73
|
const openModal = (widgetId) => {
|
|
78
74
|
setModalContent(widgetId);
|
|
79
75
|
setModalShow(true);
|
|
@@ -163,10 +159,7 @@ function GenericDashboard({ setting }) {
|
|
|
163
159
|
}, [setting]);
|
|
164
160
|
|
|
165
161
|
useEffect(() => {
|
|
166
|
-
|
|
167
|
-
if (Object.keys(filters).length > 0) {
|
|
168
|
-
fetchData(filters);
|
|
169
|
-
}
|
|
162
|
+
fetchData(filters);
|
|
170
163
|
}, [filters]);
|
|
171
164
|
|
|
172
165
|
const renderFilters = (widget) => {
|
|
@@ -266,8 +259,34 @@ function GenericDashboard({ setting }) {
|
|
|
266
259
|
const renderWidget = (widget) => {
|
|
267
260
|
const widgetData = data[widget.id] || [];
|
|
268
261
|
|
|
269
|
-
if (
|
|
262
|
+
if (
|
|
263
|
+
widgetData.length > 0 ||
|
|
264
|
+
widgetData?.data?.length > 0 ||
|
|
265
|
+
widgetData
|
|
266
|
+
) {
|
|
270
267
|
switch (widget.type) {
|
|
268
|
+
case 'counter':
|
|
269
|
+
return (
|
|
270
|
+
<>
|
|
271
|
+
<div className={styles.widgetNo}>
|
|
272
|
+
<span>0</span>
|
|
273
|
+
</div>
|
|
274
|
+
<div className={styles.widgetLink}>
|
|
275
|
+
<button
|
|
276
|
+
className={
|
|
277
|
+
widget.highlight
|
|
278
|
+
? styles['btn-alt']
|
|
279
|
+
: styles.btn
|
|
280
|
+
}
|
|
281
|
+
onClick={() => {
|
|
282
|
+
navigate('/leads/follow-ups');
|
|
283
|
+
}}
|
|
284
|
+
>
|
|
285
|
+
View All
|
|
286
|
+
</button>
|
|
287
|
+
</div>
|
|
288
|
+
</>
|
|
289
|
+
);
|
|
271
290
|
case 'pie':
|
|
272
291
|
return (
|
|
273
292
|
<ResponsivePie data={widgetData} {...widget.props} />
|
|
@@ -332,8 +351,6 @@ function GenericDashboard({ setting }) {
|
|
|
332
351
|
const tableData = widgetData.data || widgetData;
|
|
333
352
|
const tableKeys = widgetData.keys || [];
|
|
334
353
|
|
|
335
|
-
console.info(tableKeys);
|
|
336
|
-
|
|
337
354
|
return (
|
|
338
355
|
<div className={styles['table-container']}>
|
|
339
356
|
{tableData.length > 0 ? (
|
|
@@ -170,8 +170,20 @@
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
.dashwidget--highlight {
|
|
173
|
-
background: var(--
|
|
174
|
-
border-
|
|
173
|
+
background: var(--primary-color) !important;
|
|
174
|
+
border-top: 1px solid transparent !important;
|
|
175
|
+
border-left: 1px solid transparent !important;
|
|
176
|
+
border-right: 1px solid transparent !important;
|
|
177
|
+
border-bottom: 2px solid rgba(var(--primary-rgb), 0.9) !important;
|
|
178
|
+
|
|
179
|
+
h2 {
|
|
180
|
+
color: var(--tertiary-color) !important;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.widgetTitle {
|
|
184
|
+
padding-bottom: 10px;
|
|
185
|
+
border-bottom: 2px solid rgba(var(--tertiary-rgb), 0.5);
|
|
186
|
+
}
|
|
175
187
|
}
|
|
176
188
|
|
|
177
189
|
.widgetNo {
|
|
@@ -200,12 +212,31 @@
|
|
|
200
212
|
display: block;
|
|
201
213
|
padding: 0.25em 3em;
|
|
202
214
|
background: none;
|
|
215
|
+
border-color: rgba(var(--tertiary-color-rgb), 0.05);
|
|
203
216
|
|
|
204
217
|
&:hover {
|
|
205
218
|
background: none;
|
|
206
219
|
color: var(--tertiary-color);
|
|
207
220
|
}
|
|
208
221
|
}
|
|
222
|
+
|
|
223
|
+
.btn-alt {
|
|
224
|
+
width: max-content;
|
|
225
|
+
margin: 0 auto;
|
|
226
|
+
display: block;
|
|
227
|
+
padding: 0.25em 3em;
|
|
228
|
+
background: #00294a;
|
|
229
|
+
border-color: rgba(var(--tertiary-color-rgb), 0.05);
|
|
230
|
+
color: #fff;
|
|
231
|
+
border-radius: 5px;
|
|
232
|
+
|
|
233
|
+
&:hover {
|
|
234
|
+
background: #00294a;
|
|
235
|
+
color: var(--tertiary-color);
|
|
236
|
+
border-color: rgba(var(--tertiary-color-rgb), 0.5);
|
|
237
|
+
color: #fff;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
209
240
|
}
|
|
210
241
|
|
|
211
242
|
.filter-container {
|