Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 6 - Page Map: Add Micro Chart Table Column #7

Draft
wants to merge 1 commit into
base: ex5
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions _i18n/i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ Rejecttravel=rejectTravel

#XFLD,120: Label for a action
Accepttravel=acceptTravel

#XFLD,120: Label for a column title
VipStatus=VIP Status
34 changes: 30 additions & 4 deletions app/managetravels/annotations.cds
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using TravelService as service from '../../srv/travel-service';
using from '../../db/schema';
annotate service.Travel with @(
UI.SelectionFields : [
to_Agency_AgencyID,
Expand Down Expand Up @@ -176,13 +177,18 @@ annotate service.Booking with @(
UI.LineItem: [
{
$Type : 'UI.DataField',
Value : BookingID,
Value : to_Carrier.AirlinePicURL,
Label : 'AirlinePicUrl',
},
{
$Type : 'UI.DataField',
Value : to_Carrier.AirlinePicURL,
Label : 'AirlinePicUrl',
},
Value : BookingID,
},
{
$Type : 'UI.DataFieldForAnnotation',
Target : '@UI.Chart#BookedFlights',
Label : '{i18n>VipStatus}',
},
{
$Type : 'UI.DataField',
Value : to_Customer_CustomerID,
Expand All @@ -205,3 +211,23 @@ annotate service.Booking with @(
}
]
);
annotate service.Booking with @(
UI.DataPoint #BookedFlights : {
Value : BookedFlights,
TargetValue : to_Carrier.VIPCustomerBookings,
Criticality : EligibleForPrime,
},
UI.Chart #BookedFlights : {
ChartType : #Donut,
Measures : [
BookedFlights,
],
MeasureAttributes : [
{
DataPoint : '@UI.DataPoint#BookedFlights',
Role : #Axis1,
Measure : BookedFlights,
},
],
}
);