Hi there , we detected some regression on smart fields arrays referencing dynamic collections. This regression seem pretty recent as this was working last Friday (2022/10/28). Please find some more info in the following sections.
Feature(s) impacted
Smart fields with string array type referencing dynamic collections
Observed behavior
It seems like smart fields of type ['String']
are no longer sent in the creation or update payload attributes
when using checkboxes or a dropdown referencing a dynamic collection (this feature was working on Friday, Oct. 28, 2022).
Minimal reproduction steps:
- Setup minimal collection with a smart field of type [βStringβ]:
// forest/minimal.js
const { collection } = require('forest-express-sequelize');
collection('minimal', {
fields: [
{
field: 'smartField',
type: ['String'],
get: (record) => console.log('smartField.get', record),
set: (record, fieldValue) => console.log('smartField.set', record, fieldValue),
},
],
});
// models/minimal.js
module.exports = (sequelize, DataTypes) => {
const { Sequelize } = sequelize;
const Minimal = sequelize.define(
'minimal',
{
id: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: Sequelize.literal('uuid_generate_v4()'),
},
},
{
tableName: 'minimal',
schema: config.db.schema,
createdAt: false,
updatedAt: false,
},
);
return Minimal;
};
-
Setup the field to reference a dynamic collection using the Checkboxes or Dropdown components:
-
The smart field is no longer present in the create or update payloads (see video on WeTransfer: https://we.tl/t-HRlQYhDyba)
This change might be related to the recent patch following this issue: Smart action field hook not triggering for array type
Expected behavior
The expected behavior is to received the selected fields in the attributes
property of the payload like described in the documentation and as it was previously the case.
Context
- Project name: folk
- Team name: Folk
- Environment name: All environments
- Agent type & version: forest-express-sequelize@8.5.0