Fiori extension project

This commit is contained in:
Christian Georgi
2022-07-25 17:36:17 +02:00
parent a0d5355f7d
commit 692ea3ddd2
8 changed files with 4481 additions and 0 deletions

5
.gitignore vendored
View File

@@ -18,3 +18,8 @@ reviews/msg-box
reviews/db/test.db
*.openapi3.json
*.db
!fiori-ext/node_modules/
!fiori-ext/node_modules/@capire/
!fiori-ext/node_modules/@capire/fiori/

22
fiori-ext/README.md Normal file
View File

@@ -0,0 +1,22 @@
# Welcome to your Extension Project for the CAP Bookshop Fiori App
It contains these folders and files, following our recommended project layout:
File or Folder | Purpose
---------|----------
`app/` | content for UI frontends goes here
`db/` | your domain models and data go here
`srv/` | your service models and code go here
`package.json` | project metadata and configuration
`readme.md` | this getting started guide
## Next Steps
- Runs `cds login ...`
- Runs `cds pull ...`
## Learn More
Learn more at https://cap.cloud.sap/docs/get-started/.

View File

@@ -0,0 +1,31 @@
using { sap.capire.orders, OrdersService, sap.common } from '@capire/fiori';
// using { sap.common } from '@sap/cds/common'; //> TODO this creates duplicated definitions
namespace Z_bookshop.extension;
extend orders.Orders with {
Z_priority : String @assert.range enum {high; medium; low} default 'medium' ;
Z_SalesRegion : Association to Z_SalesRegion;
}
entity Z_SalesRegion: common.CodeList {
key regionCode : String(11);
}
// --- UI ---
annotate orders.Orders with {
Z_priority @title : '{i18n>Orders_priority_col}'
};
annotate Z_SalesRegion with {
name @title : '{i18n>SalesRegion_name_col}'
};
annotate OrdersService.Orders with @UI.LineItem : [
... up to { Value: OrderNo },
{ Value : Z_priority },
{ Value : Z_SalesRegion.name },
...
];

View File

@@ -0,0 +1,2 @@
SalesRegion_name_col = Sales Region
Orders_priority_col = Priority

4369
fiori-ext/node_modules/@capire/fiori/index.csn generated vendored Normal file

File diff suppressed because it is too large Load Diff

45
fiori-ext/package.json Normal file
View File

@@ -0,0 +1,45 @@
{
"name": "@capire/fiori-ext",
"version": "1.0.0",
"description": "A simple CAP project.",
"repository": "<Add your repository here>",
"license": "UNLICENSED",
"private": true,
"dependencies": {
"@sap/cds": "^6"
},
"devDependencies": {
"sqlite3": "^5.0.4"
},
"scripts": {
"start": "cds run"
},
"cds": {
"extends": "@capire/fiori"
},
"eslintConfig": {
"extends": "eslint:recommended",
"env": {
"es2020": true,
"node": true,
"jest": true,
"mocha": true
},
"globals": {
"SELECT": true,
"INSERT": true,
"UPDATE": true,
"DELETE": true,
"CREATE": true,
"DROP": true,
"CDL": true,
"CQL": true,
"CXL": true,
"cds": true
},
"rules": {
"no-console": "off",
"require-atomic-updates": "off"
}
}
}

View File

@@ -0,0 +1,4 @@
regionCode;name;descr
AMER;Americas;North, Central and South America
EMEA;Europe, the Middle East and Africa;Europe, the Middle East and Africa
APJ;Asia Pacific and Japan;Asia Pacific and Japan
1 regionCode name descr
2 AMER Americas North, Central and South America
3 EMEA Europe, the Middle East and Africa Europe, the Middle East and Africa
4 APJ Asia Pacific and Japan Asia Pacific and Japan

View File

@@ -0,0 +1,3 @@
ID;createdAt;createdBy;buyer;OrderNo;currency_code;Z_priority;Z_SalesRegion_regionCode
7e2f2640-6866-4dcf-8f4d-3027aa831cad;2019-01-31;john.doe@test.com;john.doe@test.com;1;EUR;high;AMER
64e718c9-ff99-47f1-8ca3-950c850777d4;2019-01-30;jane.doe@test.com;jane.doe@test.com;2;EUR;low;APJ
1 ID createdAt createdBy buyer OrderNo currency_code Z_priority Z_SalesRegion_regionCode
2 7e2f2640-6866-4dcf-8f4d-3027aa831cad 2019-01-31 john.doe@test.com john.doe@test.com 1 EUR high AMER
3 64e718c9-ff99-47f1-8ca3-950c850777d4 2019-01-30 jane.doe@test.com jane.doe@test.com 2 EUR low APJ