Skip to content

Product Selection OS LWC init#3

Open
kchen-salesforce wants to merge 2 commits intomainfrom
SalesforceLabs/INS/W-21148613/product-selection-lwc
Open

Product Selection OS LWC init#3
kchen-salesforce wants to merge 2 commits intomainfrom
SalesforceLabs/INS/W-21148613/product-selection-lwc

Conversation

@kchen-salesforce
Copy link
Contributor

Overview

Initial implementation of a comprehensive Product Selection Lightning Web Component system for Digital Insurance workflows. This provides a complete product selection and comparison experience integrated with OmniScripts.

What's Being Added

New Apex Service Layer

  • InsuranceRatingApexService.cls (321 lines): New Apex service wrapping Insurance Rating invocable actions
    • Adds POST rating capability via createInsuranceRating
    • Adds PATCH rating/repricing via repriceInsuranceProduct
    • Provides @AuraEnabled methods for LWC integration
    • Includes comprehensive error handling and validation

New Lightning Web Components

Core Component

  • productSelection: New main LWC for product display and selection
    • Brings single-select and multi-select modes to OmniScripts
    • Adds Rating API integration with configurable parameters
    • Introduces custom navigation with state management capabilities
    • Provides structured data output for downstream flow steps

New Utility Modules

  • dataManager.js: New helper for tree structures and grid transformations
  • labelsAndConstants.js: New centralized configuration for validation rules and UI text

Supporting Components

  • productSelectionCompareModal: New modal for side-by-side product comparison
  • productSelectionCustomTreeGrid: New extended tree grid with custom rendering
  • productSelectionCustomTemplate: New cell templates for currency, dates, and lookups

New Configuration Assets

  • 15 new Custom Labels (ProductSelectionLabels.labels): Translation-ready UI text for validation, buttons, and messages
  • Comprehensive README: New documentation with usage examples, configuration guide, and troubleshooting

Capabilities Being Introduced

  • Product cards with premium display and formatted descriptions
  • Product comparison functionality (2-3 products side-by-side)
  • Configurable multi-select with validation (default max: 10)
  • Support for custom product descriptions
  • Flexible rating input handling (reusable and non-reusable)
  • Custom navigation flow control with state clearing

Technical Details

  • Built on API Version 66.0
  • Integrates with Salesforce Insurance Product Rating API
  • Extends OmniscriptBaseMixin for seamless OmniScript integration
  • Follows SLDS styling standards

*/
@AuraEnabled
public static Map<String, Object> postRatingFromLwc(String postPayloadJson) {
InsuranceRatingApexService service = new InsuranceRatingApexService();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we provide postRatingFromLwc from LWC or is that something that customers will add themselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we'd provide postRatingFromLwc as an example currently referenced in the LWC, and then customers could enhance or reuse the code in their own AuraEnabled methods if they want to override

</div>
</div>
<div if:true={displayErrorMsg} class="slds-notify slds-notify_alert slds-alert_error slds-m-bottom_medium" role="alert">
<span class="slds-icon_container slds-m-right_x-small">
Copy link
Collaborator

@lsabaevasf lsabaevasf Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kchen-salesforce Just a heads up, no need to change (nit). I came across this: https://developer.salesforce.com/docs/platform/lwc/guide/create-conditional.html

It sounds like the recommended directives are lwc:if|elseif?else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants