Skip to content

feat: Display container related message - #21900

Open
Larisa-Staroverova wants to merge 31 commits into
epic/cpq-containersfrom
feature/CXSPA-14080-display-messages-for-container
Open

feat: Display container related message#21900
Larisa-Staroverova wants to merge 31 commits into
epic/cpq-containersfrom
feature/CXSPA-14080-display-messages-for-container

Conversation

@Larisa-Staroverova

Copy link
Copy Markdown
Contributor

No description provided.

@Larisa-Staroverova
Larisa-Staroverova requested review from a team as code owners August 24, 2026 05:59
}

/**
* Retrieves warning and error groups of the bound container.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Larisa-Staroverova

Suggested change
* Retrieves warning and error groups of the bound container.
* Retrieves warning and error message groups of the bound container.

const errorMessages: string[] = [];
messages?.forEach((message) => {
if (message.severity === Configurator.MessageSeverity.WARNING) {
errorMessages.push(message.message);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's indeed weird, I had it before in the banner component.
What about renaming errorMessages to warningMessages, warningMessages to infoMessages?
Since it's a new component we can do that. I know that some style elements probably still carry names like 'Error'.
What do you think?
@Larisa-Staroverova

* @param messages - Messages issued by the configuration engine
* @returns Messages grouped by the severity they are rendered with
*/
export function splitMessagesBySeverity(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we have this function in a re-use service? That's not that nice for extensibility, imagine someone overrides this component, then still this piece is needed elsewhere
@Larisa-Staroverova

}

/**
* Warning and error groups of the bound container row.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Larisa-Staroverova

Suggested change
* Warning and error groups of the bound container row.
* Warning and error message groups of the bound container row.

</div>
</div>
</div>
<ng-container *ngIf="messages$ | async as messages">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Larisa-Staroverova font size of error messages does not match

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

* is set, container min/max info and required messages are prepended.
*/
messages$: Observable<ConfiguratorMessagesView> =
this.configRouterExtractorService

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ConfiguratorAttributeProductCardComponent used to receive everything via productCardOptions — a purely presentational component. Now it injects five services and builds its own data stream.

The card is rendered per row, respectively per value. For a bundle attribute with 50 values, that means 50 independent subscriptions to the overall configuration, each of which runs getOptionalGroupById — a recursive tree search — on every configuration change. That is O(cards × groups) per update, and on top of that every card pulls the router data.

The parent component already has the configuration. The row's messages should be passed in via productCardOptions, just like everything else.

@Larisa-Staroverova Larisa-Staroverova Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fully agree! I am working on it.

*/
@Injectable({ providedIn: 'root' })
export class ConfiguratorMessageService {
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ConfiguratorMessageService sits in rulebased/core/facade/ and imports ICON_TYPE from @spartacus/storefront. On develop, rulebased/core has zero storefront imports — so this introduces a new dependency direction, triggered by a service that carries CSS class names, ARIA roles and UI key prefixes. It belongs in components/.

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.

3 participants