Enhance Authentication and Console Management#55
Merged
cgalibern merged 14 commits intoopensvc:mainfrom Nov 13, 2025
Merged
Conversation
…and edge case tests - Add tests for all default console.warn functions (setPendingAction, setConfirmDialogOpen, setStopDialogOpen, setUnprovisionDialogOpen, setSimpleDialogOpen, setCheckboxes, setStopCheckbox, setUnprovisionCheckboxes) - Add handleResourceActionClick state management tests - Add getFilteredResourceActions tests for container and unknown resource types - Add getResourceType edge cases (undefined rid, missing type) - Add renderResourceRow null return test for undefined resources - Add stopPropagation tests for Box wrapper clicks (resource checkbox, action buttons, batch actions) - Add ClickAwayListener tests for menu closing and state reset - Add MenuItem stopPropagation tests for menu item clicks These tests cover previously untested function branches including event handlers, filtering logic, and error handling paths.
- Add GitHub API fetch to retrieve latest release version from opensvc/om3-webapp - Implement local caching for version data (1 hour TTL) - Display version in NavBar with tooltip and monospace styling - Position version indicator between breadcrumb and status indicators - Handle loading and error states gracefully with fallback to 'Unknown' - Use User-Agent header 'MonTestCurl' for API compliance The version is now visible to users in the navigation header, providing better transparency about the deployed application version.
- Correct event handler removal in cleanupUserManager to properly detach all listeners and avoid memory leaks. - Prevent multiple event handler registrations by adding guards to ensure handlers are added only once. - Use a ref to keep track of the current UserManager instance for reliable cleanup on unmount. - Refactor OidcCallback component to centralize event handler setup and avoid duplicates during re-renders. - Improve BroadcastChannel usage to avoid multiple open/close calls and ensure session synchronization across tabs. - Overall improvements to stability and reliability of OIDC authentication flow and token management. - Minor: maintain robustness during unmount and recreation of UserManager instances.
…n component -Implement a lock and queue system in refreshToken to prevent simultaneous refresh requests that could cause token invalidation. -Enhance error handling to catch network failures and show user-friendly messages. -Add isMounted check in Login component to avoid state updates on unmounted component. -Improve form UX with autoComplete attributes on input fields. -Recommend storing tokens in secure HttpOnly cookies (currently in localStorage as a fallback). -Clean up disabled submit button logic and maintain consistent code style.
Preload the clusterName on the server during initial connection to avoid the "Loading..." flash on page changes. Store the clusterName in a local state to reuse it without refetching on client-side navigations. Update breadcrumbs and UI to use the stored clusterName for consistent and smooth user experience. This change improves perceived performance and removes unnecessary loading states when changing pages.
…tion - Add new states in ObjectDetail: consoleDialogOpen, seats, greetTimeout - Implement dedicated console dialog with TextField inputs for seats and greet_timeout - Update postConsoleAction to accept seats and greet_timeout parameters and include them in request URL - Modify openActionDialog to open console-specific dialog instead of using ActionDialogManager - Add handleConsoleConfirm to execute console action with current seats/greet_timeout values - Update ActionDialogManager rendering in ObjectDetail to exclude console action - Extend ActionDialogManager to support console via new ConsoleDialog component (kept for potential future reuse) - Add imports: Dialog, DialogActions, DialogContent, DialogTitle, TextField to ObjectDetail - Ensure console action is disabled in batch resource actions - Preserve existing behavior for all other actions
- Ensure that Username and Password TextField components have identical prop ordering and consistent styling. - Add 'disabled' prop uniformly to both fields during loading state. - Use consistent sx margin styling to prevent layout inconsistencies. - Correct Material-UI rendering issues causing the Password field to appear smaller than the Username field. This improves visual consistency and user experience on the login form.
… handling and UI consistency - Updated `objectUtils` with clearer kind/namespace extraction and unified allowed actions logic. - Reworked `ObjectDetail` component to: - Add robust handling for object, node, and resource actions (including console and batch actions). - Improve configuration management with async fetching, event-driven updates, and better error handling. - Integrate responsive and accessible UI elements (dialogs, snackbars, accordions, drawers). - Introduce dynamic action filtering based on resource type. - Optimize performance using memoization and callback hooks. - Refactored `ConfigSection`: - Added hooks (`useConfig`, `useKeywords`, `useExistingParams`) for modular data fetching. - Improved configuration upload and management dialogs. - Enhanced keyword and parameter editing workflows with better UX and validation. - Added error recovery and timeout handling for API calls. Overall: modernized components, improved state management, and enhanced UX for configuration and action workflows.
- Added new dialog to display console URL instead of directly opening it - Introduced two new state variables: `consoleUrlDialogOpen` and `currentConsoleUrl` - Modified `postConsoleAction` function to store URL and open display dialog - Added new Dialog component to show console URL with copy and open options - Improved UX with "Copy URL" and "Open in New Tab" buttons - Increased dialog maxWidth to "lg" for better readability - Added proper styling for URL display with monospace font and scrollable container - Maintained backward compatibility with existing console functionality
The checkboxes in action dialogs (especially unprovision, purge, delete, etc.) were being reset immediately after being checked. This was caused by the `useEffect` in `ActionDialogManager` re-initializing the checkbox state on every render when `pendingAction` changes — even if the action type remained the same. The root cause was that the initialization logic ran every time `pendingAction` changed, regardless of whether the action string (`pendingAction.action`) was different from the previous one. This led to state resets during re-renders triggered by unrelated prop changes or parent updates. Fix: - Introduced a `lastAction` state to track the previously rendered action. - Only reset checkbox state when the action actually changes (i.e., `action !== lastAction`). - Update `lastAction` only after successful initialization. - Clear `lastAction` when `pendingAction` becomes `null`. This ensures checkbox state persists across re-renders as long as the same action dialog is open, while still correctly resetting when switching to a different action or closing/reopening. Closes issue with checkboxes unchecking themselves after interaction.
…alignment - Separate status icons from globalExpect display using absolute positioning - Fix layout shifts caused by variable-length globalExpect values - Implement fixed-width containers for both object and node status icons - Ensure status icons remain perfectly aligned regardless of globalExpect content - Align column headers precisely with their corresponding status icons - Use consistent width constraints (80px for icons, 70px for globalExpect, 50px for node states) - Maintain responsive design while preventing content from affecting column widths - Add proper text truncation with ellipsis for long globalExpect and node state values - Remove unnecessary margins and simplify flexbox structure for better alignment - Preserve all existing functionality (sorting, filtering, actions) while improving visual stability The table now maintains consistent column widths and icon positioning, providing a more stable and professional user experience.
…ection The `globalExpect` value is now displayed **to the left** of the status icons (with a fixed width of **70px**). The status icons remain **perfectly centered** inside their own **80px** block, preventing any layout shift when `globalExpect` appears or disappears. Key changes: - Wrapped the icon block in a container with `ml: globalExpect ? "70px" : 0` - Added an absolutely positioned `globalExpect` box at `left: 0` - Ensured consistent spacing and alignment with the object table view - Preserved accessibility via `Tooltip` and `Typography` - No visual jitter or icon movement on dynamic updates This change aligns the object detail header with the main objects table, providing a stable and predictable UI. Fixes layout shift issue when `globalExpect` is present.
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.
No description provided.