Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
143fbec
ts config added on app level
c-kobo Nov 12, 2024
134a2e0
ts config continued
c-kobo Nov 12, 2024
6420345
custom section added
c-kobo Nov 12, 2024
aa4b00c
add sustainability fields and custom calculation handler
c-kobo Nov 12, 2024
028609b
controller extension added
c-kobo Nov 12, 2024
4814bf7
controller extension fixed
c-kobo Nov 12, 2024
e2de80e
fix green flight fee calculation
c-kobo Nov 14, 2024
d28171c
package.json and app specific tsconfig.json updated
c-kobo Nov 15, 2024
798fd76
package.json updated
c-kobo Nov 15, 2024
43292ee
small fixes
c-kobo Nov 15, 2024
d4cffa3
package-lock.json updated
c-kobo Nov 18, 2024
597d169
improve green fee calculation
c-kobo Nov 20, 2024
2b4bdbb
Merge remote-tracking branch 'origin/main' into typescript
c-kobo Nov 20, 2024
8f23fa9
package-lock.json updated
c-kobo Nov 20, 2024
9996b1d
changes from code review pt.1
c-kobo Nov 20, 2024
0597096
package.json updated
c-kobo Nov 20, 2024
994248a
Merge branch 'main' into typescript
chgeo Nov 20, 2024
acb639e
Merge branch 'main' into typescript
chgeo Nov 20, 2024
90af41e
Merge remote-tracking branch 'origin/main' into typescript
c-kobo Nov 26, 2024
4aa950b
package-lock.json updated
c-kobo Nov 26, 2024
7f5daeb
eslint.config.js: ignore app/**/* as it has its own eslintrc rules
c-kobo Nov 26, 2024
521d6f5
Update app/travel_analytics/package.json
c-kobo Nov 26, 2024
a74a984
Update app/travel_processor/package.json
c-kobo Nov 26, 2024
4305a29
fix opa tests pt.1
c-kobo Nov 27, 2024
4324bf9
fix opa tests pt.2
c-kobo Nov 27, 2024
c091a69
fix jest test
c-kobo Nov 28, 2024
e689aa1
Update UI5 core library version to 1.130.2
c-kobo Nov 28, 2024
815edfd
package.json updated
c-kobo Nov 28, 2024
56e6e44
force mocha test exit after successful completion
c-kobo Nov 29, 2024
71c4157
Ignore all .sql files
chgeo Nov 29, 2024
bebc336
Fix csv file
chgeo Nov 29, 2024
5be0146
Fix Java build
chgeo Nov 29, 2024
5dea41c
Use Java 21
chgeo Nov 29, 2024
02d7a98
Fix tsx install, Node 20 instead of 18
chgeo Nov 29, 2024
4f53835
npm up
chgeo Nov 29, 2024
78804ea
Fix java startup in Karama, add logging
chgeo Nov 29, 2024
765dd00
Use ephemeral port for Java
chgeo Nov 29, 2024
818abd1
Use `karma-ui5-transpile` to get TS transpiled
chgeo Nov 29, 2024
d3ab3f2
Remove superfluous test/odata.test.js
chgeo Nov 29, 2024
c0be332
Remove superfluous installs
chgeo Nov 29, 2024
431bba6
Simplify Java build
chgeo Nov 29, 2024
afe7c45
Move Karma stuff
chgeo Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _i18n/i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ ProductPrice=Product Price
ProductID=Product
OverallStatus=Overall Status
GeneralInformation=General Information
GoGreen=Trees-4-Tickets
GreenFee=Green Flight Fee
TreesPlanted=Trees Planted
Sustainability=Sustainability

