Repository navigation
[#159] feat: add custom fields to tickets - #208
Conversation
|
@sksingh2005 Can you start on this ? |
|
Yes I would take a look |
sksingh2005
left a comment
There was a problem hiding this comment.
Thanks for the thorough implementation @Mohamed-Alkafory! The core design, role permissions, caching/invalidation, and backend test coverage are
solid.
Before merging, there are two key items that need addressing:
1. Missing sortOrder input in admin UI (Blocker)
CustomFieldFormState and the form submission in src/frontend/src/pages/CustomFieldFormPage.tsx track sortOrder, and the backend supports it, but there is no input control rendered in the UI form. All custom fields created via the UI stay stuck at sortOrder = 0.
- Fix: Add a numeric input for
sortOrderinCustomFieldFormPage.tsx.
2. Unbounded text_value on PostgreSQL B-tree index (Crash risk)
src/backend/main/java/ai/mnemosyne_systems/model/TicketCustomFieldValue.java defines a composite B-tree index idx_ticket_custom_field_text on (custom_field_id, text_value). In PostgreSQL, B-tree index entries cannot exceed ~2,704 bytes. Submitting text larger than that will cause PostgreSQL to throw a fatal index row size exceeds btree maximum error on insert/update.
- Fix: Add max-length validation in
TicketCustomFieldService.java(e.g. max 1,000 or 2,000 chars) before persistingTYPE_TEXTvalues.
Minor Suggestion
- In
CustomFieldResource.java, validate thatSELECTcustom fields have at least one option line defined upon creation.
e4e2da2 to
fba3764
Compare
|
@sksingh2005 Take a look |
sksingh2005
left a comment
There was a problem hiding this comment.
The code changes look great now @Mohamed-Alkafory!
Could you please attach a couple of quick screenshots of the UI in pr description please or screen cast as it would be great for further contributors.
- The Custom Fields admin management pages (
/custom-fieldslist and create/edit form). - A ticket create and ticket detail page showing custom fields populated in the top section.
|
@sksingh2005 Does this look good, or would you like me to add any additional screenshots? |
|
@jesperpedersen PTAL |
|
@jesperpedersen is little busy with pgmoneta and other work. He will review shortly. |
Closes #159
What this does
Adds admin-defined custom fields to tickets.
Screenshots