-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into devcontainer
- Loading branch information
Showing
35 changed files
with
586 additions
and
1,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
const cds = require('@sap/cds') | ||
|
||
// Add routes to UIs from imported packages | ||
const cds = require("@sap/cds"); | ||
cds.once('bootstrap', (app) => { | ||
app.serve('/incidents').from('@capire/incidents', 'app/incidents/webapp') | ||
app.serve('/incidents/app').from(__dirname,'/app/incidents/webapp') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,56 @@ | ||
{ | ||
"name": "@capire/incidents", | ||
"version": "1.0.0", | ||
"calesi": { | ||
"@cap-js/audit-logging": "*", | ||
"@cap-js/change-tracking": "*", | ||
"@cap-js/notifications": "*", | ||
"@cap-js/attachments": "*", | ||
"@cap-js/telemetry": "*", | ||
"@sap/ams": "*", | ||
"@sap/ams-dev": "*", | ||
"dummy": 0 | ||
}, | ||
"dependencies": { | ||
"@sap/cds": ">=7", | ||
"express": "^4", | ||
"@sap/cds-hana": "^2", | ||
"@sap/xssec": "^3", | ||
"passport": "^0" | ||
"express": "^4" | ||
}, | ||
"devDependencies": { | ||
"@cap-js/sqlite": "^1.0.1", | ||
"@sap/ux-specification": "^1.108.4", | ||
"axios": "^1.4.0", | ||
"chai": "^4.3.7", | ||
"chai-as-promised": "^7.1.1", | ||
"chai-subset": "^1.6.0", | ||
"jest": "^29.5.0", | ||
"@cap-js/sqlite":"^1.0.1" | ||
"chai-subset": "^1.6.0" | ||
}, | ||
"scripts": { | ||
"watch": "cds watch", | ||
"start": "cds-serve", | ||
"test": "npx jest --silent" | ||
}, | ||
"private": true, | ||
"sapux": [ | ||
"app/incidents" | ||
], | ||
"cds": { | ||
"requires": { | ||
"incidents-app": { | ||
"model": "@capire/incidents" | ||
}, | ||
"[production]": { | ||
"db": { | ||
"kind": "hana-cloud" | ||
}, | ||
"auth": { | ||
"kind": "xsuaa" | ||
}, | ||
"approuter": { | ||
"kind": "cloudfoundry" | ||
} | ||
}, | ||
"[development]": { | ||
"auth": { | ||
"kind": "mocked", | ||
"auth": { | ||
"[development]": { | ||
"users": { | ||
"[email protected]": { | ||
"password": "initial", | ||
"roles": ["support"] | ||
}, | ||
"alice": { | ||
"roles": ["support", "admin"] | ||
"roles": [ | ||
"support", | ||
"admin" | ||
] | ||
}, | ||
"bob": { | ||
"roles": ["support"] | ||
"roles": [ | ||
"support" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"db": { | ||
"kind": "sql" | ||
} | ||
} | ||
} | ||
}, | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,58 @@ | ||
# Incident Management | ||
|
||
## Overview | ||
Welcome to the Incident Management reference sample application for CAP and development recommendations provided by the SAP BTP Developer Guide. | ||
|
||
Welcome to the Incident Management reference sample application for CAP and development recommendations provided by the SAP BTP Developer Guide. | ||
This sample application has already been shown at these events: | ||
## Domain Model | ||
|
||
- TechEd keynote demo 2019 | ||
- [TechEd hands-on sessions 2022](https://github.com/SAP-samples/teched2022-AD264/wiki) | ||
- at the recap conference 2023 | ||
The application support team members to create and process incidents on behalf of registered customers. The basic domain model is depicted below. | ||
|
||
## Business Scenario | ||
![domain drawio](xmpls/schema.drawio.svg) | ||
|
||
ACME, a manufacturer of washing machines engages the service of call center to process and manage the incidents reported by its customers. A call center employee (Processor) receives a phone call from the customer of ACME and based on the complaint, he/she creates the new Incident on behalf of customer and adds the conversation. | ||
|
||
These are assumptions that are used in this sample scenario: | ||
- Customer details are already existing within the Customer entity. | ||
- Incidents are always created by the Call Center employee (Processor). | ||
|
||
## Domain | ||
|
||
The application allows customers to create incidents, processed by support team members. | ||
Both add comments to a conversation. | ||
## Setup | ||
|
||
![domain drawio](https://github.com/SAP-samples/cap-sample-incidents-mgmt/assets/12186013/a1de9cf1-1346-427d-b5a2-55a14428e8f5) | ||
Assumed you prepared for CAP development as documented in capire's *[Getting Started > Jumpstart](https://cap.cloud.sap/docs/get-started/jumpstart)* page, ... | ||
|
||
## Run the Incidents Management Application | ||
|
||
1. Clone the Incident Management application repository: | ||
Clone the repository and install dependencies: | ||
|
||
```sh | ||
git clone https://github.com/cap-js/incidents-app | ||
cd incidents-app | ||
``` | ||
|
||
Navigate to the project root folder and edit the value of `name` in `package.json` file to `incidents-app` | ||
|
||
```sh | ||
npm i | ||
npm install | ||
``` | ||
|
||
2. Run the application: | ||
|
||
```sh | ||
cds w | ||
``` | ||
3. Test the application: | ||
|
||
## Run | ||
|
||
Run the application locally: | ||
|
||
```sh | ||
npm t | ||
cds watch | ||
``` | ||
4. Display the user interface of the application. | ||
Then open http://localhost:4004 and navigate to [/incidents/webapp](http://localhost:4004/incidents/webapp/index.html). <br> | ||
(login as `alice`, no password required). | ||
|
||
<details> | ||
<summary> Troubleshooting </summary> | ||
If you get a 403 Forbidden Error and the logon popup doesn't show, try to open a browser in an incognito mode or clear the browser cache. | ||
</details> | ||
|
||
1. Start the application with `cds w`. | ||
2. In a browser, open the server URL: `http://localhost:4004`. | ||
3. There are two URLs under web applications: | ||
|
||
- /launchpage.html uses a [local launchpage](!https://pages.github.tools.sap/cap/golden-path/develop/Launchpage/Launchpage) | ||
- /incidents/webapp/index.html uses the index.html from [ui5 app](!https://pages.github.tools.sap/cap/golden-path/develop/btp-app-create-ui-fiori-elements/btp-app-create-ui-fiori-elements) | ||
|
||
4. When you are prompted to authenticate, use the following credentials: | ||
|
||
- Username: `[email protected]` | ||
- Password: `initial` | ||
|
||
Alternatively, `bob` or `alice` can be used as well. They both hold the required `support` role to execute the app. Additionally, `alice` is an `admin`. | ||
|
||
**Note:** if you get the 403 Forbidden Error and the popup doesn't show, try to open a browser in an incognito mode or clear the browser cache. | ||
|
||
## Deploy the Incident Management Application | ||
|
||
The code base in this repository can be deployed in both SAP BTP, Cloud Foundry runtime and SAP BTP, Kyma runtime. | ||
Follow these steps to deploy the application in the resepective runtime: | ||
## Test | ||
|
||
- [Deploy incident management app to SAP BTP Cloud Foundry Runtime](https://help.sap.com/docs/btp/btp-developers-guide/deploy-cap#deploy-in-cloud-foundry-runtime) | ||
- [Deploy incident management app to SAP BTP Kyma Runtime](https://help.sap.com/docs/btp/btp-developers-guide/deploy-cap#deploy-in-kyma-runtime) | ||
Run enclosed tests with: | ||
|
||
## SAP BTP Developer Guide | ||
```sh | ||
npm test | ||
``` | ||
|
||
The Incident Management application is used as a reference for the SAP BTP Developer guidance. The SAP BTP Developer Guide provides a curated learning journey and best practices for Pro Code developers. The tutorials will walk you through selected guides of the guide with the goal to build and deploy a full-stack application. | ||
|
||
## Deploy | ||
|
||
See: *[BTP Developer Guidelines Deployment Guides](https://help.sap.com/docs/btp/btp-developers-guide/deploy-cap)* |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.