ff4j / ff4j

Feature Flags for Java made easy

Home Page:http://ff4j.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Properties with fixed values cannot be edited via drop down in UI

marcgemis opened this issue · comments

A property with fixed values show a drop-down in the edit dialog. A similar property that is part of a feature does not show such a drop-down.

Since the export does not include the custom properties, I add the SQL-insert statements for my setup
INSERT INTO FF4J_FEATURES (FEAT_UID,ENABLE,DESCRIPTION,STRATEGY,EXPRESSION,GROUPNAME`) VALUES ('Sprint 11 Values',1,'Some Values Specific for Sprint 11',NULL,NULL,'Sprint 11');

INSERT INTO FF4J_CUSTOM_PROPERTIES (PROPERTY_ID,CLAZZ,CURRENTVALUE,FIXEDVALUES,DESCRIPTION,FEAT_UID) VALUES ('EmailMode','com.foo.emailservice.ff4j.EmailModeProperty','DIRECT','DIRECT, VIA_TOPIC, NO_EMAIL','The different modes in which the Email-Service can deliver mail','Sprint 11 Values');

INSERT INTO FF4J_PPROPERTIES (PROPERTY_ID,CLAZZ,CURRENTVALUE,FIXEDVALUES,DESCRIPTION) VALUES ('emailmode','com.foo.emailservice.ff4j.EmailModeProperty','VIA_TOPIC','VIA_TOPIC, DIRECT, NO_EMAIL','The different modes in which the Email-Service can deliver mail');
`

The custom property shows up in the feature edit dialog
FF4J-FeaturesEmailMode

editing the property does not show the fixed values, although no changes can be made with other values
editpropertyoffeature

compare this with a similar (standalone) property, where the dialog shows the fixed values
propertywithfixedvalues

This is version 1.8.12

That smells like an issue I encountered when I had only overridden fromString(String). In that case I resolved my issue by overriding asString() too.

@mrgrew , I added a asString(), but it makes no difference.

Bummer. In that case sharing the source to com.foo.emailservice.ff4j.EmailModeProperty should prove helpful.

Poke, I confirm the user interface does not support fixed Values in feature custom properties whereas the underlying data model support it.

The feature is pretty hard to implement at the moment, will skip it for 1.9