File tree Expand file tree Collapse file tree 4 files changed +44
-9
lines changed Expand file tree Collapse file tree 4 files changed +44
-9
lines changed Original file line number Diff line number Diff line change 6
6
readFileContent,
7
7
} = require ( "./lib/utils" ) ;
8
8
9
- global . alert = {
10
- notify : notifier . postNotification ,
11
- } ;
12
-
13
9
cds . once ( "served" , ( ) => {
14
10
/**
15
11
* For local testing initialise VCAP_SERVICES variables for the application
@@ -38,4 +34,3 @@ cds.once("served", () => {
38
34
}
39
35
} ) ;
40
36
41
- module . exports = { alert : alert } ;
Original file line number Diff line number Diff line change 12
12
" srv"
13
13
],
14
14
"dependencies" : {
15
- "@sap-cloud-sdk/core" : " ^1.54.2"
15
+ "@sap-cloud-sdk/core" : " ^1.54.2"
16
+ },
17
+ "devDependencies" : {
18
+ "jest" : " ^29.6.4"
16
19
},
17
20
"scripts" : {
18
21
"lint" : " npx eslint ." ,
19
22
"test" : " npx jest --silent"
20
23
},
21
- "devDependencies" : {
22
- "jest" : " ^29.6.4"
23
- }
24
+ "cds" : {
25
+ "requires" : {
26
+ "kinds" : {
27
+ "notifications" : {
28
+ "[development]" : {
29
+ "kind" : " notify-to-console"
30
+ }
31
+ },
32
+ "notify-to-console" : {
33
+ "impl" : " @cap-js/alert-notification/srv/notifyToConsole" ,
34
+ "outbox" : false
35
+ }
36
+ }
37
+ }
38
+ }
24
39
}
Original file line number Diff line number Diff line change
1
+ const AlertNotificationService = require ( './service' )
2
+
3
+ module . exports = class NotifyToConsole extends AlertNotificationService {
4
+ async init ( ) {
5
+
6
+ // call AlertNotificationService's init
7
+ await super . init ( )
8
+ }
9
+ }
Original file line number Diff line number Diff line change 2
2
* TODO: Add the entry point for the Plugin Service here.
3
3
* We will branch out for development and production profile here
4
4
*/
5
+
6
+ const cds = require ( '@sap/cds' )
7
+ const notifier = require ( "../lib/notifications" ) ;
8
+
9
+ // REVISIT: cds.OutboxService or technique to avoid extending OutboxService
10
+ const OutboxService = require ( '@sap/cds/libx/_runtime/messaging/Outbox' )
11
+
12
+ module . exports = class AlertNotificationService extends OutboxService {
13
+ async init ( ) {
14
+
15
+ // call OutboxService's init
16
+ await super . init ( )
17
+
18
+ this . notify = notifier . postNotification
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments