-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add a modal to enable/disable Agents [WEB-1718] #8721
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #8721 +/- ##
==========================================
- Coverage 47.26% 42.09% -5.17%
==========================================
Files 1045 729 -316
Lines 166700 128322 -38378
Branches 2244 2245 +1
==========================================
- Hits 78783 54018 -24765
+ Misses 87759 74145 -13614
- Partials 158 159 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
2731fd2
to
8740364
Compare
|
||
const onFormSubmit = useCallback(async () => { | ||
for (const nodeId in toggleStates) { | ||
if (toggleStates[nodeId] !== originalNodes[nodeId]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider memoizing originalNodes
so each render doesn't recalculate the node state. Alternatively (assuming the endpoints are idempotent), keep track of which endpoints were touched and apply the endpoints that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️ added useMemo
8740364
to
9ca6fce
Compare
Description
When admin views a cluster resource pool, they'll see a dropdown in the breadcrumbs section:
If there are no active agents, there is a Message
If there are available agents, they appear as a set of toggle switches reflecting enabled/disabled state.
The "Apply Changes" button becomes enabled once changes are made.
When there are 10+ toggles, there is a text filter:
The original ticket suggests a dropdown to allow jobs to finish or 'gracefully terminate', but no such option is available in the current EnableAgent Go code
Test Plan
I've included
const defaultNodes
andnodes = defaultNodes
as comments; uncommenting these makes two agents visible. When you click Apply Changes, you will see an API call and error (because these are not real agent IDs).Checklist
docs/release-notes/
.See Release Note for details.