mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 07:38:15 +00:00
Quick compatibility fix to support dismissing notifications from legacy list (#2283)
This commit is contained in:
committed by
Deep Tailor
parent
1a06702dbe
commit
037264b0bf
@ -43,12 +43,25 @@ define(
|
||||
* Launch a dialog showing a list of current notifications.
|
||||
*/
|
||||
$scope.showNotificationsList = function () {
|
||||
let notificationsList = openmct.notifications.notifications.map(notification => {
|
||||
if (notification.model.severity === 'alert' || notification.model.severity === 'info') {
|
||||
notification.model.primaryOption = {
|
||||
label: 'Dismiss',
|
||||
callback: () => {
|
||||
let currentIndex = notificationsList.indexOf(notification);
|
||||
notification.dismiss();
|
||||
notificationsList.splice(currentIndex, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return notification;
|
||||
})
|
||||
dialogService.getDialogResponse('overlay-message-list', {
|
||||
dialog: {
|
||||
title: "Messages",
|
||||
//Launch the message list dialog with the models
|
||||
// from the notifications
|
||||
messages: openmct.notifications.notifications
|
||||
messages: notificationsList
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user