Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code smells #47

Merged
merged 4 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

### Added

- Initial release
- Initial release

## Version 0.2.0

### Fixed

ipaunov marked this conversation as resolved.
Show resolved Hide resolved
- Fixed code smells and Dependabot alerts
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Notifications Plugin

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.
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.

### Table of Contents

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

#### Integrate with SAP Build Work Zone

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!
Once application is deployed and integrated with SAP Build Work Zone, you can see the notification under fiori notifications icon!

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

Expand Down
10 changes: 4 additions & 6 deletions cds-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ const cds = require("@sap/cds/lib");

if (cds.cli.command === "build") {
// register build plugin
const build = require('@sap/cds-dk/lib/build')
build.register('notifications', {
impl: '@cap-js/notifications/lib/build',
description: 'Notifications build plugin',
taskDefaults: { src: cds.env.folders.srv }
})
cds.build?.register?.('notifications', {
impl: '@cap-js/notifications/lib/build',
taskDefaults: { src: cds.env.folders.srv }
});
}

else cds.once("served", async () => {
Expand Down
4 changes: 2 additions & 2 deletions lib/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const cds = require('@sap/cds')
const { BuildPlugin } = require('@sap/cds-dk/lib/build')
const { BuildPlugin } = cds.build

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

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

async build() {
if(exists(cds.env.requires.notifications.types)) {
if (exists(cds.env.requires.notifications?.types)) {
const fileName = path.basename(cds.env.requires.notifications.types);
await copy(cds.env.requires.notifications.types).to(path.join(this.task.dest, fileName));
}
Expand Down
Loading
Loading