Booking=Booking
Bookings=Bookings
Expand Down
3 changes: 3 additions & 0 deletions app/labels.cds
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ annotate schema.Travel with @title: '{i18n>Travel}' {
Description @title: '{i18n>Description}';
BookingFee @title: '{i18n>BookingFee}' @Measures.ISOCurrency: CurrencyCode_code;
TotalPrice @title: '{i18n>TotalPrice}' @Measures.ISOCurrency: CurrencyCode_code;
GoGreen @title: '{i18n>GoGreen}';
GreenFee @title: '{i18n>GreenFee}' @Measures.ISOCurrency: CurrencyCode_code;
TreesPlanted @title: '{i18n>TreesPlanted}';
TravelStatus @title: '{i18n>TravelStatus}' @Common.Text: TravelStatus.name @Common.TextArrangement: #TextOnly;
to_Customer @title: '{i18n>CustomerID}' @Common.Text: to_Customer.LastName;
to_Agency @title: '{i18n>AgencyID}' @Common.Text: to_Agency.Name;
Expand Down
15 changes: 12 additions & 3 deletions app/travel_analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,29 @@
"start": "ui5 serve",
"test": "npm run test:node && npm run test:java",
"test:java": "karma start --server=java --single-run",
"test:node": "karma start --server=node --single-run"
"test:node": "karma start --server=node --single-run",
"ts-typecheck": "tsc --noEmit",
"prestart": "npm run ts-typecheck",
"prebuild": "npm run ts-typecheck"
},
"keywords": [
"ui5",
"openui5",
"sapui5"
],
"devDependencies": {
"@ui5/cli": "^4.0.0",
"karma": "^6.4.3",
"karma-chrome-launcher": "^3.2.0",
"karma-ui5": "^4.0.1",
"puppeteer": "^23.0.2",
"ui5-middleware-simpleproxy": "^3.2.16",
"ui5-task-zipper": "^3.1.4"
"ui5-task-zipper": "^3.1.4",
"@sap/ux-ui5-tooling": "1",
"@sapui5/types": "~1.130.0",
"ui5-tooling-transpile": "^3.3.7",
"typescript": "^5.1.6",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@sap-ux/eslint-plugin-fiori-tools": "^0.4.0"
}
}
28 changes: 28 additions & 0 deletions app/travel_analytics/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"skipLibCheck": true,
"allowJs": true,
"strict": true,
"strictPropertyInitialization": false,
"moduleResolution": "node",
"rootDir": "./webapp",
"outDir": "./dist",
"baseUrl": "./",
"paths": {
"sap/fe/cap/travel_analytics/*": [
"./webapp/*"
]
},
"typeRoots": [
"./node_modules/@types",
"./node_modules/@sapui5/types",
"../../node_modules/@types",
"../../node_modules/@sapui5/types"
]
},
"include": [
"./webapp/**/*"
]
}
12 changes: 12 additions & 0 deletions app/travel_analytics/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ builder:
archiveName: travel-analytics
additionalFiles:
- xs-app.json
- name: ui5-tooling-transpile-task
afterTask: replaceVersion
configuration:
debug: true

server:
customMiddleware:
Expand All @@ -30,3 +34,11 @@ server:
baseUri: http://localhost:4004/analytics
username: admin # dummy credentials for local testing
password: admin # dummy credentials for local testing
- name: fiori-tools-appreload
afterMiddleware: compression
- name: ui5-tooling-transpile-middleware
afterMiddleware: compression
configuration:
debug: true
excludePatterns:
- /Component-preload.js
6 changes: 0 additions & 6 deletions app/travel_analytics/webapp/Component.js

This file was deleted.

20 changes: 20 additions & 0 deletions app/travel_analytics/webapp/Component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import BaseComponent from "sap/fe/core/AppComponent";

/**
* @namespace sap.fe.cap.managetravels
*/
export default class Component extends BaseComponent {

public static metadata = {
manifest: "json"
};

/**
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
* @public
* @override
*/
//public init() : void {
// super.init();
//}
}
4 changes: 2 additions & 2 deletions app/travel_analytics/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
}
},
"sap.ui5": {
"flexEnabled": true,
"flexEnabled": false,
"dependencies": {
"minUI5Version": "1.128.0",
"minUI5Version": "1.130.0",
"libs": {
"sap.m": {},
"sap.ui.core": {},
Expand Down
4 changes: 4 additions & 0 deletions app/travel_processor/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "plugin:@sap-ux/eslint-plugin-fiori-tools/defaultTS",
"root": true
}
15 changes: 10 additions & 5 deletions app/travel_processor/field-control.cds
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ using TravelService from '../../srv/travel-service';
// annotations that control the behavior of fields and actions
//

annotate TravelService.Travel with @(Common.SideEffects: {
SourceProperties: [BookingFee],
TargetProperties: ['TotalPrice']
annotate TravelService.Travel with @(Common : {
SideEffects: {
SourceProperties: [BookingFee],
TargetProperties: ['TotalPrice', 'GreenFee', 'TreesPlanted']
},
SideEffects #GoGreen:{
SourceProperties: [GoGreen],
TargetProperties: ['TotalPrice', 'GreenFee', 'TreesPlanted']
}
}){
BookingFee @Common.FieldControl : TravelStatus.fieldControl;
BeginDate @Common.FieldControl : TravelStatus.fieldControl;
Expand All @@ -33,8 +39,7 @@ annotate TravelService.Travel @(
SourceEntities : [
to_Booking
],
TargetProperties : [
'TotalPrice'
TargetProperties : ['TotalPrice'
]
}
);
Expand Down
32 changes: 25 additions & 7 deletions app/travel_processor/layouts.cds
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ annotate TravelService.Travel with @UI : {
ID : 'DateData',
Target : '@UI.FieldGroup#DateData',
Label : '{i18n>Dates}'
},
{
$Type : 'UI.ReferenceFacet',
Label : '{i18n>Sustainability}',
ID : 'i18nSustainability',
Target: '@UI.FieldGroup#i18nSustainability',
}
]
}, { // booking list
$Type : 'UI.ReferenceFacet',
ID : 'BookingList',
Target : 'to_Booking/@UI.PresentationVariant',
Label : '{i18n>Bookings}'
]
}],
FieldGroup#TravelData : { Data : [
{ Value : TravelID },
Expand All @@ -117,7 +118,24 @@ annotate TravelService.Travel with @UI : {
{ $Type : 'UI.DataField', Value : BookingFee },
{ $Type : 'UI.DataField', Value : TotalPrice },
{ $Type : 'UI.DataField', Value : CurrencyCode_code }
]}
]},
FieldGroup #i18nSustainability: {
$Type: 'UI.FieldGroupType',
Data : [
{
$Type: 'UI.DataField',
Value: GoGreen,
},
{
$Type: 'UI.DataField',
Value: GreenFee,
},
{
$Type: 'UI.DataField',
Value: TreesPlanted,
},
],
}
};

