namespace my.capm;
entity SalesOrders {
key id : Integer;
customer : String;
netAmount : Integer;
status:String;
creationDate:Date
}
entity ToDos{
key id : Integer;
title:String;
subtitle:String;
place:String;
}
using my.capm as my from '../db/data-model';
service DataService {
entity SalesOrders @readonly as projection on my.SalesOrders;
entity ToDos @readonly as projection on my.ToDos;
}
id;title;subtitle;place
1;Call ABAP Team;16-Jul-2019 13:30;OnCall
2;Meet Sales Team;17-Jul-2019 13:00 - 15:00;Panchkula
3;OpenSAP Final Exam; 20-Jul-2019 14:00;Online
4;Meet CEO; 21-Jul-2019 10:00;InPerson
5;Meet CFO; 23-Jul-2019 11:00;InPerson
6;Resgin from the company; 24-Jul-2019 14:00;Online
id;customer;netAmount;status;creationDate
1;Bombay Textiles;500;Open;"2019-07-22"
2;GOI;1500;Open;"2019-07-23"
3;GOI;1300;Open;"2019-07-24"
4;GOI;1200;Open;"2019-07-25"
5;GOI;1750;Open;"2019-07-27"
cds deploy --to sqlite:db/my-data.db
npm install -g ionic
ionic start myApp tabs
Ionic serve
<ion-tabs>
<ion-tab-bar slot="bottom">
<ion-tab-button tab="tab1">
<ion-icon name="flash"></ion-icon>
<ion-label>My ToDo's</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab2">
<ion-icon name="apps"></ion-icon>
<ion-label>My Orders</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
import { NgModule,CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@ui5/webcomponents/dist/Timeline';
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-tab1',
templateUrl: 'tab1.page.html',
styleUrls: ['tab1.page.scss']
})
export class Tab1Page {
private myToDos: any =[];
constructor(private http: HttpClient) {
this.http.get('https://7d76332c.ngrok.io/data/ToDos').subscribe((response) => {
this.myToDos = response;
});
}
}
<ui5-timeline >
<ui5-timeline-item *ngFor="let myToDo of myToDos.value"
titleText="{{myToDo.title}}"
subtitleText="{{myToDo.subtitle}}" icon="sap-icon://calendar">
<div>{{myToDo.place}}</div>
</ui5-timeline-item>
</ui5-timeline>
import '@ui5/webcomponents/dist/Card';
import '@ui5/webcomponents/dist/Table';
this.http.get('https://7d76332c.ngrok.io/data/SalesOrders').subscribe((response) => {
this.salesOrders = response;
});
<ion-header>
<ion-toolbar>
<ion-title>
My Orders
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
<style>
.status-error {color: #b00;}
.status-warning {color: #e9730c;}
.status-success {color: #107e3e;}
</style>
<ui5-card heading="My Sales Orders" class="medium">
<ui5-table class="demo-table content-padding">
<!-- Columns -->
<ui5-table-column slot="columns">
<ui5-label>Sales Order</ui5-label>
</ui5-table-column>
<ui5-table-column slot="columns">
<ui5-label>Customer</ui5-label>
</ui5-table-column>
<ui5-table-column slot="columns">
<ui5-label>Net Amount</ui5-label>
</ui5-table-column>
<ui5-table-column slot="columns" min-width="450" popin-text="Date" demand-popin>
<ui5-label>Date</ui5-label>
</ui5-table-column>
<!-- Rows -->
<ui5-table-row *ngFor="let saleOrder of salesOrders.value">
<ui5-table-cell>
<ui5-label>{{saleOrder.id}}</ui5-label>
</ui5-table-cell>
<ui5-table-cell>
<ui5-label>{{saleOrder.customer}}</ui5-label>
</ui5-table-cell>
<ui5-table-cell>
<ui5-label>{{saleOrder.netAmount}}</ui5-label>
</ui5-table-cell>
<ui5-table-cell>
<span>{{saleOrder.creationDate}}</span>
</ui5-table-cell>
</ui5-table-row>
</ui5-table>
</ui5-card>
</ion-content>
npm install chart.js --save
<ion-header>
<ion-toolbar>
<ion-title>
My Orders
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
<style>
.status-error {color: #b00;}
.status-warning {color: #e9730c;}
.status-success {color: #107e3e;}
</style>
<ui5-card heading="My Sales Orders" class="medium">
<div class="ion-padding">
<ion-card>
<ion-card-header>
History
</ion-card-header>
<ion-card-content>
<canvas #lineCanvas></canvas>
</ion-card-content>
</ion-card>
</div>
<!-- Table is here -->
</ui5-card>
</ion-content>
this.lineChart = new Chart(this.lineCanvas.nativeElement, {
type: "line",
data: {
labels: this.salesOrders.value.map(saleOrder => saleOrder.creationDate),
datasets: [
{
label: "Sales order value over time",
fill: false,
lineTension: 0.1,
backgroundColor: "rgba(75,192,192,0.4)",
borderColor: "rgba(75,192,192,1)",
borderCapStyle: "butt",
borderDash: [],
borderDashOffset: 0.0,
borderJoinStyle: "miter",
pointBorderColor: "rgba(75,192,192,1)",
pointBackgroundColor: "#fff",
pointBorderWidth: 1,
pointHoverRadius: 5,
pointHoverBackgroundColor: "rgba(75,192,192,1)",
pointHoverBorderColor: "rgba(220,220,220,1)",
pointHoverBorderWidth: 2,
pointRadius: 1,
pointHitRadius: 10,
data: this.salesOrders.value.map(saleOrder => saleOrder.netAmount),
spanGaps: false
}
]
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
10 | |
9 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |