PC-966 When selecting a new report for a user to handle, always

prioritise reports assigned to teams that the user is a member of
This commit is contained in:
Keir Nellyer 2016-09-14 11:57:49 +01:00
parent 5ad4f2831d
commit 425d814ac4

View File

@ -71,7 +71,17 @@ public class ReportHandleCommand extends CommandBase<ReportPlugin>
for (Map.Entry<Report, Double> entry : reportPriorities.entrySet()) for (Map.Entry<Report, Double> entry : reportPriorities.entrySet())
{ {
if (mostImportant == null || entry.getValue() > mostImportant.getValue()) Report report = entry.getKey();
double priority = entry.getValue();
// reports assigned to user team are always prioritised
if (report.getAssignedTeam().isPresent())
{
mostImportant = entry;
break;
}
if (mostImportant == null || priority > mostImportant.getValue())
{ {
mostImportant = entry; mostImportant = entry;
} }