annotate TravelService.Booking with @UI : {
Expand Down
14 changes: 12 additions & 2 deletions app/travel_processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"start": "ui5 serve",
"test": "npm run test:node && npm run test:java",
"test:java": "karma start --server=java --single-run",
"test:node": "karma start --server=node --single-run"
"test:node": "karma start --server=node --single-run",
"ts-typecheck": "tsc --noEmit",
"prestart": "npm run ts-typecheck",
"prebuild": "npm run ts-typecheck"
},
"keywords": [
"ui5",
Expand All @@ -25,6 +28,13 @@
"karma-ui5": "^4.0.1",
"puppeteer": "^23.0.2",
"ui5-middleware-simpleproxy": "^3.2.16",
"ui5-task-zipper": "^3.1.4"
"ui5-task-zipper": "^3.1.4",
"@sap/ux-ui5-tooling": "1",
"@sapui5/types": "~1.130.0",
"ui5-tooling-transpile": "^3.3.7",
"typescript": "^5.1.6",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@sap-ux/eslint-plugin-fiori-tools": "^0.4.0"
}
}
28 changes: 28 additions & 0 deletions app/travel_processor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"skipLibCheck": true,
"allowJs": true,
"strict": true,
"strictPropertyInitialization": false,
"moduleResolution": "node",
"rootDir": "./webapp",
"outDir": "./dist",
"baseUrl": "./",
"paths": {
"sap/fe/cap/travel_processor/*": [
"./webapp/*"
]
},
"typeRoots": [
"./node_modules/@types",
"./node_modules/@sapui5/types",
"../../node_modules/@types",
"../../node_modules/@sapui5/types"
]
},
"include": [
"./webapp/**/*"
]
}
12 changes: 12 additions & 0 deletions app/travel_processor/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ builder:
archiveName: travel-processor
additionalFiles:
- xs-app.json
- name: ui5-tooling-transpile-task
afterTask: replaceVersion
configuration:
debug: true

server:
customMiddleware:
Expand All @@ -30,3 +34,11 @@ server:
baseUri: http://localhost:4004/processor
username: admin # dummy credentials for local testing
password: admin # dummy credentials for local testing
- name: fiori-tools-appreload
afterMiddleware: compression
- name: ui5-tooling-transpile-middleware
afterMiddleware: compression
configuration:
debug: true
excludePatterns:
- /Component-preload.js
6 changes: 0 additions & 6 deletions app/travel_processor/webapp/Component.js

This file was deleted.

20 changes: 20 additions & 0 deletions app/travel_processor/webapp/Component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import BaseComponent from "sap/fe/core/AppComponent";

/**
* @namespace sap.fe.cap.managetravels
*/
export default class Component extends BaseComponent {

public static metadata = {
manifest: "json"
};

/**
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
* @public
* @override
*/
//public init() : void {
// super.init();
//}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Helper to be able to define how to get the page specific extension API when writing a controller extension.
*/
declare module 'sap/ui/core/mvc/ControllerExtension' {
export default class ControllerExtension<API> {
static overrides: unknown;
base: {
getExtensionAPI(): API;
}
}
}
Loading