Skip to content

Commit 298b09b

Browse files
authored
Merge pull request #249 from Resgrid/develop
CU-868frm4jk Removing v3 api, minor fixes.
2 parents 4e54b00 + 34ff56b commit 298b09b

49 files changed

Lines changed: 517 additions & 12183 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Core/Resgrid.Services/AuthorizationService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ public async Task<bool> CanUserViewUserAsync(string viewerUserId, string targetU
335335
var department = await _departmentsService.GetDepartmentByUserIdAsync(viewerUserId);
336336
var department1 = await _departmentsService.GetDepartmentByUserIdAsync(targetUserId);
337337

338+
if (department == null || department1 == null)
339+
return false;
340+
338341
if (department.DepartmentId != department1.DepartmentId)
339342
return false;
340343

Core/Resgrid.Services/CallEmailTemplates/ResgridEmailTemplate.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System.Diagnostics.Eventing.Reader;
45
using System.Linq;
56
using System.Text;
67
using System.Threading.Tasks;
@@ -57,8 +58,25 @@ public async Task<Call> GenerateCall(CallEmail email, string managingUser, List<
5758
c.MapPage = data[4];
5859

5960
c.NatureOfCall = data[5];
60-
c.Address = data[3];
6161

62+
if (!string.IsNullOrEmpty(data[3]))
63+
{
64+
c.Address = data[3];
65+
66+
try
67+
{
68+
var address = await geolocationProvider.GetLatLonFromAddress(c.Address);
69+
70+
71+
if (address != null)
72+
c.GeoLocationData = address;
73+
}
74+
catch (Exception ex)
75+
{
76+
Resgrid.Framework.Logging.LogException( ex,
77+
$"Failed to geocode address '{c.Address}' for email {email.MessageId}");
78+
}
79+
}
6280
StringBuilder title = new StringBuilder();
6381

6482
title.Append("Email Call ");

Core/Resgrid.Services/ShiftsService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,10 @@ public async Task<Dictionary<int, Dictionary<int, int>>> GetShiftDayNeedsObjAsyn
488488
}
489489
}
490490

491-
shiftGroups.Add(group.DepartmentGroupId, roleRequirements);
491+
if (shiftGroups.ContainsKey(group.DepartmentGroupId))
492+
shiftGroups[group.DepartmentGroupId] = roleRequirements;
493+
else
494+
shiftGroups.Add(group.DepartmentGroupId, roleRequirements);
492495
}
493496
}
494497

Web/Resgrid.Web.Services/Controllers/v3/AuthController.cs

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)