Project

General

Profile

Actions

Patch #41827

open

Increase maximum size for custom field name

Added by Leonid Murin about 22 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Custom fields
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

It is limited in the model of CustomField, at line 38

validates_length_of :name, :maximum => 30

There are several patches in the attachments.
The first one increases the limit for the custom field name from 30 to 255 in validation.
Adds migration that increases the limit for the name column
from 30 to 255 in the custom_fields table.
And adds a test for the custom field's name validation.

When there is a custom field with such a long name, a query form layout becomes broken, with elements continuing beyond the page borders.
So the second patch limits the maximum width for selects in a query from.
Affects: Add filter select, Group results by select, column selects in the Sort block, and selects for Available Columns and Selected Columns.

But this creates another problem - long column names are clipped inside selects.
The third patch marks options in selects for Available Columns and Selected Columns with the js-overflow-to-tooltip class and modifies the JS that initializes tooltips,
so that it automatically adds tooltips for elements marked with the js-overflow-to-tooltip class.
If the content of an element, marked with the js-overflow-to-tooltip class, exits element boundaries and is clipped, a title attribute is set for the element with its text content as a value.
If an element already has a title attribute with non-empty value, it remains untouched.
I decided to use the js-overflow-to-tooltip class instead of the selector just for those specific fields to make this mechanism available in other places or in plugins.
Unfortunately, nothing can be done with the drop-down selects.

There is also a problem with Totals. If they have long names or there are many of them selected, they overlap with the query buttons.
The fourth patch makes them appear as a separate row.

The fifth patch explicitly sets the collision: "flipfit flip" option for tooltips during initialization because it implicitly exists, but disappears after reinitialization (e.g., when the Options field set is opened on the query page, required for auto-tooltips).
In this case, if a large object (e.g., column title in a query) is partially visible on screen, its tooltip will be partially or completely outside the screen.


Files

No data to display

Actions

Also available in: Atom PDF