From a6bf6471d2fb6d96fb12f0a3653b6b353ce4d8f4 Mon Sep 17 00:00:00 2001 From: Ram Prasad GS Date: Wed, 25 Oct 2023 09:54:12 +0530 Subject: [PATCH 1/9] updating the readme file --- README.md | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 8ea2a6b..5844ed0 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,18 @@ The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs - [Setup](#setup) - [Usage](#usage) - [Update Notification Configuration](#update-notification-configuration) - - [Notification Destination](#notification-destination) - [Notification Types Path](#notification-types-path) - [Notification Type Prefix](#notification-type-prefix) - [Add Notification Types](#add-notification-types) - - [Update handlers to publish notification](#update-handlers-to-publish-notification) - - [Simple Notificaiton with title](#simple-notificaiton-with-title) - - [Simple Notificaiton with title & description](#simple-notificaiton-with-title) - - [Custom Notifications with notification types](#simple-notificaiton-with-title) + - [Add code to send notifications](#add-code-to-send-notifications) + - [Simple Notification with title](#simple-notification-with-title) + - [Simple Notification with title and description](#simple-notification-with-title-and-description) + - [Custom Notifications](#custom-notifications) - [Sample Application with notifications](#sample-application-with-notifications) - [In Local Environment](#in-local-environment) - [In Production Environment](#in-production-environment) + - [Notification Destination](#notification-destination) + - [Integrate with SAP Build Work Zone](#integrate-with-sap-build-work-zone) - [Contributing](#contributing) - [Code of Conduct](#code-of-conduct) - [Licensing](#licensing) @@ -41,10 +42,6 @@ In this guide, we use the [Incidents Management reference sample app](https://gi Default Notification config -#### **Notification Destination** - -As a pre-requisite to publish the notification, you need to have a [destination](https://help.sap.com/docs/build-work-zone-standard-edition/sap-build-work-zone-standard-edition/enabling-notifications-for-custom-apps-on-sap-btp-cloud-foundry#configure-the-destination-to-the-notifications-service) configured to publish the notification. In the `package.json` by default destination name `SAP_Notification` is added, you can modify the destination name that you are configuring. - #### **Notification Types Path** When you run `cds add notifications`, it will add `notificationstype.json` file with template for a notification type in the project root folder. You can add the notification types in the `notificationtype.json` file for sending the custom notification types. @@ -78,7 +75,7 @@ Sample: If you want to send the notification when the new incident is reported, ] ``` -### Update handlers to publish notification +### Add code to send notifications In the handler files, connect to the notifications plugin by: @@ -86,26 +83,26 @@ In the handler files, connect to the notifications plugin by: const alert = await cds.connect.to('notifications'); ``` -#### **Simple Notificaiton with title** +#### **Simple Notification with title** You can use the following signature to send the simple notification with title ```js alert.notify({ - recipients: recipients, - priority: priority, - title: title + recipients: ["admin1@test.com","admin2@test.com"], + priority: "HIGH", + title: "New incident is reported!" }); ``` -#### **Simple Notificaiton with title & description** +#### **Simple Notification with title and description** You can use the following signature to send the simple notification with title and description ```js alert.notify({ - recipients: recipients, - priority: priority, - title: title, - description: description + recipients: ["supportuser1@test.com"], + priority: "HIGH", + title: "New high priority incident is assigned to you!", + description: "Incident titled 'Engine overheating' created by 'customer X' with priority high is assigned to you!" }); ``` -#### **Custom Notifications with notification types** +#### **Custom Notifications** You can use the following signature to send the custom notification with pre-defined notification types. ```js alert.notify({ @@ -141,6 +138,12 @@ In local environment, when you publish notification, it is mocked to publish the #### **In Production Environment** +##### **Notification Destination** + +As a pre-requisite to publish the notification, you need to have a [destination](https://help.sap.com/docs/build-work-zone-standard-edition/sap-build-work-zone-standard-edition/enabling-notifications-for-custom-apps-on-sap-btp-cloud-foundry#configure-the-destination-to-the-notifications-service) configured to publish the notification. In the `package.json` by default destination name `SAP_Notification` is added, you can modify the destination name that you are configuring. + +##### **Integrate with SAP Build Work Zone** + Once application is deployed and integrated with SAP Build Work Zone, you can see the notification under fiori notifications icon! Sample Application Demo From e506ee0df73d359a94d5f40119ee736772b877a3 Mon Sep 17 00:00:00 2001 From: Ram Prasad GS Date: Wed, 25 Oct 2023 09:58:10 +0530 Subject: [PATCH 2/9] adding sample app link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5844ed0..c5d127c 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,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, you can see the notification under fiori notifications icon! +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! Sample Application Demo From 039deca174d916496a45d6ae7db67c8aa5544ac9 Mon Sep 17 00:00:00 2001 From: Anmol Binani Date: Wed, 25 Oct 2023 14:17:23 +0530 Subject: [PATCH 3/9] minor change --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c5d127c..b4e4af2 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ -The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs/node.js/cds-plugins#cds-plugin-packages) providing out-of-the box 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. ### Table of Contents - [Setup](#setup) - [Usage](#usage) - [Update Notification Configuration](#update-notification-configuration) - - [Notification Types Path](#notification-types-path) - - [Notification Type Prefix](#notification-type-prefix) + - [**Notification Types Path**](#notification-types-path) + - [**Notification Type Prefix**](#notification-type-prefix) - [Add Notification Types](#add-notification-types) - [Add code to send notifications](#add-code-to-send-notifications) - - [Simple Notification with title](#simple-notification-with-title) - - [Simple Notification with title and description](#simple-notification-with-title-and-description) - - [Custom Notifications](#custom-notifications) + - [**Simple Notification with title**](#simple-notification-with-title) + - [**Simple Notification with title and description**](#simple-notification-with-title-and-description) + - [**Custom Notifications**](#custom-notifications) - [Sample Application with notifications](#sample-application-with-notifications) - - [In Local Environment](#in-local-environment) - - [In Production Environment](#in-production-environment) - - [Notification Destination](#notification-destination) - - [Integrate with SAP Build Work Zone](#integrate-with-sap-build-work-zone) + - [**In Local Environment**](#in-local-environment) + - [**In Production Environment**](#in-production-environment) + - [**Notification Destination**](#notification-destination) + - [**Integrate with SAP Build Work Zone**](#integrate-with-sap-build-work-zone) - [Contributing](#contributing) - [Code of Conduct](#code-of-conduct) - [Licensing](#licensing) From 72d9bc86f2995989fc41ad91fa41295a00eae492 Mon Sep 17 00:00:00 2001 From: Anmol Binani Date: Wed, 25 Oct 2023 14:20:36 +0530 Subject: [PATCH 4/9] remove bold font for sub-item heading --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b4e4af2..f108d1a 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,18 @@ The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs - [Setup](#setup) - [Usage](#usage) - [Update Notification Configuration](#update-notification-configuration) - - [**Notification Types Path**](#notification-types-path) - - [**Notification Type Prefix**](#notification-type-prefix) + - [Notification Types Path](#notification-types-path) + - [Notification Type Prefix](#notification-type-prefix) - [Add Notification Types](#add-notification-types) - [Add code to send notifications](#add-code-to-send-notifications) - - [**Simple Notification with title**](#simple-notification-with-title) - - [**Simple Notification with title and description**](#simple-notification-with-title-and-description) - - [**Custom Notifications**](#custom-notifications) + - [Simple Notification with title](#simple-notification-with-title) + - [Simple Notification with title and description](#simple-notification-with-title-and-description) + - [Custom Notifications](#custom-notifications) - [Sample Application with notifications](#sample-application-with-notifications) - - [**In Local Environment**](#in-local-environment) + - [In Local Environment](#in-local-environment) - [**In Production Environment**](#in-production-environment) - [**Notification Destination**](#notification-destination) - - [**Integrate with SAP Build Work Zone**](#integrate-with-sap-build-work-zone) + - [Integrate with SAP Build Work Zone](#integrate-with-sap-build-work-zone) - [Contributing](#contributing) - [Code of Conduct](#code-of-conduct) - [Licensing](#licensing) @@ -42,11 +42,11 @@ In this guide, we use the [Incidents Management reference sample app](https://gi Default Notification config -#### **Notification Types Path** +#### Notification Types Path When you run `cds add notifications`, it will add `notificationstype.json` file with template for a notification type in the project root folder. You can add the notification types in the `notificationtype.json` file for sending the custom notification types. -#### **Notification Type Prefix** +#### Notification Type Prefix To make notification types unique to the application, prefix is added to the type key. By default, `application name` is added as the prefix. You can update the `prefix` if required. @@ -83,7 +83,7 @@ In the handler files, connect to the notifications plugin by: const alert = await cds.connect.to('notifications'); ``` -#### **Simple Notification with title** +#### Simple Notification with title You can use the following signature to send the simple notification with title ```js alert.notify({ @@ -92,7 +92,7 @@ alert.notify({ title: "New incident is reported!" }); ``` -#### **Simple Notification with title and description** +#### Simple Notification with title and description You can use the following signature to send the simple notification with title and description ```js alert.notify({ @@ -102,7 +102,7 @@ alert.notify({ description: "Incident titled 'Engine overheating' created by 'customer X' with priority high is assigned to you!" }); ``` -#### **Custom Notifications** +#### Custom Notifications You can use the following signature to send the custom notification with pre-defined notification types. ```js alert.notify({ @@ -131,7 +131,7 @@ alert.notify({ ### Sample Application with notifications -#### **In Local Environment** +#### In Local Environment In local environment, when you publish notification, it is mocked to publish the nofication to the console. Notify to console @@ -142,7 +142,7 @@ In local environment, when you publish notification, it is mocked to publish the As a pre-requisite to publish the notification, you need to have a [destination](https://help.sap.com/docs/build-work-zone-standard-edition/sap-build-work-zone-standard-edition/enabling-notifications-for-custom-apps-on-sap-btp-cloud-foundry#configure-the-destination-to-the-notifications-service) configured to publish the notification. In the `package.json` by default destination name `SAP_Notification` is added, you can modify the destination name that you are configuring. -##### **Integrate with SAP Build Work Zone** +##### 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! From 9499c4c5d2f52ad992189edb7c2babbcd080dccb Mon Sep 17 00:00:00 2001 From: Anmol Binani Date: Wed, 25 Oct 2023 14:21:14 +0530 Subject: [PATCH 5/9] remove bold font for sub-item heading --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f108d1a..895dd96 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ The `@cap-js/notifications` package is a [CDS plugin](https://cap.cloud.sap/docs - [Custom Notifications](#custom-notifications) - [Sample Application with notifications](#sample-application-with-notifications) - [In Local Environment](#in-local-environment) - - [**In Production Environment**](#in-production-environment) - - [**Notification Destination**](#notification-destination) + - [In Production Environment](#in-production-environment) + - [Notification Destination](#notification-destination) - [Integrate with SAP Build Work Zone](#integrate-with-sap-build-work-zone) - [Contributing](#contributing) - [Code of Conduct](#code-of-conduct) @@ -136,9 +136,9 @@ In local environment, when you publish notification, it is mocked to publish the Notify to console -#### **In Production Environment** +#### In Production Environment -##### **Notification Destination** +##### Notification Destination As a pre-requisite to publish the notification, you need to have a [destination](https://help.sap.com/docs/build-work-zone-standard-edition/sap-build-work-zone-standard-edition/enabling-notifications-for-custom-apps-on-sap-btp-cloud-foundry#configure-the-destination-to-the-notifications-service) configured to publish the notification. In the `package.json` by default destination name `SAP_Notification` is added, you can modify the destination name that you are configuring. From 258d7da03b2e70f9ea7bdbf9ad84d80f1816d54e Mon Sep 17 00:00:00 2001 From: Anmol Binani Date: Wed, 25 Oct 2023 14:41:14 +0530 Subject: [PATCH 6/9] adding recipients email list --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 895dd96..a9bfb6b 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ alert.notify({ Type: 'String' } ], - Recipients: recipients + Recipients: ["admin1@test.com","admin2@test.com"] }); ``` From 4b7bf311f0c6c967535120cea9ce1da14aacb48f Mon Sep 17 00:00:00 2001 From: Ram Prasad GS Date: Wed, 25 Oct 2023 16:44:36 +0530 Subject: [PATCH 7/9] Update dep5 --- .reuse/dep5 | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.reuse/dep5 b/.reuse/dep5 index fa3d6e0..57f6a79 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -1,7 +1,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: -Upstream-Contact: -Source: +Upstream-Name: notifications +Upstream-Contact: The CAP team +Source: https://github.com/cap-js/notifications Disclaimer: The code in this project may include calls to APIs ("API Calls") of SAP or third-party products or services developed outside of this project ("External Products"). @@ -24,14 +24,6 @@ Disclaimer: The code in this project may include calls to APIs ("API Calls") of you any rights to use or access any SAP External Product, or provide any third parties the right to use of access any SAP External Product, through API Calls. -Files: -Copyright: SAP SE or an SAP affiliate company and contributors +Files: * +Copyright: 2023 SAP SE or an SAP affiliate company and audit-logging contributors. License: Apache-2.0 - -Files: -Copyright: -License: - -Files: -Copyright: -License: From 4d00715f85cdf6e6e52e65abba5d1d1210051674 Mon Sep 17 00:00:00 2001 From: Ram Prasad GS Date: Wed, 25 Oct 2023 16:47:05 +0530 Subject: [PATCH 8/9] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a9bfb6b..8dd30c2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +# 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. From 03a6718f96d76590cb5a97e1dc8c65937ce18978 Mon Sep 17 00:00:00 2001 From: Ram Prasad GS Date: Wed, 25 Oct 2023 16:50:05 +0530 Subject: [PATCH 9/9] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8dd30c2..ee774c0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![REUSE status](https://api.reuse.software/badge/github.com/cap-js/notifications)](https://api.reuse.software/info/github.com/cap-js/notifications) + # 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.