-
Notifications
You must be signed in to change notification settings - Fork 91
feat: runtime User Management screen with RBAC #953
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
Changes from all commits
53e01f2
68b3021
66db0d8
8cc96f6
f482aad
a284c9e
526e470
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { ComponentProps } from 'react' | ||
|
|
||
| import { cn } from '../../../utils/cn' | ||
|
|
||
| type IUsersIconProps = ComponentProps<'svg'> & { | ||
| size?: 'sm' | 'md' | 'lg' | ||
| } | ||
|
|
||
| const sizeClasses = { | ||
| sm: 'w-5 h-5', | ||
| md: 'w-6 h-6', | ||
| lg: 'w-12 h-12', | ||
| } | ||
|
|
||
| export const UsersIcon = (props: IUsersIconProps) => { | ||
| const { className, size = 'sm', ...res } = props | ||
| return ( | ||
| <svg | ||
| role='button' | ||
| viewBox='0 0 28 28' | ||
| fill='none' | ||
| xmlns='http://www.w3.org/2000/svg' | ||
| className={cn(`${sizeClasses[size]}`, className)} | ||
| {...res} | ||
| > | ||
| <circle cx='11' cy='9' r='4' fill='#023C97' /> | ||
| <path | ||
| d='M4 22C4 18.134 7.13401 15 11 15C14.866 15 18 18.134 18 22V23C18 23.5523 17.5523 24 17 24H5C4.44772 24 4 23.5523 4 23V22Z' | ||
| fill='#023C97' | ||
| /> | ||
| <circle cx='20' cy='10.5' r='3' fill='#B4D0FE' /> | ||
| <path | ||
| d='M19 16C22.3137 16 25 18.6863 25 22V22.5C25 23.3284 24.3284 24 23.5 24H20.5C20.7761 24 21 23.7761 21 23.5V22C21 19.9954 20.2159 18.1738 18.9385 16.8262C19.0252 16.8154 19.1123 16.8079 19.2 16.8038C19.1327 16.5411 19.0693 16.2734 19 16Z' | ||
| fill='#B4D0FE' | ||
| /> | ||
| </svg> | ||
| ) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| /* eslint-disable @typescript-eslint/no-misused-promises */ | ||
| import type { TimingStats } from '@root/middleware/shared/ports/types' | ||
| import { useCapabilities, useDevice, useRuntime } from '@root/middleware/shared/providers/platform-context' | ||
|
|
@@ -60,6 +60,7 @@ | |
| const setRuntimeIpAddress = useOpenPLCStore((state) => state.deviceActions.setRuntimeIpAddress) | ||
| const setRuntimeConnectionStatus = useOpenPLCStore((state) => state.deviceActions.setRuntimeConnectionStatus) | ||
| const setRuntimeJwtToken = useOpenPLCStore((state) => state.deviceActions.setRuntimeJwtToken) | ||
| const setRuntimeVersion = useOpenPLCStore((state) => state.deviceActions.setRuntimeVersion) | ||
| const openModal = useOpenPLCStore((state) => state.modalActions.openModal) | ||
| const plcStatus = useOpenPLCStore((state): RuntimeConnection['plcStatus'] => state.runtimeConnection.plcStatus) | ||
| const timingStats = useOpenPLCStore((state): TimingStats | null => state.runtimeConnection.timingStats) | ||
|
|
@@ -365,6 +366,10 @@ | |
| return | ||
| } | ||
|
|
||
| // Remember the runtime version so version-gated UI (e.g. User | ||
| // Management) can react to it for the lifetime of the connection. | ||
| setRuntimeVersion(result.runtimeVersion ?? null) | ||
|
Comment on lines
+369
to
+371
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Clear Line [371] persists a version before login/connection validation completes. The handler’s disconnect, error, and cancel paths only update status/token, so the store can retain a non-null version while disconnected or errored, contrary to 🤖 Prompt for AI Agents |
||
|
|
||
| // Validate runtime version matches the selected board target | ||
| const versionValidation = validateRuntimeVersion(deviceBoard, result.runtimeVersion) | ||
|
|
||
|
|
||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Do not expose the decorative SVG as a button.
role='button'gives this SVG button semantics, but it has no accessible name, focusability, or keyboard handler; activation is handled by the parent tree item. Remove the role and mark the icon decorative, or move button semantics to the interactive leaf control.🤖 Prompt for AI Agents