[Smart Fields] Not Showing Content

Hello!

Around a week and a half ago I had exactly the same approach for smart fields and was working, now the field appears but without the content. I now put a simple one to test and have the same result, that’s what I have:

const { collection } = require("forest-express-mongoose");

// This file allows you to add to your Forest UI:
// - Smart actions: https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions
// - Smart fields: https://docs.forestadmin.com/documentation/reference-guide/fields/create-and-manage-smart-fields
// - Smart relationships: https://docs.forestadmin.com/documentation/reference-guide/relationships/create-a-smart-relationship
// - Smart segments: https://docs.forestadmin.com/documentation/reference-guide/segments/smart-segments
collection("User", {
  actions: [
    {
      name: "Change User Status",
      type: "single",
      fields: [
        {
          field: "Status",
          type: "Enum",
          enums: ["BLOCKED", "UNBLOCKED"],
          required: true,
        },
      ],
    },
  ],

  fields: [{
    field: 'fullname',
    type: 'String',
    get: (User) => {
      console.log(User);
      return User.firstName + ' ' + User.lastName;
    }
  }]
});

ps: it doesn’t even show the console log.
ps2: They are present on the .forestadmin-schema.json

As you can see I have the field, but not the content.

Context

Always used V6, just updated today to 6.4 to see if would fix with no success.

Thanks in advance!
Isadora Rebelo

Hello @Isadora_Rebelo, thanks a lot for your feedback!

I could reproduce your issue with a simple project and forest-express-mongoose@6.4.0 but it seems to work great with the version 6.3.10.

Can you try to downgrade to this version? I would like to validate that I spotted a regression that is causing you trouble.

Thanks

Hi @GuillaumeGautreau yes, downgrading works, on Dev, how can I downgrade on Prod? Coping in the environment?

Thanks : )

Thanks for the rapid response @Isadora_Rebelo,

I created a bug in your bug-tracking system, a developper will take a look at this problem:

If you want to downgrade the dependency in production just run the command npm install forest-express-mongoose@6.3.10 (if you are using npm to manage dependencies) in your production directory, and re-launch your project.

2 Likes

Hi @Isadora_Rebelo,

We just published a new forest-express-mongoose@6.5.1 that should fix your original issue.
If that’s possible for you, would you mind giving it a try?

Let me know if that helps :pray:

2 Likes

Amazing, it’s fixed, thanks a lot guys for the usual efficiency!

2 Likes