Skip to content

Commit

Permalink
Thresholds not working in table #39
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello committed Apr 29, 2020
1 parent 1abcc84 commit 2a76b05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ OCA.Analytics.UI = {
},
};

thresholds = thresholds.filter(p => p.dimension1 === data['dimension1'] || p.dimension1 === '*');
thresholds = thresholds.filter(p => p.dimension1 === data[0] || p.dimension1 === '*');

for (let threshold of thresholds) {
const comparison = operators[threshold['option']](parseFloat(data['dimension3']), parseFloat(threshold['dimension3']));
const comparison = operators[threshold['option']](parseFloat(data[2]), parseFloat(threshold['dimension3']));
threshold['severity'] = parseInt(threshold['severity']);
if (comparison === true) {
if (threshold['severity'] === 2) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ThresholdMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function createThreshold($datasetId, $dimension1, $dimension3, $option, $

public function getThresholdsByDataset($datasetId)
{
$SQL = 'SELECT * FROM `*PREFIX*analytics_threshold` WHERE `dataset` = ?';
$SQL = 'SELECT `id`, `dimension1`, `dimension2`, `dimension3`, `option`, `severity` FROM `*PREFIX*analytics_threshold` WHERE `dataset` = ?';
//$this->logger->error($SQL);
$stmt = $this->db->prepare($SQL);
$stmt->execute(array($datasetId));
Expand Down

0 comments on commit 2a76b05

Please sign in to comment.