Skip to content

Commit

Permalink
+ (Check-in) Updated Live Metrics to handle if a group had a non-chec…
Browse files Browse the repository at this point in the history
…kin parent group. (Fixes #5659)
  • Loading branch information
shivambareria committed Nov 8, 2023
1 parent e9bb8d6 commit 02a2606
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions RockWeb/Blocks/CheckIn/Manager/LiveMetrics.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

using Newtonsoft.Json;

using Rock;
Expand Down Expand Up @@ -744,15 +743,14 @@ private NavigationData GetNavigationData( CampusCache campus, int? scheduleId )

NavData.Groups.Add( navGroup );


/*
SK - 07/02/2023
Reverted back changes made via https://github.com/SparkDevNetwork/Rock/commit/a5bda143b0ba02f0897c2245513bbc23a638f156
- Fixed issue in Live Metrics where a 'no valid groups or locations' message would show if a Group had a non-checkin parent group.
IF the other situation occurs again, we will have more details about where/why/how to handle it next.
*/
if ( !group.ParentGroupId.HasValue || groupIds.Contains( group.ParentGroupId.Value ) )
if ( !group.ParentGroupId.HasValue || groupIds.Contains( group.ParentGroupId.Value ) || group.ParentGroup.GroupTypeId != group.GroupTypeId )
{
NavData.GroupTypes.Where( t => t.Id == group.GroupTypeId ).ToList()
.ForEach( t => t.ChildGroupIds.Add( group.Id ) );
Expand Down Expand Up @@ -1331,7 +1329,7 @@ private void BuildNavigationControls()
.Distinct()
.ToList();
NavData.Groups
.Where( g => groupIds.Contains( g.Id ) && g.ParentId == null )
.Where( g => groupIds.Contains( g.Id ) && ( g.ParentId == null || !groupIds.Contains( g.ParentId.Value ) ) )
.ToList()
.ForEach( g => navItems.Add( g ) );

Expand Down

0 comments on commit 02a2606

Please sign in to comment.