-
Notifications
You must be signed in to change notification settings - Fork 29
Notification preferences screen & pop-up control #3913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
d0293be
Honour notification pop-up preferences and allow type specific rendering
markus-moser b5dc4c8
Add the notification preferences screen
markus-moser 7c3d398
Decrement the unread count on read, and bound the settings table width
markus-moser bbb141c
Keep Send in the profile menu, and expand the viewed notification whe…
markus-moser 5b38759
Automatic frontend build
markus-moser 9750e37
Extract the notification settings row to fix a SonarCloud critical
markus-moser 86d69e0
Automatic frontend build
markus-moser e3a5f98
Differentiate the settings header row from the group headings
markus-moser 804f43e
Automatic frontend build
markus-moser 8e76c05
Let a notification renderer place or defer the attachment
markus-moser e7bd77b
Drop the notification keys studio-backend now ships
markus-moser c4e0cc5
Merge remote-tracking branch 'origin/2026.x' into local/pr3913-live
markus-moser 2269207
Automatic frontend build
markus-moser 4b53258
Regenerate the API spec and client against the merged backend
markus-moser ac67401
Sync translations with studio.en.yaml [automated]
markus-moser cfa4122
Automatic frontend build
markus-moser 5600b0b
Explain a channel that cannot reach the account
markus-moser a1024e5
Automatic frontend build
markus-moser c9e80e5
Review nits: type the Mercure payload, log the optimistic-update catches
markus-moser ed9d0a7
Automatic frontend build
markus-moser 9d0258f
Address review: dirty-after-save, save feedback, scoped unread scan
markus-moser de7fa29
Sync translations with studio.en.yaml [automated]
markus-moser b9ca435
Automatic frontend build
pimcore-deployments 309d348
Keep the avatar badge circular as the unread count grows
markus-moser d08af43
Automatic frontend build
markus-moser 1d56f3f
Address code-review findings on the notification preferences PR
markus-moser fce2d8b
Automatic frontend build
markus-moser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...es/notifications/dynamic-types/definitions/dynamic-type-abstract-notification-channel.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /** | ||
| * This source file is available under the terms of the | ||
| * Pimcore Open Core License (POCL) | ||
| * Full copyright and license information is available in | ||
| * LICENSE.md which is distributed with this source code. | ||
| * | ||
| * @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com) | ||
| * @license Pimcore Open Core License (POCL) | ||
| */ | ||
|
|
||
| import { injectable } from 'inversify' | ||
| import { DynamicTypeAbstract } from '@Pimcore/modules/element/dynamic-types/registry/dynamic-type-registry-abstract' | ||
|
|
||
| /** | ||
| * Presentation for a delivery channel column in the notification preferences. Optional — an | ||
| * unregistered channel still renders a column, with a generic icon and the API's label. | ||
| */ | ||
| @injectable() | ||
| export abstract class DynamicTypeAbstractNotificationChannel extends DynamicTypeAbstract { | ||
| /** Matches the channel id reported by the API, e.g. `email`. */ | ||
| abstract readonly id: string | ||
|
|
||
| /** Icon name from the icon library, shown in the column header. */ | ||
| abstract readonly icon: string | ||
|
|
||
| /** Overrides the API's translation key. */ | ||
| readonly translationKey?: string | ||
| } |
57 changes: 57 additions & 0 deletions
57
...re/modules/notifications/dynamic-types/definitions/dynamic-type-abstract-notification.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /** | ||
| * This source file is available under the terms of the | ||
| * Pimcore Open Core License (POCL) | ||
| * Full copyright and license information is available in | ||
| * LICENSE.md which is distributed with this source code. | ||
| * | ||
| * @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com) | ||
| * @license Pimcore Open Core License (POCL) | ||
| */ | ||
|
|
||
| import React from 'react' | ||
| import { injectable } from 'inversify' | ||
| import { DynamicTypeAbstract } from '@Pimcore/modules/element/dynamic-types/registry/dynamic-type-registry-abstract' | ||
|
|
||
| export interface NotificationRenderProps { | ||
| /** Matches the notification's `type`, e.g. `collab.mention`. */ | ||
| type: string | ||
| title: string | ||
| sender: string | null | ||
| /** Parsed `payload`; null when a notification carries none. */ | ||
| payload: Record<string, unknown> | null | ||
| } | ||
|
|
||
| export interface NotificationDetailRenderProps extends NotificationRenderProps { | ||
| /** Only available once the detail has been fetched. */ | ||
| message?: string | null | ||
| } | ||
|
|
||
| export interface NotificationDetailSlots { | ||
| /** Place it yourself, or ignore it and let the host append it below (see appendsAttachment). */ | ||
| attachment: React.JSX.Element | null | ||
| } | ||
|
|
||
| /** | ||
| * Renders a specific notification type. Either method may return null to fall back to the host's | ||
| * plain title-and-sender rendering, so a definition can enrich only the detail view. | ||
| */ | ||
| @injectable() | ||
| export abstract class DynamicTypeAbstractNotification extends DynamicTypeAbstract { | ||
| /** The notification type id this definition renders. */ | ||
| abstract readonly id: string | ||
|
|
||
| /** Content for the toast; the host supplies the chrome and the action that opens the bell. */ | ||
| getPopupContent (props: NotificationRenderProps): React.JSX.Element | null { | ||
| return null | ||
| } | ||
|
|
||
| /** Content for the expanded row in the notification list. */ | ||
| getDetailContent (props: NotificationDetailRenderProps, slots: NotificationDetailSlots): React.JSX.Element | null { | ||
| return null | ||
| } | ||
|
|
||
| /** Whether the host appends the attachment below custom detail content. */ | ||
| appendsAttachment (): boolean { | ||
| return true | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
assets/js/src/core/modules/notifications/dynamic-types/definitions/notification-channels.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /** | ||
| * This source file is available under the terms of the | ||
| * Pimcore Open Core License (POCL) | ||
| * Full copyright and license information is available in | ||
| * LICENSE.md which is distributed with this source code. | ||
| * | ||
| * @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com) | ||
| * @license Pimcore Open Core License (POCL) | ||
| */ | ||
|
|
||
| import { injectable } from 'inversify' | ||
| import { DynamicTypeAbstractNotificationChannel } from './dynamic-type-abstract-notification-channel' | ||
|
|
||
| /** Channel id the backend reserves for the in-app toast preference. */ | ||
| export const POPUP_CHANNEL_ID = 'popup' | ||
|
|
||
| @injectable() | ||
| export class DynamicTypeNotificationChannelPopup extends DynamicTypeAbstractNotificationChannel { | ||
| readonly id = POPUP_CHANNEL_ID | ||
| readonly icon = 'monitor' | ||
| } | ||
|
|
||
| // Registered here rather than per bundle: the icon is a frontend asset and email is common | ||
| // enough that every contributing bundle would otherwise repeat it. | ||
| @injectable() | ||
| export class DynamicTypeNotificationChannelEmail extends DynamicTypeAbstractNotificationChannel { | ||
| readonly id = 'email' | ||
| readonly icon = 'email' | ||
| } |
18 changes: 18 additions & 0 deletions
18
...dules/notifications/dynamic-types/registry/dynamic-type-notification-channel-registry.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /** | ||
| * This source file is available under the terms of the | ||
| * Pimcore Open Core License (POCL) | ||
| * Full copyright and license information is available in | ||
| * LICENSE.md which is distributed with this source code. | ||
| * | ||
| * @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com) | ||
| * @license Pimcore Open Core License (POCL) | ||
| */ | ||
|
|
||
| import { injectable } from 'inversify' | ||
| import { DynamicTypeRegistryAbstract } from '@Pimcore/modules/element/dynamic-types/registry/dynamic-type-registry-abstract' | ||
| import { type DynamicTypeAbstractNotificationChannel } from '../definitions/dynamic-type-abstract-notification-channel' | ||
|
|
||
| /** Channel presentation keyed by channel id; the column set itself comes from the API. */ | ||
| @injectable() | ||
| export class DynamicTypeNotificationChannelRegistry | ||
| extends DynamicTypeRegistryAbstract<DynamicTypeAbstractNotificationChannel> {} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.