versacall-dashboards-library-react 2.0.23 → 2.0.26
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.
|
@@ -70,31 +70,29 @@ function calculateDashboardVariables(variables, dashboardVariables) {
|
|
|
70
70
|
defaultValue: '0'
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
if (
|
|
73
|
+
if (dashboardProcessedVariable.type === 'formula') {
|
|
74
|
+
result.value = "".concat(dashboardProcessedVariable.formula);
|
|
75
|
+
result.defaultValue = "".concat(dashboardProcessedVariable.defaultValue);
|
|
76
|
+
result.format = _objectSpread({}, dashboardProcessedVariable.format); // result.numberOfDecimalPlaces = dashboardProcessedVariable.format.numberOfDecimalPlaces; // NOTE: Not necessary as it is part of format...
|
|
77
|
+
|
|
78
|
+
result.dependencies = findDependencies(result.value);
|
|
79
|
+
|
|
80
|
+
if (result.dependencies.includes(dashboardProcessedVariable.name)) {
|
|
81
|
+
result.value = result.defaultValue;
|
|
82
|
+
result.dependencies = [];
|
|
83
|
+
}
|
|
84
|
+
} else if (variableProcessed.result.type === 'error') {
|
|
74
85
|
result.value = variableProcessed.result.message;
|
|
75
86
|
} else if (dashboardProcessedVariable.format.type === 'text') {
|
|
76
87
|
result.value = variableProcessed.result.value;
|
|
77
88
|
} else if (dashboardProcessedVariable.format.type === 'number') {
|
|
78
|
-
|
|
79
|
-
result.value = "".concat(dashboardProcessedVariable.formula);
|
|
80
|
-
result.defaultValue = "".concat(dashboardProcessedVariable.defaultValue);
|
|
81
|
-
result.format = _objectSpread({}, dashboardProcessedVariable.format);
|
|
82
|
-
result.numberOfDecimalPlaces = dashboardProcessedVariable.format.numberOfDecimalPlaces;
|
|
83
|
-
result.dependencies = findDependencies(result.value);
|
|
84
|
-
|
|
85
|
-
if (result.dependencies.includes(dashboardProcessedVariable.name)) {
|
|
86
|
-
result.value = result.defaultValue;
|
|
87
|
-
result.dependencies = [];
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
var theNumber = Number(variableProcessed.result.type === 'vector' ? variableProcessed.result.calculated : variableProcessed.result.value);
|
|
89
|
+
var theNumber = Number(variableProcessed.result.type === 'vector' ? variableProcessed.result.calculated : variableProcessed.result.value);
|
|
91
90
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
result.value = "".concat(theNumber.toFixed(dashboardProcessedVariable.format.numberOfDecimalPlaces));
|
|
91
|
+
if (!(typeof theNumber === 'number' && theNumber !== Infinity)) {
|
|
92
|
+
theNumber = 0;
|
|
97
93
|
}
|
|
94
|
+
|
|
95
|
+
result.value = "".concat(theNumber.toFixed(dashboardProcessedVariable.format.numberOfDecimalPlaces));
|
|
98
96
|
} else if (dashboardProcessedVariable.format.type === 'timespan') {
|
|
99
97
|
var _theNumber = Number(variableProcessed.result.type === 'vector' ? variableProcessed.result.calculated : variableProcessed.result.value);
|
|
100
98
|
|
|
@@ -129,13 +127,13 @@ function calculateDashboardVariables(variables, dashboardVariables) {
|
|
|
129
127
|
theNumber = Number(variablesProcessed[i].defaultValue);
|
|
130
128
|
}
|
|
131
129
|
|
|
132
|
-
if (variablesProcessed[i].format
|
|
130
|
+
if (variablesProcessed[i].format.type === 'timespan') {
|
|
133
131
|
variablesProcessed[i].value = (0, _convertSecondsToElapsedTime.default)(theNumber, 'H:M:S');
|
|
134
132
|
} else {
|
|
135
|
-
variablesProcessed[i].value = "".concat(theNumber.toFixed(variablesProcessed[i].numberOfDecimalPlaces));
|
|
133
|
+
variablesProcessed[i].value = "".concat(theNumber.toFixed(variablesProcessed[i].format.numberOfDecimalPlaces));
|
|
136
134
|
}
|
|
137
135
|
} catch (error) {
|
|
138
|
-
variablesProcessed[i].value = "".concat(Number(variablesProcessed[i].defaultValue).toFixed(variablesProcessed[i].numberOfDecimalPlaces));
|
|
136
|
+
variablesProcessed[i].value = "".concat(Number(variablesProcessed[i].defaultValue).toFixed(variablesProcessed[i].format.numberOfDecimalPlaces));
|
|
139
137
|
}
|
|
140
138
|
}
|
|
141
139
|
}
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"versacall": {
|
|
3
3
|
"title": "Versacall Dashboards Library React",
|
|
4
4
|
"applicationType": "react-library",
|
|
5
|
-
"build":
|
|
5
|
+
"build": 26
|
|
6
6
|
},
|
|
7
7
|
"name": "versacall-dashboards-library-react",
|
|
8
|
-
"version": "2.0.
|
|
8
|
+
"version": "2.0.26",
|
|
9
9
|
"description": "Versacall Dashboards Library",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"module": "dist/index.js",
|