Quick compatibility fix to support dismissing notifications from legacy list (#2283)

This commit is contained in:
Andrew Henry
2019-02-12 11:32:23 -08:00
committed by Deep Tailor
parent 1a06702dbe
commit 037264b0bf
2 changed files with 24 additions and 1 deletions

View File

@ -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
}
});