- Initialisation of the EveAI Chat Client.
- Introduction of Tenant Makes
This commit is contained in:
@@ -8,6 +8,7 @@ import json
|
||||
|
||||
from wtforms.fields.choices import SelectField
|
||||
from wtforms.fields.datetime import DateField
|
||||
from wtforms.fields.simple import ColorField
|
||||
from common.utils.config_field_types import TaggingFields, json_to_patterns, patterns_to_json
|
||||
|
||||
|
||||
@@ -372,6 +373,7 @@ class DynamicFormBase(FlaskForm):
|
||||
'text': TextAreaField,
|
||||
'date': DateField,
|
||||
'file': FileField,
|
||||
'color': ColorField,
|
||||
}.get(field_type, StringField)
|
||||
field_kwargs = {}
|
||||
|
||||
@@ -414,6 +416,14 @@ class DynamicFormBase(FlaskForm):
|
||||
render_kw['data-bs-toggle'] = 'tooltip'
|
||||
render_kw['data-bs-placement'] = 'right'
|
||||
|
||||
# Add special styling for color fields to make them more compact and visible
|
||||
if field_type == 'color':
|
||||
render_kw['style'] = 'width: 100px; height: 40px;'
|
||||
if 'class' in render_kw:
|
||||
render_kw['class'] = f"{render_kw['class']} color-field"
|
||||
else:
|
||||
render_kw['class'] = 'color-field'
|
||||
|
||||
|
||||
current_app.logger.debug(f"render_kw for {full_field_name}: {render_kw}")
|
||||
|
||||
@@ -603,7 +613,7 @@ def validate_tagging_fields(form, field):
|
||||
raise ValidationError(f"Field {field_name} missing required 'type' property")
|
||||
|
||||
# Validate type
|
||||
if field_def['type'] not in ['string', 'integer', 'float', 'date', 'enum']:
|
||||
if field_def['type'] not in ['string', 'integer', 'float', 'date', 'enum', 'color']:
|
||||
raise ValidationError(f"Field {field_name} has invalid type: {field_def['type']}")
|
||||
|
||||
# Validate enum fields have allowed_values
|
||||
|
||||
Reference in New Issue
Block a user