Skip to content

UI5 library: Handle luigi.updateUserSettings custom message from MFE in user settings dialog #5411

Description

@JohannesDoberer

Description

When a custom MFE is rendered inside the user settings dialog (via viewUrl), it can send a custom message with id: 'luigi.updateUserSettings' to update settings data without requiring the user to click "Save". This is not handled in the UI5 library.

How it works in Luigi Core (old)

In core/src/UserSettingsDialog.svelte and core/src/App.svelte, a custom message listener is registered for the key luigi.updateUserSettings. When received, the internal user settings state is updated with the message data.

Current behavior in UI5 library

Core-modular (container) already dispatches custom-message events when an MFE calls LuigiClient.sendCustomMessage(...). However, the UI5 library's UserSettingsDialog.svelte does not listen for this event on the luigi-container it mounts for viewUrl groups.

Expected behavior

The library should:

  1. Listen on the custom-message event from luigi-container instances mounted in user settings MFE groups
  2. Check if event.detail.id === 'luigi.updateUserSettings'
  3. Merge event.detail.data into the internal storedUserSettings state

Where to implement

src/components/userSettings/UserSettingsDialog.svelte — in the mountMfeContainers() function where luigi-container elements are created via renderMicroFrontendContainer.

Original test reference

luigirepo/test/e2e-test-application/cypress/e2e/tests/1-angular/user_settings_dialog.cy.js — test: "Ctx update after storing user settings data using custom messages"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions