mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 07:27:57 -05:00
* creating boolean, number and date tags with different equality matchings * feat: add UI for tag field types with filter operators - Update base-tags-modal with field type selector dropdown - Update document-tags-modal with different input types per fieldType - Update knowledge-tag-filters with operator dropdown and type-specific inputs - Update search routes to support all tag slot types - Update hook to use AllTagSlot type * feat: add field type support to document-tag-entry component - Add dropdown with all field types (Text, Number, Date, Boolean) - Render different value inputs based on field type - Update slot counting to include all field types (28 total) * fix: resolve MAX_TAG_SLOTS error and z-index dropdown issue - Replace MAX_TAG_SLOTS with totalSlots in document-tag-entry - Add z-index to SelectContent in base-tags-modal for proper layering * fix: handle non-text columns in getTagUsage query - Only apply empty string check for text columns (tag1-tag7) - Numeric/date/boolean columns only check IS NOT NULL - Cast values to text for consistent output * refactor: use EMCN components for KB UI - Replace @/components/ui imports with @/components/emcn - Use Combobox instead of Select for dropdowns - Use EMCN Switch, Button, Input, Label components - Remove unsupported 'size' prop from EMCN Button * fix: layout for delete button next to date picker - Change delete button from absolute to inline positioning - Add proper column width (w-10) for delete button - Add empty header cell for delete column - Apply fix to both document-tag-entry and knowledge-tag-filters * fix: clear value when switching tag field type - Reset value to empty when changing type (e.g., boolean to text) - Reset value when tag name changes and type differs - Prevents 'true'/'false' from sticking in text inputs * feat: add full support for number/date/boolean tag filtering in KB search - Copy all tag types (number, date, boolean) from document to embedding records - Update processDocumentTags to handle all field types with proper type conversion - Add number/date/boolean columns to document queries in checkDocumentWriteAccess - Update chunk creation to inherit all tag types from parent document - Add getSearchResultFields helper for consistent query result selection - Support structured filters with operators (eq, gt, lt, between, etc.) - Fix search queries to include all 28 tag fields in results * fixing tags import issue * fix rm file * reduced number to 3 and date to 2 * fixing lint * fixed the prop size issue * increased number from 3 to 5 and boolean from 7 to 2 * fixed number the sql stuff * progress * fix document tag and kb tag modals * update datepicker emcn component * fix ui * progress on KB block tags UI * fix issues with date filters * fix execution parsing of types for KB tags * remove migration before merge * regen migrations * fix tests and types * address greptile comments * fix more greptile comments * fix filtering logic for multiple of same row * fix tests --------- Co-authored-by: priyanshu.solanki <priyanshu.solanki@saviynt.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
74 lines
1.9 KiB
TypeScript
74 lines
1.9 KiB
TypeScript
/**
|
|
* Database-only constants used in schema definitions and migrations.
|
|
* These constants are independent of application logic to keep migrations container lightweight.
|
|
*/
|
|
|
|
/**
|
|
* Default free credits (in dollars) for new users
|
|
*/
|
|
export const DEFAULT_FREE_CREDITS = 10
|
|
|
|
/**
|
|
* Storage limit constants (in GB)
|
|
* Can be overridden via environment variables
|
|
*/
|
|
export const DEFAULT_FREE_STORAGE_LIMIT_GB = 5
|
|
export const DEFAULT_PRO_STORAGE_LIMIT_GB = 50
|
|
export const DEFAULT_TEAM_STORAGE_LIMIT_GB = 500
|
|
export const DEFAULT_ENTERPRISE_STORAGE_LIMIT_GB = 500
|
|
|
|
/**
|
|
* Text tag slots for knowledge base documents and embeddings
|
|
*/
|
|
export const TEXT_TAG_SLOTS = ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6', 'tag7'] as const
|
|
|
|
/**
|
|
* Number tag slots for knowledge base documents and embeddings (5 slots)
|
|
*/
|
|
export const NUMBER_TAG_SLOTS = ['number1', 'number2', 'number3', 'number4', 'number5'] as const
|
|
|
|
/**
|
|
* Date tag slots for knowledge base documents and embeddings (2 slots)
|
|
*/
|
|
export const DATE_TAG_SLOTS = ['date1', 'date2'] as const
|
|
|
|
/**
|
|
* Boolean tag slots for knowledge base documents and embeddings (3 slots)
|
|
*/
|
|
export const BOOLEAN_TAG_SLOTS = ['boolean1', 'boolean2', 'boolean3'] as const
|
|
|
|
/**
|
|
* All tag slots combined (for backwards compatibility)
|
|
*/
|
|
export const TAG_SLOTS = [
|
|
...TEXT_TAG_SLOTS,
|
|
...NUMBER_TAG_SLOTS,
|
|
...DATE_TAG_SLOTS,
|
|
...BOOLEAN_TAG_SLOTS,
|
|
] as const
|
|
|
|
/**
|
|
* Type for all tag slot names
|
|
*/
|
|
export type TagSlot = (typeof TAG_SLOTS)[number]
|
|
|
|
/**
|
|
* Type for text tag slot names
|
|
*/
|
|
export type TextTagSlot = (typeof TEXT_TAG_SLOTS)[number]
|
|
|
|
/**
|
|
* Type for number tag slot names
|
|
*/
|
|
export type NumberTagSlot = (typeof NUMBER_TAG_SLOTS)[number]
|
|
|
|
/**
|
|
* Type for date tag slot names
|
|
*/
|
|
export type DateTagSlot = (typeof DATE_TAG_SLOTS)[number]
|
|
|
|
/**
|
|
* Type for boolean tag slot names
|
|
*/
|
|
export type BooleanTagSlot = (typeof BOOLEAN_TAG_SLOTS)[number]
|