Skip to content

Commit 34d4195

Browse files
gregorwolfschiwekM
andauthored
Add additional Intent-Based Navigation target: Deliveries (#57)
* uniform formatting of all CDS files with format-cds -f * data model, service and UI for Deliveries * sort OrderItems by order_ID * Adjust sample data for Deliveries * add value help and selection fields * adjust target for navigation * add OBN to Deliveries * add missing linebreak * texts for Delivery Entity * Fix schema location for existing apps * Fix schema location for deliveries app * add missing linebreak * Update app/deliveries/ui5-deploy.yaml Co-authored-by: Marten Schiwek <marten.schiwek@sap.com> * Update app/deliveries/tsconfig.json Co-authored-by: Marten Schiwek <marten.schiwek@sap.com> * Update app/worklist/webapp/manifest.json Co-authored-by: Marten Schiwek <marten.schiwek@sap.com> * prettier * Update manifest.json * Small adjustment --------- Co-authored-by: Marten Schiwek <marten.schiwek@sap.com>
1 parent 492f502 commit 34d4195

28 files changed

Lines changed: 591 additions & 164 deletions

_i18n/i18n.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,15 @@ OrganizationalUnits=Organizational units
137137

138138
ORDER=Order
139139
ORDERS=Orders
140+
OrderID=Order ID
140141
Product=Product
141142
NetValue=Net value
142143
Currency=Currency
143144
OrderItems=Items
144145
OrderItem=Item
145146
ProductCategory=Product category
147+
148+
DELIVERY=Delivery
149+
DELIVERIES=Deliveries
150+
DeliveryItems=Delivery items
151+
DeliveryItem=Delivery item

_i18n/i18n_en.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,15 @@ OrganizationalUnits=Organizational units
137137

138138
ORDER=Order
139139
ORDERS=Orders
140+
OrderID=Order ID
140141
Product=Product
141142
NetValue=Net value
142143
Currency=Currency
143144
OrderItems=Items
144145
OrderItem=Item
145146
ProductCategory=Product category
147+
148+
DELIVERY=Delivery
149+
DELIVERIES=Deliveries
150+
DeliveryItems=Delivery items
151+
DeliveryItem=Delivery item

app/deliveries/annotations.cds

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using WorkListODataService as srv from '../../srv/worklist-srv';
2+
3+
annotate srv.Deliveries with @(
4+
UI.SelectionFields : [
5+
stringProperty,
6+
deliveryDate,
7+
trackingId,
8+
order.ID,
9+
],
10+
UI.LineItem : [
11+
{Value: order.stringProperty, },
12+
{Value: deliveryDate, },
13+
{Value: trackingId, },
14+
],
15+
UI.HeaderInfo : {
16+
TypeName : '{i18n>DELIVERY}',
17+
TypeNamePlural: '{i18n>DELIVERIES}',
18+
Title : {Value: stringProperty}
19+
},
20+
UI.Facets : [
21+
{
22+
$Type : 'UI.ReferenceFacet',
23+
Target: '@UI.FieldGroup#props',
24+
Label : '{i18n>generalData}'
25+
},
26+
{
27+
$Type : 'UI.ReferenceFacet',
28+
Target: 'items/@UI.LineItem',
29+
Label : '{i18n>DeliveryItems}'
30+
},
31+
],
32+
UI.FieldGroup #props: {Data: [
33+
{Value: deliveryDate},
34+
{Value: trackingId},
35+
]}
36+
);
37+
38+
annotate srv.DeliveryItems with @(
39+
UI.HeaderInfo: {
40+
TypeName : '{i18n>DeliveryItem}',
41+
TypeNamePlural: '{i18n>DeliveryItems}',
42+
Title : {Value: product}
43+
},
44+
UI.LineItem : [{Value: product}, ],
45+
) {};

app/deliveries/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "sap.fe.showcase.deliveries",
3+
"version": "0.0.1",
4+
"description": "A SAP Fiori application.",
5+
"keywords": [
6+
"ui5",
7+
"openui5",
8+
"sapui5"
9+
],
10+
"main": "webapp/index.html",
11+
"scripts": {
12+
"deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf",
13+
"build": "ui5 build preload --clean-dest --config ui5-deploy.yaml",
14+
"build-local": "ui5 build preload --clean-dest",
15+
"start": "ui5 serve"
16+
},
17+
"devDependencies": {
18+
"@sap/ux-ui5-tooling": "^1.14.3",
19+
"@sapui5/types": "~1.140.0",
20+
"@ui5/cli": "^4.0.0",
21+
"typescript": "^5.1.6",
22+
"ui5-task-zipper": "^3.4.1",
23+
"ui5-tooling-transpile": "^3.7.5"
24+
},
25+
"ui5": {
26+
"dependencies": [
27+
"ui5-task-zipper",
28+
"mbt"
29+
]
30+
}
31+
}

