Repository navigation
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Contributor
Author
|
/request-review @aicam |
Contributor
|
Please specify at least one reviewer: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8947 +/- ##
=========================================
Coverage 92.61% 92.61%
Complexity 5060 5060
=========================================
Files 1257 1257
Lines 53762 53783 +21
Branches 6705 6705
=========================================
+ Hits 49789 49809 +20
Misses 2316 2316
- Partials 1657 1658 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
What changes were proposed in this PR?
Problem. An admin can list every computing unit on Admin > Computing Units (#8888) but cannot act on one. Freeing a stuck or idle unit on a full Kubernetes cluster still means finding its pod and deleting it with
kubectl. The backend already lets an ADMIN terminate any unit (DELETE /computing-unit/{cuid}/terminate, #7337), so only the UI is missing.Fix. Adds a delete-icon button to every row, in a new Actions column. It calls
ComputingUnitActionsService.confirmAndTerminate, the confirmation the user's own Computing Units page already uses, so the dialog follows the unit type: a "results will be lost" warning for a Kubernetes unit and "Disconnect" for a local one. Cancelling the dialog or a failed request leaves the row alone.confirmAndTerminategains an optionalonTerminatedcallback that runs only after a successful termination, and the page uses it to drop the row at once instead of showing the unit asRunninguntil the next 5 second poll.Two details follow from an admin seeing other users' units. A poll that started before the
DELETEcan answer after it with the unit still listed, so the page remembers the units it terminated and filters them out of every poll response. And ng-zorro renders the dialog and toast text through[innerHTML]while any user can rename their unit, soconfirmAndTerminatenow HTML-escapes the unit name for every caller.Not included. Telling the owner their unit was terminated (#6483) and the cluster capacity panels (#6481, #6482) are separate issues. There is no backend change.
Any related issues, documentation, discussions?
Closes #6480. Part of #6476.
Follows #8888, which added the page.
How was this PR tested?
Tests were added for the button, the hand-off to the dialog and the name escaping. They cover a button on every row (Kubernetes and local), the click confirming the clicked row's unit, the row leaving only after a successful termination and staying on cancel or failure, a stale in-flight poll not bringing the row back, the detail row's
colspan, a unit name holding markup in the dialog and the toast, andonTerminatedfiring on success only. The tests were written first and watched fail, and breaking the code on purpose (name left unescaped, callback on every outcome, row dropped on click, poll responses left unfiltered) fails exactly the seven tests meant to catch it.The first command passes 53 tests and the second passes 6,622 (1 skipped).
ngc -p src/tsconfig.app.json --noEmit,prettier-eslintandeslintran clean on the changed files.Screen.Recording.2026-10-10.at.4.30.51.PM.mov
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code, Claude Sonnet 5.5