Skip to content

Commit

Permalink
adding line manager to reporting export api & 180 day reports so LM's… (
Browse files Browse the repository at this point in the history
#148)

* adding line manager to reporting export api & 180 day reports so LM's can filter and see just their reports points

* added a parameter so we can avoid ldap calls if we want
  • Loading branch information
matallen authored Apr 30, 2022
1 parent e9fb1e6 commit ec9a278
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/redhat/sso/ninja/Heartbeat2.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ public void publishGraphsData(Database2 db, Config config){

// add the Events to the graphs so they're available externally
try{
// Map<String,String> filters=;
String events=(String)ec.getEventsV2(new MapBuilder<String,String>()
.put("events","User Promotion,Points Increment")
.put("daysOld", "180")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -50,6 +49,7 @@ public Response getEventsV2(@Context HttpServletRequest request) throws JsonGene
.put("events", request.getParameter("events"))
.put("daysOld", request.getParameter("daysOld"))
.put("asCSV", request.getParameter("asCSV"))
.put("includeLM", request.getParameter("includeLM"))
.build();
return Response.status(200)
.header("Access-Control-Allow-Origin", "*")
Expand Down Expand Up @@ -246,7 +246,7 @@ private List<Map<String, String>> getFilteredEvents2(Map<String,String> filters)
}

try{
if (!ldapDown){
if (!ldapDown && StringUtils.isNotBlank(filters.get("includeLM"))){
String kerberos=v.get("user");
if (StringUtils.isNotBlank(kerberos)){
List<User> ldapResult=userService.search("uid", kerberos);
Expand All @@ -265,7 +265,7 @@ private List<Map<String, String>> getFilteredEvents2(Map<String,String> filters)

}
// userService.printCacheStats();
System.out.println("results.size="+result.size());
// System.out.println("results.size="+result.size());
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class EventsControllerTest{
public void testGetEventsV2_30DaysOld() throws Exception{

long s=System.currentTimeMillis();
new EventsController().getEventsV2(new MapBuilder<String,String>().put("daysOld","30").build());
new EventsController().getEventsV2(new MapBuilder<String,String>().put("daysOld","30").put("includeLM","true").build());
// System.out.println(
//new ExportController().exportEvents(null, "csv")
// );
Expand Down

0 comments on commit ec9a278

Please sign in to comment.