Need a special offer?Find out if your project fits.
+

Deeply nested mappings don't

Answered
Luke Deniston asked on June 21, 2019

With nested mappings, flexmonster will not nest options if there's only one item.
However, if the nesting is more than one level deep, the items will not render at the root, but rather be rendered in collapsible panels. See the attached screenshot for an example.
I *think* this is a regression, as I don't remember this behavior on previous versions.

EDIT: I can confirm this is a regression, introduced somewhere in between 2.7.0 and 2.7.3
 

6 answers

Public
Vera Didenko Vera Didenko Flexmonster June 24, 2019

Hello, Luke,
 
Thank you for writing to us.
 
We would like to point out that our team needs more details.
Could you please provide us with a sample (this can be done via email) where the issue is reproducible?
 
This will greatly help our team.
 
We are looking forward to hearing from you.
 
Best Regards,
Vera

Public
Luke Deniston June 24, 2019

I'm not sure I'll be able to provide a sample. Here's an example section from the actual elastic mapping (what is returned by elastic):

'damage': {
  'properties': {
    'id': { 'type':'integer' },
    'name': {
      'properties': {
        'de': { 'type':'keyword' },
        'en': { 'type':'keyword' },
      }
    }
  }
}, 

Then we provide something like this for the mapping argument to flexmonster:
 

{
  'damage.id': { visible: false },
  'damage.name.de': { visible: false },
  'damage.name.en': { caption: 'Damage' }
}

 
In Flexmonster version 2.7.0, this would result in a single row in the "Fields" modal ("Damage"). In Flexmonster 2.7.3, "Damage" is instead nested under "damage > name > Damage".

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster June 25, 2019

Hello Luke,
Thank you for providing us with the example.
 
We have recently added an update to resolve issues with incorrect representation of the deeply nested fields. The default behavior has been changed and now it shows the full path to the field no matter how many fields are visible in the folder.
Could you please specify how critical this change is for your case?
 
Waiting for the update from you.
Regards,
Dmytro

Public
Luke Deniston June 25, 2019

It's critical. We use this nesting pattern quite a bit, and we've already deployed 2.7.3 to production

Public
Tanya Gryshko Tanya Gryshko Flexmonster June 26, 2019

Hello, Luke,

Thank you for specifying the importance of this case.

Our team decided to add an option which would allow not to nest options if there’s only one item. This update can be released on the 15th of July.

Until then we suggest using the version 2.7.0 where everything was working in an expected way. In case you already removed version 2.7.0, you can get it here: https://www.npmjs.com/package/flexmonster

Please let us know if it works for you.

Regards,
Tanya

Public
Tanya Gryshko Tanya Gryshko Flexmonster July 16, 2019

Hello, Luke,
 
We are pleased to inform you that now you can simplify the nested fields. A new simplifyFieldListFolders property was added to Options Object. It indicates whether the folders containing one field should show this field in the root (true) or not (false). Default value: false.
 
For your case, specify simplifyFieldListFolders as true in the report:

report: {
dataSource: {/* ...*/},
options: {
simplifyFieldListFolders: true
}
// ...
}

 
This is provided in the 2.7.10 version of Flexmonster: https://www.flexmonster.com/release-notes/.
 
You are welcome to update the component: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
 
Feel free to write to us in case of questions.
 
Best Regards,
Tanya

Please login or Register to Submit Answer