Add Team Meeting History functionality with dialog and badge components
This commit introduces a new feature to display meeting history for teams. It adds a `TeamMeetingHistoryDialog` component that shows the meeting history in a dialog format, including a loading state and error handling. Additionally, a `TeamMeetingHistoryBadge` component is created to display the count of meetings for each team, enhancing the user interface with tooltips for better interaction. The `Details` and `Index` components are updated to integrate these new features, allowing users to view meeting history directly from the team details and index pages. These changes improve the overall functionality and user experience in managing team meetings.
This commit is contained in:
@@ -47,4 +47,19 @@ public interface ITeamMeetingHistoryService
|
||||
/// <param name="meetingDate">The date of the meeting</param>
|
||||
/// <returns>The note if found, null otherwise</returns>
|
||||
Task<Note?> GetMeetingNoteAsync(DateTime meetingDate);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all meeting histories for a specific team, ordered by date descending.
|
||||
/// </summary>
|
||||
/// <param name="teamId">The ID of the team</param>
|
||||
/// <returns>Meeting histories for the team, ordered by date descending</returns>
|
||||
Task<IEnumerable<TeamMeetingHistory>> GetMeetingHistoriesForTeamAsync(int teamId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the count of meeting histories for a specific team.
|
||||
/// This is more efficient than loading all histories just to count them.
|
||||
/// </summary>
|
||||
/// <param name="teamId">The ID of the team</param>
|
||||
/// <returns>The number of meeting histories for the team</returns>
|
||||
Task<int> GetMeetingHistoryCountForTeamAsync(int teamId);
|
||||
}
|
||||
|
||||
@@ -202,4 +202,25 @@ public class TeamMeetingHistoryService : ITeamMeetingHistoryService
|
||||
.Distinct()
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<TeamMeetingHistory>> GetMeetingHistoriesForTeamAsync(int teamId)
|
||||
{
|
||||
return await _context.TeamMeetingHistories
|
||||
.AsNoTracking()
|
||||
.Include(tmh => tmh.Teams)
|
||||
.ThenInclude(t => t.Event)
|
||||
.Include(tmh => tmh.Students)
|
||||
.Where(tmh => tmh.Teams.Any(t => t.Id == teamId))
|
||||
.OrderByDescending(tmh => tmh.MeetingDate)
|
||||
.ThenByDescending(tmh => tmh.Id)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<int> GetMeetingHistoryCountForTeamAsync(int teamId)
|
||||
{
|
||||
return await _context.TeamMeetingHistories
|
||||
.AsNoTracking()
|
||||
.Where(tmh => tmh.Teams.Any(t => t.Id == teamId))
|
||||
.CountAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user