EDM-3215: Decommissioned devices cannot be modified#475
EDM-3215: Decommissioned devices cannot be modified#475celdrake wants to merge 1 commit intoflightctl:mainfrom
Conversation
WalkthroughRefactors permission handling in DeviceDetailsPage by introducing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx`:
- Around line 61-66: The current canEdit combines RBAC and enrollment (const
canEdit = hasEditPermissions && isEnrolled) which hides edit UI instead of
showing a disabled state with a reason; change canEdit to reflect only RBAC (set
canEdit = hasEditPermissions) and keep enrollment checks separate (use
isEnrolled to compute disabledEditReason or to disable controls), update any
uses of canEdit (including YamlEditor onSave and Save button rendering) so that
when canEdit is false the edit controls are hidden (no disabledEditReason
passed) but when canEdit is true and isEnrolled is false the controls are
rendered disabled with disabledEditReason explaining why; leave
canOpenTerminal/hasTerminalAccess logic untouched unless it also needs the same
separation.
libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx
Show resolved
Hide resolved
ac07b67 to
494918a
Compare
Decommissioned devices are not editable.
Summary by CodeRabbit