IBX-12188: Replaced legacy alerts and notifications with the design-system Alert - #2034
Conversation
| // Transitional: keeps the spacing legacy `alert.html.twig` call sites got from Bootstrap's `.alert` margin. | ||
| // Goes away together with the adapter template. |
There was a problem hiding this comment.
change these comments into TODO: comment
| {# | ||
| Compatibility wrapper around the design-system <twig:ibexa:alert> component, kept for the | ||
| existing `include`/`embed` call sites. New code should use <twig:ibexa:alert> directly. | ||
| Legacy params `size`, `show_subtitle_below` and `attr` are ignored; the `title` block is gone (title is a plain string prop). | ||
| Inline renders get `ibexa-alert-adapter`, which restores the bottom margin Bootstrap's `.alert` used to add. | ||
| #} |
There was a problem hiding this comment.
Change into TODO comment
| const notificationNode = container.querySelector('.alert'); | ||
|
|
||
| notificationsContainer.append(notificationNode); | ||
| appendNotification(notificationsContainer, { label, message: escapeHTML(message) }); |
There was a problem hiding this comment.
what would you say to escapeHTML inside appendNotification instead of here?
| subtitle = null, | ||
| size = 'medium', | ||
| iconName: iconNameProp = null, | ||
| iconName = null, |
There was a problem hiding this comment.
can we set defaults to empty strings to avoid ?? '' later in code?
9ec4d8c to
1cf9873
Compare
9fc12fc to
b82a69c
Compare
…ystem Alert Co-Authored-By: Claude <noreply@anthropic.com>
49927c7 to
4bae372
Compare
TEMPORARY
|
Co-Authored-By: Claude <noreply@anthropic.com>
…helper.js Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
The notification helper now always escapes the message and hands the not yet appended node to onShow, so a caller that needs markup in the message injects it itself. Sub-items, the only user of rawPlaceholdersMap, does that in its existing onShow callback. Co-Authored-By: Claude <noreply@anthropic.com>
…n helper The helper is imported by CKEditor plugins bundled in the richtext Encore config, which does not alias @ibexa-design-system, so importing the Alert class there broke that build. The notification entries own the instance now. Co-Authored-By: Claude <noreply@anthropic.com>
The toast template passed iconPath as a runtime placeholder, so the design-system Alert took the explicit-path branch and the placeholder was replaced with an empty string for every notification without a custom icon, leaving an empty <use>. The template now lets the component pick the icon for its type, and customIconPath is applied to the rendered node instead. Co-Authored-By: Claude <noreply@anthropic.com>
The forgot-password confirmation carried a copy-pasted empty extra_content block, which now renders an empty description node and its gap, and it still overrode the icon with the legacy bare checkmark while the sibling reset-password alert uses the component default; both are gone. The reset-password alert is rendered directly rather than through the adapter, so it gets the missing bottom spacing from the login stylesheet. The notifications container no longer passes icon_path, which the toast template stopped using. The message placeholder is replaced through a function so that a message containing $&, $` or $' is not read as a replacement pattern. Co-Authored-By: Claude <noreply@anthropic.com>
Both alerts are hidden with a single-class modifier, which used to outrank the legacy .ibexa-alert rules because those came earlier in the same stylesheet. The design-system .ids-alert display declaration is emitted after ibexa.scss (ibexa-ids-assets.scss is the last file of the ibexa-admin-ui-layout-css entry), so at equal specificity it now wins and the alerts showed on opening the modal and stayed visible when closed. The modifiers are doubled to outrank it. Co-Authored-By: Claude <noreply@anthropic.com>
4bae372 to
883520d
Compare
|




Warning
Contains a TEMPORARY
dependencies.jsoncommit pinningdesign-system-twig + admin-ui-assets (IBX-12188-alert-component)for browser tests. Remove that commit and theibexa/admin-ui-assetsIBX-12188-alert-component[TMP] branch before merging.Related PRs:
Description:
Legacy alerts and toast notifications now render the design-system Alert:
ui/component/alert/alert.html.twigandui-dev/.../common/alert/alert.jsare deprecated adapters over<twig:ibexa:alert>/@ids-components/components/Alert— the existinginclude/embedcall sites across packages keep working (size,show_subtitle_below,attrand thetitleblock are no longer supported). Inline renders getibexa-alert-adapterfor the bottom margin Bootstrap's.alertused to add.notification.html.twigis rendered once per type intodata-template-<type>;admin.notifications.js/admin.error.page.jsinitialise the DS Alert behaviour on each toast and dismiss through it (no BootstrapAlert).ibexa.helpers.notification.*API unchanged._alerts.scssremoved; onlyids-alert*classes remain (Behat locators and the invitation-modal JS updated).Merge order: after design-system + design-system-twig (and an admin-ui-assets bump to a design-system build containing
Alert).For QA:
Login with wrong credentials (inline error alert); publish content (success toast auto-closes after 5 s, error toasts stay until closed); reset-password confirmation; user invitation modal warnings (close hides them); Content type edit "non-translatable fields" warning.
Documentation:
Legacy
alert.html.twigparamssize,show_subtitle_below,attrand thetitleblock are dropped; new code should use<twig:ibexa:alert>.