Dynamic Text Area Widget not displaying as expected in smart action

Feature(s) impacted

Dynamic smart action fields not displaying as expected for text area widget.

Observed behavior

We have smart action which displays Text Area widget. It is correctly rendered when we pass fields configuration in Smart Action fields array. Screenshot displayed below

When we try to pass fields configuration dynamically onLoad hook for smart action using below query
fields.push(...formFields);
Text Area widget fields is displayed as not input fields. Screenshot displayed below

Fields configuration for widget fields is as below

Field _1: {
    field: 'Field 1',
    type: 'String',
    defaultValue: null,
    enums: null,
    isRequired: true,
    reference: null,
    description: null,
    widget: 'text area',
  },

Expected behavior

Smart action widget fields should get displayed correctly for dynamic form fields.

Context

  • Project name: Curator
  • Team name: Developers
  • Environment name: Local
  • Package Version: 8.3 (forest-express-sequelize)
  • Express Version: 4.17.1
  • Sequelize Version: 6.6.5
  • Database Dialect: MySql
  • Database Version: 5.7.24

Hello @Nilesh_Shirsat

Has this behavior been introduced recently and broke an existing workflow that your project is using, or are you developing a new workflow that uncovered this bug?

Working on new workflow. Wanted to move static fields declaration to constants and use it from there. This is to avoid repetition of fields declaration at multiple places.

Hi @Nilesh_Shirsat,

It seems your need is to use the same fields declarations from multiple smart actions.
To do that, you do not need to use the load hook at all (it’s not fully supported to define widgets in the load hook)
Instead of that, you can:

  • Define your common fields in some common-fields.js file
    • It’s nice to form it as a map, so you can peak your fields by the name
  • In your smart-action declaration, require the fields you need and spread it in your static fields declaration

Do you think this will cover your need?

Best regards