-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: allow 1 custom partition field in stream creation #442
feat: allow 1 custom partition field in stream creation #442
Conversation
fails validation if user tries to add more than 1 field
WalkthroughThe changes update the partitioning logic in the UI by limiting the selection to a single column. The displayed text and placeholder in the partitioning component have been revised, and the underlying property that controls the maximum number of selectable entries is now set to one. This affects how users interact with event partitioning within the modal. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant CPF as CustomPartitionField
participant TI as TagsInput
U->>CPF: Open stream creation modal
CPF->>TI: Render with maxTags = 1 and new placeholder
U->>TI: Attempt to add a partition column
TI->>CPF: Validate selection (only one allowed)
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/pages/Home/CreateStreamModal.tsx (1)
386-394
: Consider adding explicit validation for maximum custom partition fields.While the UI restricts selection to one field, it would be good to add explicit validation to ensure the array length doesn't exceed 1, providing a clear error message.
customPartitionFields: (val, allValues) => { if (_.isEmpty(val) || allValues.schemaType !== staticType) { return null; + } else if (val.length > 1) { + return 'Only one custom partition field is allowed'; } else { const allFieldNames = _.map(allValues.fields, (field) => field.name); const invalidColumnNames = _.difference(val, allFieldNames); return !_.isEmpty(invalidColumnNames) ? 'Unknown Field Included' : null; } },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/pages/Home/CreateStreamModal.tsx
(1 hunks)
🔇 Additional comments (1)
src/pages/Home/CreateStreamModal.tsx (1)
303-303
: LGTM! The changes correctly implement single field partitioning.The UI changes effectively communicate and enforce the single field limitation through:
- Updated description text
- Updated placeholder text
- Restricted maxTags property
Also applies to: 311-311, 316-316
fails validation if user tries to add more than 1 field
Summary by CodeRabbit