Skip to content

Commit fd2c157

Browse files
authored
Merge pull request #47 from cap-js/fix_code_smells
Fix code smells
2 parents 27efc5c + 01072ec commit fd2c157

File tree

6 files changed

+342
-1690
lines changed

6 files changed

+342
-1690
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
99

1010
### Added
1111

12-
- Initial release
12+
- Initial release
13+
14+
## Version 0.2.0
15+
16+
### Fixed
17+
18+
- Fixed code smells and Dependabot alerts

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Notifications Plugin
44

5-
The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs/node.js/cds-plugins#cds-plugin-packages) that provides support for publishing business notifications.
5+
The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs/node.js/cds-plugins#cds-plugin-packages) that provides support for publishing business notifications in SAP Build WorkZone.
66

77
### Table of Contents
88

@@ -109,7 +109,7 @@ As a pre-requisite to publish the notification, you need to have a [destination]
109109

110110
#### Integrate with SAP Build Work Zone
111111

112-
Once application is deployed and [integrated with SAP Build Work Zone](https://github.com/cap-js/calesi/tree/main/samples/notifications), you can see the notification under fiori notifications icon!
112+
Once application is deployed and integrated with SAP Build Work Zone, you can see the notification under fiori notifications icon!
113113

114114
<img width="1300" alt="Sample Application Demo" style="border-radius:0.5rem;" src="_assets/incidentsNotificationDemo.gif">
115115

cds-plugin.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ const cds = require("@sap/cds/lib");
22

33
if (cds.cli.command === "build") {
44
// register build plugin
5-
const build = require('@sap/cds-dk/lib/build')
6-
build.register('notifications', {
7-
impl: '@cap-js/notifications/lib/build',
8-
description: 'Notifications build plugin',
9-
taskDefaults: { src: cds.env.folders.srv }
10-
})
5+
cds.build?.register?.('notifications', {
6+
impl: '@cap-js/notifications/lib/build',
7+
taskDefaults: { src: cds.env.folders.srv }
8+
});
119
}
1210

1311
else cds.once("served", async () => {

lib/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const cds = require('@sap/cds')
2-
const { BuildPlugin } = require('@sap/cds-dk/lib/build')
2+
const { BuildPlugin } = cds.build
33

44
const { copy, exists, path } = cds.utils
55

@@ -11,7 +11,7 @@ module.exports = class NotificationsBuildPlugin extends BuildPlugin {
1111
}
1212

1313
async build() {
14-
if(exists(cds.env.requires.notifications.types)) {
14+
if (exists(cds.env.requires.notifications?.types)) {
1515
const fileName = path.basename(cds.env.requires.notifications.types);
1616
await copy(cds.env.requires.notifications.types).to(path.join(this.task.dest, fileName));
1717
}

0 commit comments

Comments
 (0)