feat(ENG-295): Support dynamic type alert in configFields#153
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for a new non-input connector config field type (alert) so connector configs can display informational/warning messages in the integration picker UI without being treated as form inputs/validation targets.
Changes:
- Extend
ConnectorConfigFieldto supporttype: 'alert'andalertType. - Render
alertfields via the Malachite<Alert />component (including when there are no input fields). - Exclude
alertfields from the generated Zod form schema.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/modules/integration-picker/utils/zodSchema.ts |
Skips alert fields when building the Zod object schema. |
src/modules/integration-picker/types.ts |
Extends connector field typing to include alert + alertType. |
src/modules/integration-picker/components/IntegrationFields.tsx |
Renders alert fields in the form and in the no-input-fields state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Typography, | ||
| } from '@stackone/malachite'; | ||
| import { useEffect, useMemo, useRef, useState } from 'react'; | ||
| import { Fragment, useEffect, useMemo, useRef, useState } from 'react'; |
There was a problem hiding this comment.
Fragment is imported but never used in this file — Biome will fail this on lint.
There was a problem hiding this comment.
Removed unused imports
| @@ -309,7 +322,7 @@ export const IntegrationForm: React.FC<IntegrationFieldsProps> = ({ | |||
| }, [isValid, onValidationChange]); | |||
|
|
|||
| if (fields.length === 0) { | |||
There was a problem hiding this comment.
Edge case: this guard uses fields.length, but displayedFields (fields with display !== false) can still be empty when fields.length > 0. When that happens fieldKeys is [], so firstKey/lastKey are undefined and no top or bottom notices render anywhere — they're silently dropped. Consider switching the guard to displayedFields.length === 0 so NoFieldsView (which renders top notices) takes over.
| flexDirection: 'column', | ||
| gap: '8px', | ||
| width: '100%', | ||
| }} |
There was a problem hiding this comment.
This wrapper used to be <div style={{ width: '100%' }}> and is now flex column with gap: 8px applied unconditionally. That changes vertical spacing for every field, even ones with no notices attached. Worth a visual QA pass across existing integrations to make sure nothing regresses — or only apply the flex/gap styles when there are notices to render.
Applied Alert configField here in HiBob Connector: https://github.com/StackOneHQ/connectors/pull/1713#top