versacall-core-library-react 2.0.44 → 2.0.45

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.
@@ -93,6 +93,26 @@ var style = {
93
93
  }
94
94
  };
95
95
 
96
+ var consolidateTags = function consolidateTags(tagList) {
97
+ var newTagList = [];
98
+ tagList.forEach(function (tagInfo) {
99
+ var existing = newTagList.find(function (x) {
100
+ return x.tag === tagInfo.tag;
101
+ });
102
+
103
+ if (existing) {
104
+ existing.count += tagInfo.count;
105
+ } else {
106
+ newTagList.push({
107
+ tag: tagInfo.tag,
108
+ type: tagInfo.type,
109
+ count: tagInfo.count
110
+ });
111
+ }
112
+ });
113
+ return newTagList;
114
+ };
115
+
96
116
  function TagFilterBuilder(props) {
97
117
  var _useState = (0, _react.useState)(''),
98
118
  _useState2 = _slicedToArray(_useState, 2),
@@ -269,9 +289,9 @@ function TagFilterBuilder(props) {
269
289
  var columns = 0;
270
290
  if (showModules) columns++;
271
291
  if (showMonitoringPoints) columns++; // Add any tags that aren't on the supplied list to the supplied list. This is needed in case we reference tags that have been deleted/etc.
292
+ // const adjustedModuleTags = [...tags.moduleTags];
272
293
 
273
- var adjustedModuleTags = _toConsumableArray(tags.moduleTags);
274
-
294
+ var adjustedModuleTags = consolidateTags(tags.moduleTags);
275
295
  filter.moduleTagFilters.forEach(function (x) {
276
296
  if (!adjustedModuleTags.find(function (tagInfo) {
277
297
  return tagInfo.tag === x;
@@ -281,10 +301,9 @@ function TagFilterBuilder(props) {
281
301
  count: 0
282
302
  });
283
303
  }
284
- });
285
-
286
- var adjustedLocationTags = _toConsumableArray(tags.locationTags);
304
+ }); // const adjustedLocationTags = [...tags.locationTags];
287
305
 
306
+ var adjustedLocationTags = consolidateTags(tags.locationTags);
288
307
  filter.moduleLocationFilters.forEach(function (x) {
289
308
  if (!adjustedLocationTags.find(function (tagInfo) {
290
309
  return tagInfo.tag === x;
@@ -294,10 +313,9 @@ function TagFilterBuilder(props) {
294
313
  count: 0
295
314
  });
296
315
  }
297
- });
298
-
299
- var adjustedMonitoringPointTags = _toConsumableArray(tags.monitoringPointTags);
316
+ }); // const adjustedMonitoringPointTags = [...tags.monitoringPointTags];
300
317
 
318
+ var adjustedMonitoringPointTags = consolidateTags(tags.monitoringPointTags);
301
319
  filter.monitoringPointTagFilters.forEach(function (x) {
302
320
  if (!adjustedMonitoringPointTags.find(function (tagInfo) {
303
321
  return tagInfo.tag === x;
@@ -307,10 +325,9 @@ function TagFilterBuilder(props) {
307
325
  count: 0
308
326
  });
309
327
  }
310
- });
311
-
312
- var adjustedMonitoringPointTypes = _toConsumableArray(tags.typeTags);
328
+ }); // const adjustedMonitoringPointTypes = [...tags.typeTags];
313
329
 
330
+ var adjustedMonitoringPointTypes = consolidateTags(tags.typeTags);
314
331
  filter.monitoringPointTypeFilters.forEach(function (x) {
315
332
  if (!adjustedMonitoringPointTypes.find(function (tagInfo) {
316
333
  return tagInfo.tag === x;
@@ -337,7 +354,11 @@ function TagFilterBuilder(props) {
337
354
  }) : _toConsumableArray(adjustedMonitoringPointTags);
338
355
  var filteredTypeTags = search.length > 0 ? adjustedMonitoringPointTypes.filter(function (x) {
339
356
  return x.tag.includes(search);
340
- }) : _toConsumableArray(adjustedMonitoringPointTypes); // Sort by highest quantities of tags
357
+ }) : _toConsumableArray(adjustedMonitoringPointTypes); // const filteredModuleTags = adjustedModuleTags;
358
+ // const filteredLocationTags = adjustedLocationTags;
359
+ // const filteredMonitoringPointTags = adjustedMonitoringPointTags;
360
+ // const filteredTypeTags = adjustedMonitoringPointTypes;
361
+ // Sort by highest quantities of tags
341
362
 
342
363
  filteredModuleTags.sort(function (a, b) {
343
364
  return b.count - a.count;
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "versacall": {
3
3
  "title": "Versacall Core Library React",
4
4
  "applicationType": "react-library",
5
- "build": 44
5
+ "build": 45
6
6
  },
7
7
  "name": "versacall-core-library-react",
8
- "version": "2.0.44",
8
+ "version": "2.0.45",
9
9
  "description": "Versacall Core Library",
10
10
  "main": "dist/index.js",
11
11
  "module": "dist/index.js",