Add ZipcodeRange field type for managing postal code ranges #1
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.
Overview
This PR introduces a new custom field type ZipcodeRange to NocoDB that enables users to store and manage multiple zipcode ranges within a single field, similar to the multiselect field functionality.
Features
Core Functionality
20000(when start equals end or end is omitted)20000-20999(when start < end)User Interface
Technical Implementation
SDK Layer (nocodb-sdk)
ZipcodeRangeto theUITypesenum with proper naming and search term mappingsZipcodeRangeHelpercolumn helper class for value serialization and parsingisZipcodeRange()utility function for type checkingtextclobTEXTstringBackend Layer (nocodb)
ZipcodeRangeGeneralHandlerwith comprehensive validation:Frontend Layer (nc-gui)
index.vue: Main component wrapper with read/edit mode switchingEditor.vue: Interactive editor with dropdown, input fields, and validation feedbackReadonly.vue: Optimized read-only display with chip renderingutils.ts: Reusable validation and formatting utilitiesCell.vuefor automatic component selection based on field typeData Format
Storage Format (JSON)
[ { "start": "20000", "end": "20999" }, { "start": "30000" }, { "start": "40000", "end": "40500" } ]Display Format
Ranges are displayed as chips with color-coding for visual distinction. Multiple ranges appear as:
20000,30000-30999,40000-40500Validation Rules
nullorundefinedis valid (represents an empty field)Testing
Files Changed
19 files modified/created, +609 lines added:
Known Limitations
getDataTypeListForUiTyperemains unimplemented (consistent with existing Oracle behavior for all field types)Future Enhancement Opportunities
Compatibility
This implementation follows established NocoDB patterns and is compatible with all supported database backends. The field type integrates seamlessly with existing table views, forms, and API endpoints.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.sheetjs.comIf you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.