Skip to content

Commit 71b1212

Browse files
committed
added Ui
1 parent f1decb2 commit 71b1212

24 files changed

+3110
-238
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ CAP Java based Incident Management Application.
2222
cd srv && mvn cds:watch
2323
```
2424
4. Go to `localhost:8080` and you will get the list of exposed endpoints.
25-
5. Test the following endpoint: `http://localhost:8080/odata/v4/AdminService/Customers`
25+
5. Test the following endpoint: `http://localhost:8080/odata/v4/ProcessorService/Incidents`
2626
6. When you are prompted to authenticate, use the following credentials:
27-
- Username: admin
28-
- Password: admin
29-
7. When you are testing `ProcessorService` endpoints, use the following credentials:
3027
- Username: alice
31-
- password:
28+
- Password:
29+
7. To access the Incident Management Application WebApp, use the following url : `http://localhost:8080/incidents/webapp/index.html`
30+
7. When you are testing `AdminService` endpoints, use the following credentials:
31+
- Username: admin
32+
- password: admin
3233
## Deploy and Test Incidents Management Application on BTP CF
3334

3435
1. In the root folder do:

_i18n/i18n.properties

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
#XFLD,120: Label for a filter field
3+
Status=Status
4+
5+
#XFLD,120: Label for a filter field
6+
Urgency=Urgency
7+
8+
#XFLD,120: Label for a column title
9+
Title=Title
10+
11+
#XFLD,120: Label for a column title
12+
Customer=Customer
13+
14+
#XFLD,50: Label for a section
15+
Overview=Overview
16+
17+
#XFLD,50: Label for a section
18+
Details=Details
19+
20+
#XFLD,50: Label for a section
21+
GeneralInformation=General Information
22+
23+
#XFLD,120: Label for a column title
24+
Author=Author
25+
26+
#XFLD,120: Label for a column title
27+
Message=Message
28+
29+
#XFLD,120: Label for a column title
30+
ConversationDate=Conversation Date

app/incidents/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Application Details
2+
| |
3+
| ------------- |
4+
|**Generation Date and Time**<br>Wed Dec 13 2023 15:13:35 GMT+0530 (India Standard Time)|
5+
|**App Generator**<br>@sap/generator-fiori-elements|
6+
|**App Generator Version**<br>1.10.3|
7+
|**Generation Platform**<br>Visual Studio Code|
8+
|**Template Used**<br>List Report Page V4|
9+
|**Service Type**<br>Local Cap|
10+
|**Service URL**<br>http://localhost:4004/odata/v4/ProcessorService/
11+
|**Module Name**<br>incidents|
12+
|**Application Title**<br>Incident-Management|
13+
|**Namespace**<br>ns|
14+
|**UI5 Theme**<br>sap_horizon|
15+
|**UI5 Version**<br>1.120.1|
16+
|**Enable Code Assist Libraries**<br>False|
17+
|**Enable TypeScript**<br>False|
18+
|**Add Eslint configuration**<br>False|
19+
|**Main Entity**<br>Incidents|
20+
|**Navigation Entity**<br>None|
21+
22+
## incidents
23+
24+
A Fiori application.
25+
26+
### Starting the generated app
27+
28+
- This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project (```mvn spring-boot:run```) and navigate to the following location in your browser:
29+
30+
http://localhost:8080/incidents/webapp/index.html
31+
32+
#### Pre-requisites:
33+
34+
1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org)
35+
36+

