New layout refresh problem

Hi @Louis-Marie,

The elements you shared in private allowed to see more in details what happened.
The problem does not come from your layout, it is located in the smart action load hook mechanism.

We were not able to reproduce locally.

At some point your server sends the smart action fields with the missing enum.

Can I ask you to put console.log(fields) in your load function?
This would allow us to check if the enum value were drop before or after the function call.

Regards

Hi @Sliman_Medini

ok, thank you for your suggestion.
We are progressing…

I started adding the console.log(fields) to my load function in my vusers collection, and nothing was logged, so I didn’t understand what was wrong.

After that, I remembered that I have exactly the same smart action name in another collection named vusers_monitorings, which points to the same endpoint.

Let’s see:

Liana.collection('users', {
  actions: [
    ...
    { name: 'Mail request user action',
      type: 'bulk',
      endpoint: 'forest/actions/mails/request_user_action',
      fields: [{
        field: 'Mail_template',
        ...
       }],
      hooks: {
        load: ({ fields /* , request */ }) => {
          console.log('******** users ***************');
          console.log(fields);
          ...
        },
      },
    },
    ...
    },
  ],
});

and for the other collection:

Liana.collection('vuser_monitorings', {
  actions: [
    ...
    { name: 'Mail request user action',
      type: 'bulk',
      endpoint: 'forest/actions/mails/request_user_action',
      fields: [{
        field: 'Mail_template',
        ...
       }],
      hooks: {
        load: ({ fields /* , request */ }) => {
          console.log('******** vuser_monitorings ***************');
          console.log(fields);
          ...
        },
      },
    },
    ...
    },
  ],
});

And the result:

  • in Development environment, the log of users is displayed correctly.
  • in Staging environment, the log of vuser_monitorings is displayed when I am activating the action in users collection.

That is the source of the problem.
==> the wrong load hook is called when two smart actions have the same name in two different collections.
It explains my issue, because my Dummy item was added in the users collection only.

Could you please try this scenario and let me know if you are able to reproduce this issue?
Reminder: for me, it happens only in Staging, and Production (not in Development).

Thanks in advance.

Hi @Louis-Marie,

Yes we are progressing :slight_smile:

We reproduced the issue “2 smart actions with same name”.
As a workaround for now, you can make your smart action names unique.

A bug ticket was created, you can follow the resolution here.

EDIT: Having different names for smart actions is not enough. Endpoint must be also different.

Regards

Hi team,

I can see that the problem still persist.
I have multiple actions with the same issue, and if I had to change any action name, I would have to redesign all buttons and permissions in all environments, in all collections involved.

Would it be possible for you to fix this issue please?

Thanks in advance
Louis-Marie

PS. I have updated my forest release, but nothing changed

  "meta": {
    "liana": "forest-express-sequelize",
    "liana_version": "8.5.11",
    "stack": {
      "database_type": "multiple",
      "engine": "nodejs",
      "engine_version": "14.17.0",
      "orm_version": "5.22.3"
    }
  }

Hello,
Thank for the report, but unfortunately this issue will not be fixed because the new agent support it.

Hi @Louis-Marie,

Sorry for this thorn in the side.

Unfortunately for all the Forest Admin users having this issue with Smart Actions, we decided not to spend our development team time on a fix to privilege new features for the future. We estimated that the workaround is an acceptable solution while waiting for the future of Forest Admin agents (ie the new Node.js agent built from scratch this year) to propagate. Yet, we understand this can be painful to adapt the visibility and permissions while renaming an action.

The brand new agent solves this issue by design.
But the migration, if you try it, won’t be an easy task, as the new agent introduces a different paradigm, and will very likely take a lot more time than renaming a few actions in you existing admin panel setup.

Don’t hesitate the reach out our Customer Support team if you intent to migrate :pray: