Fiori extension project
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -18,3 +18,8 @@ reviews/msg-box
|
|||||||
reviews/db/test.db
|
reviews/db/test.db
|
||||||
|
|
||||||
*.openapi3.json
|
*.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
22
fiori-ext/README.md
Normal 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/.
|
||||||
31
fiori-ext/app/extension.cds
Normal file
31
fiori-ext/app/extension.cds
Normal 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 },
|
||||||
|
...
|
||||||
|
];
|
||||||
2
fiori-ext/app/i18n/i18n.properties
Normal file
2
fiori-ext/app/i18n/i18n.properties
Normal 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
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
45
fiori-ext/package.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
3
fiori-ext/test/data/sap.capire.orders-Orders.csv
Normal file
3
fiori-ext/test/data/sap.capire.orders-Orders.csv
Normal 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
|
||||||
|
Reference in New Issue
Block a user