Data Model Enhancements and Related Features
With the new data model enhancements, you can now have collapsible rows in a comparison table and display more types of information in an individual cell.
-
chargeInformation (type: localizable String) attribute of ChargeEntry object
- initialRowsCount (type: integer) attribute of ComparisonPanelCMSComponent
-
different data formats in the table (boolean values, random text, or price information)
- the adjusting of the initial number of visible rows for a ComparisonPanelCMSComponent (currently, this feature is configured only on the banking storefront)
Displaying a Cell-Value
The OneTimeChargeEntry value in a cell is being displayed with the help of two attributes: price and chargeInformation.
-
Case 1 - chargeInformation has a value - use chargeInformation for display (any random text can go here, e.g. "covered 50%")
- Case 2 - chargeInformation does not have a value but price has a value - use price for the display of an amount (number + currency, e.g. "$15000" )
- Case 3 - chargeInformation does not have a value and price does not have a value (or a value is 0) - display a check mark (e.g. styled tick icon )
- Case 4 - OneTimeChargeEntry doesn't exist at all - display an excluded mark (e.g. styled error icon )
Adjusting the Number of Visible Rows
This feature depends on the initialRowsCount field of ComparisonTableCMSComponent. If initialRowsCount is empty or zero - all rows are visible. If initialRowsCount is less than the total rows number - some fields are hidden.
To manipulate the number of visible rows on the UI, a user can toggle between More Features and Less Features. When More Features button is clicked / touched, it changes it's name to Less Features and opens up (unhides) initially hidden rows. When clicked again, it's name is changed back to More Features and hides initially hidden rows again. If there isn't a number of hidden rows specified, all rows are visible. Also, More Features button and the horizontal line indicators aren't displayed.
The hide / show logic is available in productListerGrid.tag and productListerGridItem.tag. The triggering mechanism for unhiding /hiding rows on the front-end has been implemented through ACC.insurance.moreFeatures JS function located in financialacceleratorstorefront.js file.