From 98f60a996a616fff65338a9247e2b42600b2cdf7 Mon Sep 17 00:00:00 2001 From: henry Date: Sun, 18 May 2025 02:31:49 -0400 Subject: [PATCH] Add ability to add inactive or active users to UI --- AccessQueuePlayground/Components/Pages/Home.razor | 13 +++++++------ .../Services/AccessQueueManager.cs | 4 ++-- .../Services/IAccessQueueManager.cs | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/AccessQueuePlayground/Components/Pages/Home.razor b/AccessQueuePlayground/Components/Pages/Home.razor index fbfe951..d29a360 100644 --- a/AccessQueuePlayground/Components/Pages/Home.razor +++ b/AccessQueuePlayground/Components/Pages/Home.razor @@ -16,13 +16,14 @@

}

- + +

@if (Status != null) { -

Users with access

+

Users with access

@@ -43,7 +44,7 @@ -

Users in queue

+

Users in queue

@@ -64,7 +65,7 @@ -

Inactive users

+

Inactive users

@@ -98,9 +99,9 @@ }); } - public void AddUser() + public void AddUser(bool isActive) { - Manager.AddUser(); + Manager.AddUser(isActive); Status = Manager.GetStatus(); } diff --git a/AccessQueuePlayground/Services/AccessQueueManager.cs b/AccessQueuePlayground/Services/AccessQueueManager.cs index d3237bb..5412821 100644 --- a/AccessQueuePlayground/Services/AccessQueueManager.cs +++ b/AccessQueuePlayground/Services/AccessQueueManager.cs @@ -36,13 +36,13 @@ namespace AccessQueuePlayground.Services CapacityLimit = _config.GetValue("AccessQueue:CapacityLimit") }; - public Guid AddUser() + public Guid AddUser(bool isActive) { var id = Guid.NewGuid(); _users[id] = new User { Id = id, - Active = false, + Active = isActive, }; return id; } diff --git a/AccessQueuePlayground/Services/IAccessQueueManager.cs b/AccessQueuePlayground/Services/IAccessQueueManager.cs index 5c16ff1..fcdfd52 100644 --- a/AccessQueuePlayground/Services/IAccessQueueManager.cs +++ b/AccessQueuePlayground/Services/IAccessQueueManager.cs @@ -8,7 +8,7 @@ namespace AccessQueuePlayground.Services public AccessQueueConfig GetConfig(); public Task RecalculateStatus(); public AccessQueueStatus GetStatus(); - public Guid AddUser(); + public Guid AddUser(bool isActive); public void SetUserActive(Guid userId, bool isActive); public void RevokeAccess(Guid userId); public void RevokeAllAccess();