Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

MyNotificationDataType #9402


User avatar
0
JakeMem created

I am trying to send notification as well as the progress of an Import to the UI. (Angular). I have changed the "abp.js" in the angular code added the Message Formatter Problem I am facing is the codes are wiredup using the "Properties" to read the message or any content within it..

Please suggest me what should I do to polpulate the "properties" (Please check the difference between the Data from the database below), if I am missing something or just have to pick the data from "Message" property..Or any better approach to achieve this? I am planning to read Message for Notification popup and Progress property to Update a Progress bar.

abp.notifications.messageFormatters['MyProject.MyProject.DataModules.ImportEventProgressData'] = function (userNotification) {
        userNotification.notification.severity=abp.notifications.severity.CUSTOMLOG;
        console.log('userNotification',userNotification);        
          return userNotification.notification.data.message || userNotification.notification.data.properties.Message;
    };

DATA FROM THE TABLE [abptenantnotifications]: Difference I publishing with 3 Types of Notification data (First on is the custom and Second and Third are the default within ANZ)

MyProject.MyProject.DataModules.ImportEventProgressData, MyProject.Application, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null

{"Message":"DMC-H160-B-63-51-2000-00A-921A-A_001-00_SX-US.xml is being Imported","Progress":"23.3","Type":"MyProject.MyProject.DataModules.ImportEventProgressData","Properties":{}}

Abp.Notifications.MessageNotificationData, Abp, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null

{"Message":"MyProject","Name":"DMC-H160-B-63-51-0000-00A-030A-B_001-00_SX-US.xml is being Imported"","Type":"Abp.Notifications.MessageNotificationData","Properties":{"Message":"MyProject","Name":"DMC-H160-B-63-51-0000-00A-030A-B_001-00_SX-US.xml is being Imported""}}

Abp.Notifications.LocalizableMessageNotificationData, Abp, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null

{"Message":{"SourceName":"MyProject","Name":"DMC-H160-B-63-51-0000-00A-030A-B_001-00_SX-US.xml is being Imported"},"Type":"Abp.Notifications.LocalizableMessageNotificationData","Properties":{"Message":{"SourceName":"MyProject","Name":"DMC-H160-B-63-51-0000-00A-030A-B_001-00_SX-US.xml is being Imported"}}}

ASP.NET CORE & Angular .NET Core 3.1 v8.1.0


1 Answer(s)