Checkbox widget is not working as expected

Hi there!

We have a smart action with a list of checkboxes that have been working fine since we introduced it months ago. This morning, the checkbox widget on the smart action has disappeared and is now a text box causing inconvenience to our content team.

The source code has not been changed from our side in the last 2 weeks and the GET API connected to the smart action is working as expected.

Summary of the issue - Expected behavior

  1. Open Add amenities smart action

  2. Smart action form rendering all our amenities as checkboxes for agents to select (as seen below)

  3. Agent selects amenities and saves.

Actual Behavior - from this morning:

  1. Open Add amenities smart action

  2. Agent is only able to type amenities in a text box. It’s not even a Belongs to Typeahead, Belongs to Select or Dropdown widgets as seen in the screenshot below

We have found that if we refresh 2-3x then the checkboxes appear again. FYR the below attached video - note I’ve excluded the first 2 refresh attempts to reduce file size.

Forest Admin ‣ Data ‣ Units (5)

Hi @Yusra_Bagosher :wave: Have you got any errors logs on your browser console when the checkboxes disappear?

@Arnaud_Moncel we didn’t seen any suspected error in browser console.

Hi @SivaKumarTukanti :wave: welcome to our community.
In order to see what happen, can you give us your project Name please :pray:

EDIT: can you share the smart action code please?

project name : Chalet+

Smart Action : : same code is working as expected before , there is no new changes done on this .

const addAmenitiesAction = {
  name: 'Add Amenities',
  type: 'single',
  endpoint: '/forest/actions/add-amenities',
  fields: [
    {
      field: 'Amenities',
      type: ['Enums'],
      enums: ['None'],
      widget: 'checkboxes',
    },
    {
      field: 'Agent',
      reference: 'c2CUser.userIdKey',
      widget: 'belongsto dropDown',
      isRequired: true,
    },
  ],
  hooks: {
    load: async ({ fields, request }) => {
      const amenities = await getAminities();

      const amenitiesValues = amenities.map((amenity) => {
        return amenity.nameEn;
      });

      fields.Amenities.enums = amenitiesValues;

      return fields;
    },
  },
};

I see two error in your code:

  • inside the Amenties field
    type: ['Enums'] => type: ['Enum']
  • inside the Agent field
    widget: 'belongsto dropDown' => widget: 'belongsto dropdown'

Let me know

1 Like