Add notification configuration to the configs

This commit is contained in:
Clemente Raposo 2023-02-02 11:42:55 +00:00
parent 37deb4787c
commit 6330f2bb8f
3 changed files with 128 additions and 1 deletions

View file

@ -49,6 +49,7 @@ services:
$legacyActionResolverMap: '%legacy.action_resolver%'
$massupdate: '%massupdate%'
$uiConfigs: '%ui%'
$notificationsConfigs: '%notifications%'
$systemSettings: '%system.settings%'
$extensions: '%extensions%'
$upgradeConfig: '%upgrades%'

View file

@ -0,0 +1,124 @@
parameters:
notifications:
module: 'alerts'
class: 'notifications'
maxListHeight: 350
direction: 'desc'
autoRefreshFrequency: 60000 #1 minutes
showNoDataMessage: true
noDataLabel: 'LBL_NOTIFICATIONS_NONE'
create: null
item:
collapsible: false
collapseLimit: 200
itemClass: 'notifications-item'
buttonGroupClass: 'd-flex flex-column align-items-end notifications-actions'
containerClass: 'flex-row align-items-start py-2 justify-content-start containerClass'
dynamicClass: [ 'is_read' ]
flexDirection: 'flex-row'
layout:
body:
class: 'itemContentClass'
rows:
-
cols:
-
field:
name: 'target_module_type'
type: 'icon'
labelDisplay: 'none'
hideIfEmpty: false
class: 'font-weight-bold stroke-danger-light stroke-hover-danger'
-
class: 'd-flex flex-column flex-grow-1 pl-2 pr-2'
align: 'start'
cols:
-
field:
name: 'target_module_label'
labelDisplay: 'none'
labelClass: 'm-0'
display: 'readonly'
hideIfEmpty: true
class: 'small font-weight-bold text-muted text-uppercase'
-
field:
name: 'name'
labelDisplay: 'none'
labelClass: 'm-0'
display: 'readonly'
hideIfEmpty: false
class: 'font-weight-bold pb-1'
-
field:
name: 'date_entered'
labelDisplay: 'none'
labelClass: 'm-0'
display: 'readonly'
hideIfEmpty: true
class: 'small'
-
field:
name: 'is_read'
labelDisplay: 'none'
display: 'none'
hideIfEmpty: true
-
class: 'd-flex flex-column'
align: 'start'
justify: 'start'
cols:
-
actionSlot: 'true'
class: 'haha'
actions:
-
key: 'delete'
icon: 'cross'
titleKey: 'LBL_DISMISS'
asyncProcess: true
params:
displayConfirmation: true
confirmationLabel: 'NTC_DELETE_CONFIRMATION'
klass: ['btn fill-danger-light fill-hover-danger border-0 btn-sm p-0']
modes: ['detail', 'edit']
acl: []
-
key: 'snooze'
icon: 'clock'
titleKey: 'LBL_SNOOZE'
asyncProcess: true
params:
displayConfirmation: true
confirmationLabel: 'NTC_SNOOZE_CONFIRMATION'
klass: ['btn stroke-danger-light stroke-hover-danger border-0 btn-sm p-0']
modes: ['detail', 'edit']
acl: []
listActionsClass: "d-flex align-items-center justify-content-end notification-list-actions pr-2 pt-1"
listActionsButtonClass: "line-actions-button btn btn-link"
listActionsButtonGroupClass: 'd-flex justify-content-end'
listActions:
-
key: 'delete-all'
label: 'LBL_DISMISS_ALL'
labelKey: 'LBL_DISMISS_ALL'
asyncProcess: true
params:
displayConfirmation: true
confirmationLabel: 'NTC_DELETE_CONFIRMATION'
module: 'alerts'
klass: ['']
modes: ['detail', 'list']
acl: []
-
key: 'mark-as-read'
label: 'LBL_DISMISS_ALL'
labelKey: 'LBL_DISMISS_ALL'
asyncProcess: true
params:
displayConfirmation: true
confirmationLabel: 'NTC_DELETE_CONFIRMATION'
module: 'alerts'
klass: ['']
modes: []
acl: []

View file

@ -127,6 +127,7 @@ class SystemConfigHandler extends LegacyHandler implements SystemConfigProviderI
array $recordViewActionLimits,
array $listViewLineActionsLimits,
array $uiConfigs,
array $notificationsConfigs,
array $extensions,
array $logoutConfig,
array $sessionExpiredConfig,
@ -154,7 +155,8 @@ class SystemConfigHandler extends LegacyHandler implements SystemConfigProviderI
$this->injectedSystemConfigs['listview_actions_limits'] = $listViewActionsLimits;
$this->injectedSystemConfigs['recordview_actions_limits'] = $recordViewActionLimits;
$this->injectedSystemConfigs['listview_line_actions_limits'] = $listViewLineActionsLimits;
$this->injectedSystemConfigs['ui'] = $uiConfigs;
$this->injectedSystemConfigs['ui'] = $uiConfigs ?? [];
$this->injectedSystemConfigs['ui']['notifications'] = $notificationsConfigs ?? [];
$this->injectedSystemConfigs['extensions'] = $extensions;
$logoutConfig = $logoutConfig ?? [];