feat: Archive action for CategoriesPage and StatusesPage with bUnit tests#137
Merged
feat: Archive action for CategoriesPage and StatusesPage with bUnit tests#137
Conversation
Copilot
AI
changed the title
[WIP] Add bUnit tests for archive action in CategoriesPage and StatusesPage
feat: Archive action for CategoriesPage and StatusesPage with bUnit tests
Apr 15, 2026
…t tests Agent-Logs-Url: https://github.com/mpaulosky/IssueManager/sessions/e899df2f-9625-48a4-b467-5ae84e214857 Co-authored-by: mpaulosky <60372079+mpaulosky@users.noreply.github.com>
…e behavior Agent-Logs-Url: https://github.com/mpaulosky/IssueManager/sessions/e899df2f-9625-48a4-b467-5ae84e214857 Co-authored-by: mpaulosky <60372079+mpaulosky@users.noreply.github.com>
- Add id attribute to archive button: id="archive-{cat.Id}"
- Change AuthorizeView from Policy="Admin" to Roles="Admin"
- Change ConfirmText from "Archive" to "Yes, Archive"
- Add archive-error div with conditional display
- Add _errorMessage field and error handling in HandleArchiveConfirm
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4b0cdac to
939fc82
Compare
🏗️ PR Added to Squad Triage QueueThis PR has been labeled with Next steps:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #137 +/- ##
==========================================
- Coverage 54.55% 54.52% -0.04%
==========================================
Files 128 128
Lines 2984 2986 +2
Branches 336 339 +3
==========================================
Hits 1628 1628
+ Misses 1109 1108 -1
- Partials 247 250 +3
🚀 New features to boost your workflow:
|
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds admin-only archive (soft-delete) action to
CategoriesPageandStatusesPage, including the full confirmation dialog flow and 12 bUnit tests covering all acceptance criteria.API Client Layer
ArchiveAsync(string id)toICategoryApiClient/IStatusApiClientand their HTTP implementations (HTTPDELETE /api/v1/categories/{id}and/api/v1/statuses/{id})Page UI & Logic
<AuthorizeView Roles="Admin">— invisible to non-adminsInitiateArchive()→ sets_archiveTarget+_showArchiveConfirm = true<ConfirmDialog>wired toConfirmArchive()/CancelArchive()ArchiveAsync, reassigns list (forces Radzen DataGrid re-render via new reference +Reload()), or sets_errorMessageon failure#archive-errorelement surfaced for error state testingTests
Two new test classes, 6 tests each:
CategoriesPageArchiveTests/StatusesPageArchiveTestsArchiveButton_AdminUser_IsVisibleArchiveButton_NonAdminUser_IsNotVisibleArchiveButton_Clicked_ShowsConfirmDialogConfirmDialog_Confirmed_CallsArchiveApiAndRemovesRowConfirmDialog_Cancelled_DoesNotCallApiArchiveApi_ReturnsError_ShowsErrorMessageExisting Test Fix
CategoriesPageTestsandStatusesPageTestsconstructors now call_ctx.AddAuthorization()— required because<AuthorizeView>was added to both pages and bUnit throws without registeredIAuthorizationPolicyProvider.