Fine-tuned ext - using x_ prefix

This commit is contained in:
Daniel
2022-10-03 11:42:29 +02:00
parent 4bdad98165
commit f50afdbd69
4 changed files with 23 additions and 23 deletions

View File

@@ -2,13 +2,12 @@
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
| File or Folder | Purpose |
|----------------|------------------------------------|
| `app/` | content for UI frontends goes here |
| `test/` | contet for local tests |
| `package.json` | project metadata and configuration |
| `readme.md` | this getting started guide |
## Next Steps

View File

@@ -1,24 +1,25 @@
using { sap.capire.orders, OrdersService, sap.common } from '@capire/fiori';
using { OrdersService, sap, sap.capire.orders.Orders } from '@capire/fiori';
namespace x_bookshop.extension;
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;
// Adding 2 new fields for Orders
extend Orders with {
x_priority : String @assert.range enum {high; medium; low} default 'medium' ;
x_salesRegion : Association to SalesRegion;
}
entity Z_SalesRegion: common.CodeList {
key regionCode : String(11);
/** Value Help for x_salesRegion */
entity SalesRegion : sap.common.CodeList {
key code : String(11);
}
// --- UI ---
annotate orders.Orders : Z_priority with @title : 'Priority';
annotate Z_SalesRegion : name with @title : 'Sales Region';
annotate Orders:x_priority with @title : 'Priority';
annotate SalesRegion:name with @title : 'Sales Region';
annotate OrdersService.Orders with @UI.LineItem : [
... up to { Value: OrderNo },
{ Value : Z_priority },
{ Value : Z_SalesRegion.name },
{ Value : x_priority },
{ Value : x_salesRegion.name },
...
];

View File

@@ -1,4 +1,4 @@
regionCode;name;descr
code;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 code name descr
2 AMER AMER Americas North, Central and South America
3 EMEA EMEA Europe, the Middle East and Africa Europe, the Middle East and Africa
4 APJ APJ Asia Pacific and Japan Asia Pacific and Japan

View File

@@ -57,14 +57,14 @@
"toggles": true,
"extensibility": true,
"cds.xt.ExtensibilityService": {
"element-prefix": ["Z_"],
"element-prefix": ["x_"],
"extension-allowlist": [
{
"for": [
"sap.capire.orders.Orders"
"sap.capire.orders"
],
"kind": "entity",
"new-fields": 2
"new-fields": 3
},
{
"for": [