app/incidents/annotations.cds

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
using ProcessorService as service from '../../srv/processor-service';
2+
using from '../../db/schema';
3+
annotate service.Incidents with @(
4+
UI.SelectionFields : [
5+
status_code,
6+
urgency_code,
7+
]
8+
);
9+
10+
annotate service.Incidents with {
11+
status @Common.Label : '{i18n>Status}'
12+
};
13+
14+
15+
annotate service.Incidents with {
16+
urgency @Common.Label : '{i18n>Urgency}'
17+
};
18+
annotate service.Incidents with {
19+
urgency @Common.ValueListWithFixedValues : true
20+
};
21+
annotate service.Urgency with {
22+
code @Common.Text : descr
23+
};
24+
annotate service.Incidents with @(
25+
UI.LineItem : [
26+
{
27+
$Type : 'UI.DataField',
28+
Value : status.descr,
29+
Label : '{i18n>Status}',
30+
Criticality : status.criticality,
31+
},
32+
{
33+
$Type : 'UI.DataField',
34+
Value : urgency.descr,
35+
Label : '{i18n>Urgency}',
36+
},
37+
{
38+
$Type : 'UI.DataField',
39+
Value : customer.name,
40+
Label : '{i18n>Customer}',
41+
},
42+
{
43+
$Type : 'UI.DataField',
44+
Value : title,
45+
Label : '{i18n>Title}',
46+
},
47+
]
48+
);
49+
annotate service.Incidents with @(
50+
UI.HeaderInfo : {
51+
Title : {
52+
$Type : 'UI.DataField',
53+
Value : title,
54+
},
55+
TypeName : '',
56+
TypeNamePlural : '',
57+
Description : {
58+
$Type : 'UI.DataField',
59+
Value : customer.name,
60+
},
61+
TypeImageUrl : 'sap-icon://alert',
62+
}
63+
);
64+
annotate service.Incidents with @(
65+
UI.Facets : [
66+
{
67+
$Type : 'UI.CollectionFacet',
68+
Label : '{i18n>Overview}',
69+
ID : 'Overview',
70+
Facets : [
71+
{
72+
$Type : 'UI.ReferenceFacet',
73+
Label : '{i18n>GeneralInformation}',
74+
ID : 'i18nGeneralInformation',
75+
Target : '@UI.FieldGroup#i18nGeneralInformation',
76+
},
77+
{
78+
$Type : 'UI.ReferenceFacet',
79+
Label : '{i18n>Details}',
80+
ID : 'i18nDetails',
81+
Target : '@UI.FieldGroup#i18nDetails',
82+
},],
83+
},
84+
{
85+
$Type : 'UI.ReferenceFacet',
86+
Label : 'Conversations',
87+
ID : 'Conversations',
88+
Target : 'conversations/@UI.LineItem#Conversations',
89+
},
90+
]
91+
);
92+
annotate service.Incidents with @(
93+
UI.FieldGroup #i18nDetails : {
94+
$Type : 'UI.FieldGroupType',
95+
Data : [
96+
{
97+
$Type : 'UI.DataField',
98+
Value : status_code,
99+
},{
100+
$Type : 'UI.DataField',
101+
Value : urgency_code,
102+
},],
103+
}
104+
);
105+
annotate service.Incidents with @(
106+
UI.FieldGroup #i18nGeneralInformation : {
107+
$Type : 'UI.FieldGroupType',
108+
Data : [
109+
{
110+
$Type : 'UI.DataField',
111+
Value : customer_ID,
112+
Label : '{i18n>Customer}',
113+
},],
114+
}
115+
);
116+
annotate service.Incidents with {
117+
customer @Common.Text : {
118+
$value : customer.name,
119+
![@UI.TextArrangement] : #TextOnly,
120+
}
121+
};
122+
annotate service.Incidents with {
123+
customer @(Common.ValueList : {
124+
$Type : 'Common.ValueListType',
125+
CollectionPath : 'Customers',
126+
Parameters : [
127+
{
128+
$Type : 'Common.ValueListParameterInOut',
129+
LocalDataProperty : customer_ID,
130+
ValueListProperty : 'ID',
131+
},
132+
],
133+
},
134+
Common.ValueListWithFixedValues : false
135+
)};
136+
annotate service.Customers with {
137+
ID @Common.Text : {
138+
$value : name,
139+
![@UI.TextArrangement] : #TextOnly,
140+
}
141+
};
142+
annotate service.Incidents with {
143+
urgency @Common.Text : urgency.descr
144+
};
145+
annotate service.Incidents with {
146+
status @Common.Text : status.descr
147+
};
148+
annotate service.Incidents with {
149+
status @Common.ValueListWithFixedValues : true
150+
};
151+
annotate service.Status with {
152+
code @Common.Text : descr
153+
};
154+
annotate service.Conversations with @(
155+
UI.LineItem #Conversations : [
156+
{
157+
$Type : 'UI.DataField',
158+
Value : author,
159+
Label : '{i18n>Author}',
160+
},{
161+
$Type : 'UI.DataField',
162+
Value : message,
163+
Label : '{i18n>Message}',
164+
},{
165+
$Type : 'UI.DataField',
166+
Value : timestamp,
167+
Label : '{i18n>ConversationDate}',
168+
},]
169+
);

app/incidents/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "incidents",
3+
"version": "0.0.1",
4+
"description": "A 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+
},
14+
"devDependencies": { }
15+
}

app/incidents/ui5.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
specVersion: "2.5"
2+
metadata:
3+
name: ns.incidents
4+
type: application
5+

app/incidents/webapp/Component.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sap.ui.define(
2+
["sap/fe/core/AppComponent"],
3+
function (Component) {
4+
"use strict";
5+
6+
return Component.extend("ns.incidents.Component", {
7+
metadata: {
8+
manifest: "json"
9+
}
10+
});
11+
}
12+
);
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 ns.incidents
2+
3+
#Texts for manifest.json
4+
5+
#XTIT: Application name
6+
appTitle=Incident-Management
7+
8+
#YDES: Application description
9+
appDescription=A Fiori application.

app/incidents/webapp/index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<title>Incident-Management</title>
8+
<style>
9+
html, body, body > div, #container, #container-uiarea {
10+
height: 100%;
11+
}
12+
</style>
13+
<script
14+
id="sap-ui-bootstrap"
15+
src="https://sapui5.hana.ondemand.com/1.120.1/resources/sap-ui-core.js"
16+
data-sap-ui-theme="sap_horizon"
17+
data-sap-ui-resourceroots='{
18+
"ns.incidents": "./"
19+
}'
20+
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
21+
data-sap-ui-compatVersion="edge"
22+
data-sap-ui-async="true"
23+
data-sap-ui-frameOptions="trusted"
24+
></script>
25+
</head>
26+
<body class="sapUiBody sapUiSizeCompact" id="content">
27+
<div
28+
data-sap-ui-component
29+
data-name="ns.incidents"
30+
data-id="container"
31+
data-settings='{"id" : "ns.incidents"}'
32+
data-handle-validation="true"
33+
></div>
34+
</body>
35+
</html>

0 commit comments

Comments
 (0)