diff --git a/fiori-ext/README.md b/fiori-ext/README.md index dfa00377..2afff0df 100644 --- a/fiori-ext/README.md +++ b/fiori-ext/README.md @@ -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 diff --git a/fiori-ext/app/extension.cds b/fiori-ext/app/extension.cds index 2d34b9ea..64097944 100644 --- a/fiori-ext/app/extension.cds +++ b/fiori-ext/app/extension.cds @@ -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 }, ... ]; diff --git a/fiori-ext/test/data/Z_bookshop.extension-Z_SalesRegion.csv b/fiori-ext/test/data/x_bookshop.extension-SalesRegion.csv similarity index 63% rename from fiori-ext/test/data/Z_bookshop.extension-Z_SalesRegion.csv rename to fiori-ext/test/data/x_bookshop.extension-SalesRegion.csv index b5aeca0e..7ad6a924 100644 --- a/fiori-ext/test/data/Z_bookshop.extension-Z_SalesRegion.csv +++ b/fiori-ext/test/data/x_bookshop.extension-SalesRegion.csv @@ -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 \ No newline at end of file diff --git a/fiori/package.json b/fiori/package.json index 8ab276aa..5e30b90a 100644 --- a/fiori/package.json +++ b/fiori/package.json @@ -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": [