Dropdown (array) widget broken

Hello,

I have an issue with the “dropdown (array)” widget, that won’t let me select a value anymore. Actually, there is no option to select… Note that this is a regression, we had no problem before.

Field definition

Field definition from model

estate_types_incl: {
        type: DataTypes.ARRAY(DataTypes.ENUM('flat', 'house', 'other')),
        validate: {
          isArrayOfEstateTypes(value) {
            for (let item of value) {
              if (!['flat', 'house', 'other'].includes(item)) {
                throw new sequelizeClient.ValidationError(
                  'Validation isArrayOfPropertyTypes on estate_types_incl failed',
                  [{ path: 'estate_types_incl' }]
                )
              }
            }
          }
        }
      }

Field definition from .forestadmin-schema.json

{
      "field": "estate_types_incl",
      "type": ["Enum"],
      "defaultValue": null,
      "enums": null,
      "integration": null,
      "isFilterable": true,
      "isReadOnly": false,
      "isRequired": false,
      "isSortable": true,
      "isVirtual": false,
      "reference": null,
      "inverseOf": null,
      "validations": []
    }

Also note that I observed the same behavior with a liana version 6.3.10 where the enum options are properly set in the .forestadmin-schema.json

Expected behavior

The options from the enum are selectable from the dropdown list.

Actual behavior

No option displayed. See screenshot.

Context

  • Package Version: 5.7.0
  • Express Version: 4.17.1
  • Sequelize Version: 4.44.4
  • Database Dialect: Postgres
  • Project Name: Homeloop

Hi @arthur.derouge,

Does this issue appear on all your environments ?
Do you have any errors in your browser console that could help to reproduce the issue ?

On my end, I was not able to reproduce this issue (At least for now, but maybe my configuration is not similar to yours).
I’ll check on our end to see if I can spot a configuration issue related to your project.

1 Like

Hello @arthur.derouge :wave:

As @jeffladiray pointed, do you have this issue on all of your environments ?

I can see that the enums value are not present in your schema on production, but they are on your development environment.

Can you confirm your development environment does not have the issue ?

Thanks in advance :pray:

Bunlon Steve.

Hello,

I see no error or warning in the browser console unfortunately.
As I wrote in my initial message, I had the same issue yesterday on my developer env, which is in 6.3.10.
Strangely enough, it’s no longer the case this morning, as I see the options in the dropdown list as expected on my dev environment—the issue is still present on production env though.
Maybe some config changes take some time to propagate because it tested it right after the Liana version upgrade.

@arthur.derouge :wave:

To fix the issue on production, I suggest to update the .forestadmin-schema on production with the one one on development (assuming models are the same between those two environments). Then, options should be back and proudction dropdown will be fixed :+1:

Can you try this and keep us in touch please ?

Steve.

I solved it by updgrading to forest-express-sequelize 6.x

1 Like

Hello,

We are facing the exact same issue (in both local and production environments), however we’re already running on forest-express-sequelize 6. As stated, this is a regression for us as well, we had no problem before.

Any thoughts ?

Thanks !

Damien

Context :

  • Express Version : 4.16.3
  • Sequelize Version : 6.3.6
  • Database Dialect : Postgres
  • Project Name : Pennylane