Skip to content

Commit

Permalink
Added events loaded count for filtered members also
Browse files Browse the repository at this point in the history
  • Loading branch information
jackb-dropbox committed Jun 8, 2017
1 parent 433c935 commit f49249c
Showing 1 changed file with 47 additions and 23 deletions.
70 changes: 47 additions & 23 deletions Source/DfBAdminToolkit/Presenter/TeamAuditingPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ private void GetEvents(ITeamAuditingModel model, ITeamAuditingView view, IMainPr
}
dynamic actorType = null;
string actorTypeString = string.Empty;
dynamic emailObj = null;
string email = string.Empty;
if (events["actor"][".tag"] != null)
{
actorType = events["actor"][".tag"];
actorTypeString = actorType.Value as string;
}
dynamic emailObj = null;
string email = string.Empty;
}
if (actorTypeString == "user")
{
//non team member check first
Expand All @@ -151,18 +151,27 @@ private void GetEvents(ITeamAuditingModel model, ITeamAuditingView view, IMainPr
}
if (actorTypeString == "admin")
{
emailObj = events["actor"]["admin"]["display_name"];
email = emailObj;
if (events["actor"]["admin"]["display_name"] != null)
{
emailObj = events["actor"]["admin"]["display_name"];
email = emailObj;
}
}
if (actorTypeString == "app")
{
emailObj = events["actor"]["app"]["display_name"];
email = emailObj;
if (events["actor"]["app"]["display_name"] != null)
{
emailObj = events["actor"]["app"]["display_name"];
email = emailObj;
}
}
if (actorTypeString == "reseller")
{
emailObj = events["actor"]["reseller"]["reseller_name"];
email = emailObj;
if (events["actor"]["reseller"]["reseller_name"] != null)
{
emailObj = events["actor"]["reseller"]["reseller_name"];
email = emailObj;
}
}
if (actorTypeString == "dropbox")
{
Expand All @@ -180,8 +189,11 @@ private void GetEvents(ITeamAuditingModel model, ITeamAuditingView view, IMainPr

if (contextTypeString == "team_member")
{
contextObj = events["context"]["email"];
context = contextObj.Value as string;
if (events["context"]["email"] != null)
{
contextObj = events["context"]["email"];
context = contextObj.Value as string;
}
}
if (contextTypeString == "non_team_member")
{
Expand Down Expand Up @@ -443,13 +455,13 @@ private void GetEvents(ITeamAuditingModel model, ITeamAuditingView view, IMainPr
}
dynamic actorType = null;
string actorTypeString = string.Empty;
dynamic emailObj = null;
string email = string.Empty;
if (events["actor"][".tag"] != null)
{
actorType = events["actor"][".tag"];
actorTypeString = actorType.Value as string;
}
dynamic emailObj = null;
string email = string.Empty;
if (actorTypeString == "user")
{
//non team member check first
Expand All @@ -467,18 +479,27 @@ private void GetEvents(ITeamAuditingModel model, ITeamAuditingView view, IMainPr
}
if (actorTypeString == "admin")
{
emailObj = events["actor"]["admin"]["display_name"];
email = emailObj;
if (events["actor"]["admin"]["display_name"] != null)
{
emailObj = events["actor"]["admin"]["display_name"];
email = emailObj;
}
}
if (actorTypeString == "app")
{
emailObj = events["actor"]["app"]["display_name"];
email = emailObj;
if (events["actor"]["app"]["display_name"] != null)
{
emailObj = events["actor"]["app"]["display_name"];
email = emailObj;
}
}
if (actorTypeString == "reseller")
{
emailObj = events["actor"]["reseller"]["reseller_name"];
email = emailObj;
if (events["actor"]["reseller"]["reseller_name"] != null)
{
emailObj = events["actor"]["reseller"]["reseller_name"];
email = emailObj;
}
}
if (actorTypeString == "dropbox")
{
Expand All @@ -493,11 +514,14 @@ private void GetEvents(ITeamAuditingModel model, ITeamAuditingView view, IMainPr
{
contextTypeObj = events["context"][".tag"];
contextTypeString = contextTypeObj.Value as string;

if (contextTypeString == "team_member")
{
contextObj = events["context"]["email"];
context = contextObj.Value as string;
if (events["context"]["email"] != null)
{
contextObj = events["context"]["email"];
context = contextObj.Value as string;
}
}
if (contextTypeString == "non_team_member")
{
Expand Down Expand Up @@ -871,7 +895,7 @@ private void OnCommandFilterMembers(object sender, EventArgs e)
{
newAudit = new List<TeamAuditingListViewItemModel>();
newAudit = view.RenderTeamAuditingFilteredMemberList(members, model.TeamAuditing, newAudit);
presenter.UpdateProgressInfo("Filtering complete.");
presenter.UpdateProgressInfo("Filtering complete. Events loaded [" + newAudit.Count + "]");
presenter.ActivateSpinner(false);
presenter.EnableControl(true);
}, null);
Expand Down

0 comments on commit f49249c

Please sign in to comment.