@memberjunction/ng-notifications 2.127.0 → 2.129.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -50,8 +50,15 @@ export declare class MJNotificationService {
|
|
|
50
50
|
CreateNotification(title: string, message: string, resourceTypeId: string | null, resourceRecordId: string | null, resourceConfiguration: any | null, displayToUser?: boolean): Promise<UserNotificationEntity>;
|
|
51
51
|
/**
|
|
52
52
|
* Refresh the User Notifications from the database. This is called automatically when the service is first loaded after login occurs.
|
|
53
|
+
* Uses UserInfoEngine for centralized data access with local caching.
|
|
53
54
|
*/
|
|
54
55
|
static RefreshUserNotifications(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Update notification observables from existing in-memory data without doing a database query.
|
|
58
|
+
* This is efficient for cases where notifications have been modified locally (e.g., marking as read)
|
|
59
|
+
* and we just need to notify subscribers of the change.
|
|
60
|
+
*/
|
|
61
|
+
static UpdateNotificationObservables(): void;
|
|
55
62
|
/**
|
|
56
63
|
* Creates a message that is not saved to the User Notifications table, but is displayed to the user.
|
|
57
64
|
* @param message - text to display
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.service.d.ts","sourceRoot":"","sources":["../../src/lib/notifications.service.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"notifications.service.d.ts","sourceRoot":"","sources":["../../src/lib/notifications.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAGvF,OAAO,EAAE,mBAAmB,EAAwB,MAAM,sCAAsC,CAAC;AACjG,OAAO,EAAmB,UAAU,EAAW,MAAM,MAAM,CAAC;;AAE5D;;;GAGG;AACH,qBAGa,qBAAqB;IAYpB,OAAO,CAAC,mBAAmB;IAXvC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAwB;IAChD,OAAO,CAAC,MAAM,CAAC,OAAO,CAAkB;IAExC,OAAO,C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M9H,qBAAqB;6CAArB,qBAAqB;CA+MjC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { LogError, Metadata
|
|
2
|
+
import { LogError, Metadata } from '@memberjunction/core';
|
|
3
|
+
import { UserInfoEngine } from '@memberjunction/core-entities';
|
|
3
4
|
import { MJEventType, MJGlobal } from '@memberjunction/global';
|
|
4
5
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
@@ -148,29 +149,31 @@ export class MJNotificationService {
|
|
|
148
149
|
}
|
|
149
150
|
/**
|
|
150
151
|
* Refresh the User Notifications from the database. This is called automatically when the service is first loaded after login occurs.
|
|
152
|
+
* Uses UserInfoEngine for centralized data access with local caching.
|
|
151
153
|
*/
|
|
152
154
|
static async RefreshUserNotifications() {
|
|
153
155
|
try {
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
});
|
|
162
|
-
if (result && result.Success) {
|
|
163
|
-
MJNotificationService._userNotifications = result.Results;
|
|
164
|
-
// Emit to observables
|
|
165
|
-
MJNotificationService._notifications$.next(result.Results);
|
|
166
|
-
MJNotificationService._unreadCount$.next(MJNotificationService.UnreadUserNotificationCount);
|
|
167
|
-
MJNotificationService._loaded = true;
|
|
168
|
-
}
|
|
156
|
+
// Use UserInfoEngine for centralized, cached access
|
|
157
|
+
const engine = UserInfoEngine.Instance;
|
|
158
|
+
MJNotificationService._userNotifications = engine.UserNotifications;
|
|
159
|
+
// Emit to observables
|
|
160
|
+
MJNotificationService._notifications$.next(engine.UserNotifications);
|
|
161
|
+
MJNotificationService._unreadCount$.next(MJNotificationService.UnreadUserNotificationCount);
|
|
162
|
+
MJNotificationService._loaded = true;
|
|
169
163
|
}
|
|
170
164
|
catch (e) {
|
|
171
165
|
LogError(e);
|
|
172
166
|
}
|
|
173
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Update notification observables from existing in-memory data without doing a database query.
|
|
170
|
+
* This is efficient for cases where notifications have been modified locally (e.g., marking as read)
|
|
171
|
+
* and we just need to notify subscribers of the change.
|
|
172
|
+
*/
|
|
173
|
+
static UpdateNotificationObservables() {
|
|
174
|
+
MJNotificationService._notifications$.next(MJNotificationService._userNotifications);
|
|
175
|
+
MJNotificationService._unreadCount$.next(MJNotificationService.UnreadUserNotificationCount);
|
|
176
|
+
}
|
|
174
177
|
/**
|
|
175
178
|
* Creates a message that is not saved to the User Notifications table, but is displayed to the user.
|
|
176
179
|
* @param message - text to display
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.service.js","sourceRoot":"","sources":["../../src/lib/notifications.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"notifications.service.js","sourceRoot":"","sources":["../../src/lib/notifications.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAA0B,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAwC,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGrG,OAAO,EAAE,eAAe,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;;;AAE5D;;;GAGG;AAIH,MAAM,OAAO,qBAAqB;IAYZ;IAXZ,MAAM,CAAC,SAAS,CAAwB;IACxC,MAAM,CAAC,OAAO,GAAY,KAAK,CAAC;IAEhC,MAAM,CAAC,UAAU,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;IACxD,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;IAClC,UAAU,GAAG,IAAI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CAAC;IAC9F,CAAC;IAED;;;;;OAKG;IACI,wBAAwB,CAAC,OAAe,EAAE,QAA2D,SAAS,EAAE,SAAkB;QACvI,MAAM,KAAK,GAAyB;YAClC,OAAO,EAAE,OAAO;YAChB,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE;YAC3C,QAAQ,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;YACnD,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE;SACnC,CAAA;QACD,IAAI,SAAS;YACX,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;;YAE5B,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;+EA9MU,qBAAqB;gEAArB,qBAAqB,WAArB,qBAAqB,mBAFpB,MAAM;;iFAEP,qBAAqB;cAHjC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-notifications",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.129.0",
|
|
4
4
|
"description": "MemberJunction: Simple Angular library for displaying user notifications",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@progress/kendo-angular-notification": "16.2.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@memberjunction/core": "2.
|
|
28
|
-
"@memberjunction/core-entities": "2.
|
|
29
|
-
"@memberjunction/global": "2.
|
|
30
|
-
"@memberjunction/graphql-dataprovider": "2.
|
|
27
|
+
"@memberjunction/core": "2.129.0",
|
|
28
|
+
"@memberjunction/core-entities": "2.129.0",
|
|
29
|
+
"@memberjunction/global": "2.129.0",
|
|
30
|
+
"@memberjunction/graphql-dataprovider": "2.129.0",
|
|
31
31
|
"tslib": "^2.3.0",
|
|
32
32
|
"rxjs": "^7.8.1"
|
|
33
33
|
},
|