Skip to content

Commit

Permalink
fix faulty recurse parsing for reports #980 (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgershman authored Mar 23, 2024
1 parent f1050d1 commit 512e168
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 83 deletions.
4 changes: 4 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

### 4.3.3 (UNRELEASED)
* Fix for reports where they are always recursing service bodies regardless of the setting [#980]
* Fix for metrics counts summaries.

### 4.3.2 (March 21, 2024)
* Fixes some admin logins for BMLT users with special characters. [#973]
* Fixes validation for when there is no phone number set for volunteers on the Admin interface. [#975]
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/V1/Admin/CdrController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function index(Request $request): JsonResponse
$request->get('service_body_id'),
$request->get('date_range_start'),
$request->get('date_range_end'),
$request->get('recurse')
filter_var($request->get('recurse'), FILTER_VALIDATE_BOOLEAN)
))->header("Content-Type", "application/json");
}
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/V1/Admin/MapMetricController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function index(Request $request)
$eventId,
$request->get("date_range_start"),
$request->get("date_range_end"),
$request->get("recurse")
filter_var($request->get("recurse"), FILTER_VALIDATE_BOOLEAN)
);

return response($data)
Expand All @@ -40,7 +40,7 @@ public function index(Request $request)
$request->get("service_body_id"),
$request->get("date_range_start"),
$request->get("date_range_end"),
$request->get("recurse")
filter_var($request->get("recurse"), FILTER_VALIDATE_BOOLEAN)
);

return response()->json($data)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/V1/Admin/MetricController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function index(Request $request): JsonResponse
$request->get("service_body_id"),
$request->get("date_range_start"),
$request->get("date_range_end"),
$request->get("recurse")
filter_var($request->get("recurse"), FILTER_VALIDATE_BOOLEAN)
);

return response()->json($data)
Expand Down
2 changes: 1 addition & 1 deletion app/Services/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class SettingsService
{
private string $version = "4.3.2";
private string $version = "4.3.3";
private array $allowlist = [
'announce_servicebody_volunteer_routing' => ['description' => '/helpline/announce_servicebody_volunteer_routing' , 'default' => false, 'overridable' => true, 'hidden' => false],
'blocklist' => ['description' => '/general/blocklist' , 'default' => '', 'overridable' => true, 'hidden' => false],
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 65 additions & 65 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"bootstrap": "^4.6.2",
"dark-mode-switch": "^1.0.0",
"daterangepicker": "^3.1.0",
"jquery": "~3.4.1",
"jquery": "~3.7.1",
"jquery-ui-dist": "^1.13.2",
"jquery-ui-touch-punch": "^0.2.3",
"jquery-validation": "^1.19.5",
Expand Down
10 changes: 5 additions & 5 deletions public/src/js/yap-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function getMetricsData()
var actions = ['Volunteer (CALL)', 'Meetings (CALL)', 'Just For Today (CALL)', 'Volunteer (SMS)', 'Meetings (SMS)', 'Just For Today (SMS)'];
var actions_plots = [1, 2, 3, 19, 20, 21];
var plots = {"1": [], "2": [], "3": [], "19": [], "20": [], "21": []};
for (var item of data['metrics']) {
for (let item of data['metrics']) {
plots[JSON.parse(item['data'])['searchType']].push({
'x': item['timestamp'],
'y': item['counts']
Expand All @@ -184,19 +184,19 @@ function getMetricsData()
$("#summary-volunteer-sms").html("0");

for (var item of data['summary']) {
if (item['event_id'] === "2") {
if (item['event_id'] === 2) {
$("#summary-meetingsearch-calls").html(item['counts'])
} else if (item['event_id'] === "19") {
} else if (item['event_id'] === 19) {
$("#summary-meetingsearch-sms").html(item['counts'])
} else if (item['event_id'] === "20") {
} else if (item['event_id'] === 20) {
$("#summary-volunteer-sms").html(item['counts'])
}
}

var totalCalls = data['calls'].length;
var missedCalls = 0;
$("#summary-volunteer-calls").html(totalCalls)
for (var item of data['calls']) {
for (let item of data['calls']) {
var answeredCount = parseInt(item['answered_count']);
var missedCount = parseInt(item['missed_count']);
if (answeredCount === 0 && missedCount > 0) {
Expand Down
Loading

0 comments on commit 512e168

Please sign in to comment.