Add auth required field to import device flow#3550
Conversation
Introduce a new authRequired field to the device import flow: add it to EXPECTED_FIELDS, include UI select input, and default it to true on new/cleared forms. Update parsing to detect common CSV header aliases for authentication, convert string values (true/1/yes/etc.) to boolean, and ensure transformed preview/types include boolean. Also tighten payload cleanup logic to remove empty strings/undefined/null/empty arrays, adjust handleInputChange to accept boolean, and update useImportDevice types to include authRequired.
…er feedback Replace setErrors with showBanner for error notifications in the ImportDeviceModal component. This change enhances user experience by providing scoped error messages for various validation scenarios, including file type checks and required field mappings. Additionally, update the UI to display the new authRequired field in the device import table.
|
Warning Review limit reached
More reviews will be available in 51 minutes and 39 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/vertex/components/features/devices/import-device-modal.tsx`:
- Around line 272-285: The current authRequired parsing silently defaults
invalid values to true; instead, when field.key === 'authRequired' validate
rawValue against TRUTHY_VALUES and FALSY_VALUES and, if neither matches, do NOT
set device.authRequired and add a validation error for that row (e.g., push to
the component's importErrors/rowErrors or call markInvalidRow) so preview/import
is blocked until corrected; remove the console.warn fallback and ensure
downstream import/preview checks the errors collection before proceeding.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ed213c2d-3420-46a9-8b2a-2478fa1b3d5b
📒 Files selected for processing (2)
src/vertex/components/features/devices/import-device-modal.tsxsrc/vertex/core/hooks/useDevices.ts
|
New azure vertex changes available for preview here |
… error banner Add validation for the authRequired field in the ImportDeviceModal component. If invalid values are detected during the import process, an error banner is shown to the user, indicating the specific rows with issues. This improves user feedback and ensures correct data entry for authentication requirements.
|
New azure vertex changes available for preview here |
1 similar comment
|
New azure vertex changes available for preview here |
Summary
Two focused improvements to the bulk and single device import flow in
ImportDeviceModal:authRequiredis now a first-class field in the bulk import pipelinesetErrorsvalidation patterns replaced withshowBannerfor consistencyChanges
authRequired Field (
useDevices.ts,import-device-modal.tsx)authRequiredtoEXPECTED_FIELDSwithrequired: trueauthrequired,authenticationrequired,requiresauth,requiredauth,auth requiredtrue / 1 / yes / y→truefalse / 0 / no / n→falsetruewith aconsole.warntruewhen the field is unmapped in the column mapper<ReusableSelectInput>in the single-device import formError Handling Migration (
import-device-modal.tsx)Replaced all
setErrors({ general: ... })validation patterns withshowBanner({ severity: 'error', scoped: true }):handleConfirmImportRemoved the now-redundant
{errors.general && ...}banner divs from themappingModeandpreviewModeJSX blocks.Files Changed
src/vertex/components/features/devices/import-device-modal.tsxsrc/vertex/core/hooks/useDevices.tsScreenshots (optional)
Summary by CodeRabbit
New Features
Improvements