app/deliveries/tsconfig.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"module": "es2022",
5+
"skipLibCheck": true,
6+
"allowJs": true,
7+
"strict": true,
8+
"strictPropertyInitialization": false,
9+
"moduleResolution": "node",
10+
"rootDir": "../../",
11+
"outDir": "./dist",
12+
"baseUrl": "./",
13+
"paths": {
14+
"sap/fe/showcase/deliveries/*": ["./webapp/*"],
15+
"#cds-models/*": ["../../@cds-models/*/index.ts"]
16+
},
17+
"typeRoots": [
18+
"./node_modules/@types",
19+
"./node_modules/@sapui5/types",
20+
"../../node_modules/@types",
21+
"../../node_modules/@sapui5/types"
22+
]
23+
},
24+
"include": ["./webapp/**/*", "../ControllerExtension.d.ts"],
25+
"exclude": ["node_modules/**"]
26+
}

app/deliveries/ui5-deploy.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# yaml-language-server: $schema=https://ui5.github.io/cli/schema/ui5.yaml.json
2+
specVersion: "3.1"
3+
metadata:
4+
name: sap.fe.showcase.deliveries
5+
type: application
6+
resources:
7+
configuration:
8+
propertiesFileSourceEncoding: UTF-8
9+
builder:
10+
resources:
11+
excludes:
12+
- "/test/**"
13+
- "/localService/**"
14+
customTasks:
15+
- name: ui5-task-zipper
16+
afterTask: generateVersionInfo
17+
configuration:
18+
archiveName: deliveries
19+
relativePaths: true
20+
additionalFiles:
21+
- xs-app.json
22+
- name: ui5-tooling-transpile-task
23+
afterTask: replaceVersion

app/deliveries/ui5.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# yaml-language-server: $schema=https://ui5.github.io/cli/schema/ui5.yaml.json
2+
3+
specVersion: "4.0"
4+
metadata:
5+
name: sap.fe.showcase.deliveries
6+
type: application
7+
server:
8+
customMiddleware:
9+
- name: fiori-tools-proxy
10+
afterMiddleware: compression
11+
configuration:
12+
ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
13+
ui5:
14+
path:
15+
- /resources
16+
- /test-resources
17+
url: https://sapui5.hana.ondemand.com
18+
- name: fiori-tools-appreload
19+
afterMiddleware: compression
20+
configuration:
21+
port: 35729
22+
path: webapp
23+
delay: 300
24+
- name: ui5-tooling-transpile-middleware
25+
afterMiddleware: compression
26+
configuration:
27+
debug: true
28+
transformModulesToUI5:
29+
overridesToOverride: true
30+
excludePatterns:
31+
- /Component-preload.js
32+
builder:
33+
customTasks:
34+
- name: ui5-tooling-transpile-task
35+
afterTask: replaceVersion
36+
configuration:
37+
debug: true
38+
transformModulesToUI5:
39+
overridesToOverride: true
40+
resources:
41+
excludes:
42+
- "/test/**"
43+
- "/localService/**"
44+
resources:
45+
configuration:
46+
propertiesFileSourceEncoding: UTF-8

app/deliveries/webapp/Component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import AppComponent from "sap/fe/core/AppComponent";
2+
3+
/**
4+
* @namespace sap.fe.showcase.deliveries
5+
*/
6+
export default class Component extends AppComponent {
7+
public static metadata = {
8+
manifest: "json",
9+
};
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This is the resource bundle for items3
2+
3+
#Texts for manifest.json
4+
5+
#XTIT: Application name
6+
appTitle=Work List Deliveries
7+
8+
#YDES: Application description
9+
appDescription=List deliveries
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This is the resource bundle for items3
2+
3+
#Texts for manifest.json
4+
5+
#XTIT: Application name
6+
appTitle=Work List Deliveries
7+
8+
#YDES: Application description
9+
appDescription=List deliveries

0 commit comments

Comments
 (0)