@isoftdata/utility-dashboard-backend 1.5.2 → 1.5.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.
Files changed (2) hide show
  1. package/index.js +10 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -36,7 +36,15 @@ const handleChartTypeSpecificQuirks = (chartType, resultSet) => {
36
36
  }
37
37
 
38
38
  const loadChartData = async(mysqlConnection, { name, query: queryObject, formatting, chartWrapper, multiSeries, table, parameters, supertype, ...theRest }) => { // needs database connection
39
- const { dataTable, processedFormatting } = await loadDataTableAndProcessedFormatting(mysqlConnection, { query: queryObject, multiSeries, formatting, chartType: chartWrapper?.chartType || supertype })
39
+ if(!chartWrapper){
40
+ chartWrapper = {
41
+ chartType: supertype,
42
+ options: {
43
+ height: 450, width: 800
44
+ }
45
+ }
46
+ }
47
+ const { dataTable, processedFormatting } = await loadDataTableAndProcessedFormatting(mysqlConnection, { query: queryObject, multiSeries, formatting, chartType: chartWrapper?.chartType })
40
48
 
41
49
  if (chartWrapper?.chartType === 'Table') {
42
50
  return {
@@ -75,7 +83,7 @@ const loadDataTableAndProcessedFormatting = async(mysqlConnection, { query: quer
75
83
 
76
84
  const processedFormatting = handleFormattingTemplates(formatting)
77
85
 
78
- if (chartType.toLowerCase() === 'table') {
86
+ if (chartType?.toLowerCase() === 'table') {
79
87
  return { dataTable: getRactiveTableDataFormat(data, fields, processedFormatting), processedFormatting }
80
88
  }
81
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/utility-dashboard-backend",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "A utility for formatting chart and report data to be usable by the frontend dashboard component.",
5
5
  "main": "index.js",
6
6
  "scripts": {