Skip to content

Commit acc5a02

Browse files
committed
added sample incident app
1 parent 7e7063d commit acc5a02

39 files changed

Lines changed: 3404 additions & 0 deletions

tests/incident-app/.cdsrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

tests/incident-app/.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
**/gen/
2+
**/edmx/
3+
*.db
4+
*.sqlite
5+
*.sqlite-wal
6+
*.sqlite-shm
7+
schema*.sql
8+
default-env.json
9+
10+
**/bin/
11+
**/target/
12+
.flattened-pom.xml
13+
.classpath
14+
.project
15+
.settings
16+
17+
**/node/
18+
**/node_modules/
19+
20+
**/.mta/
21+
*.mtar
22+
23+
*.log*
24+
gc_history*
25+
hs_err*
26+
*.tgz
27+
*.iml
28+
29+
.vscode
30+
.idea
31+
.reloadtrigger
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Incident=Incident
2+
3+
#XFLD,120: Label for a filter field
4+
Urgency=Urgency
5+
6+
#XFLD,120: Label for a filter field
7+
Status=Status
8+
9+
#XFLD,120: Label for a column title
10+
Title=Title
11+
12+
#XFLD,120: Label for a column title
13+
Customer=Customer
14+
15+
#XFLD,50: Label for a section
16+
Details=Details
17+
18+
#XFLD,50: Label for a section
19+
Conversations=Conversations
20+
21+
#XFLD,120: Label for a column title
22+
Author=Author
23+
24+
#XFLD,120: Label for a column title
25+
Timestamp=Timestamp
26+
27+
#XFLD,120: Label for a column title
28+
Message=Message
29+
30+
#XFLD,50: Label for a section
31+
Overview=Overview
32+
33+
#XFLD,120: Label for a column title
34+
ConversationDate=Conversation Date
35+
36+
#XFLD,50: Label for a section
37+
Conversation=Conversation
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>Tue Dec 10 2024 08:08:17 GMT+0000 (Coordinated Universal Time)|
5+
|**App Generator**<br>@sap/generator-fiori-elements|
6+
|**App Generator Version**<br>1.15.7|
7+
|**Generation Platform**<br>SAP Business Application Studio|
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.131.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+
An SAP 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+
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
using ProcessorService as service from '../../srv/services';
2+
using from '../../db/schema';
3+
4+
annotate service.Incidents with @(
5+
UI.FieldGroup #GeneratedGroup : {
6+
$Type : 'UI.FieldGroupType',
7+
Data : [
8+
{
9+
$Type : 'UI.DataField',
10+
Value : title,
11+
},
12+
{
13+
$Type : 'UI.DataField',
14+
Label : '{i18n>Customer}',
15+
Value : customer_ID,
16+
},
17+
],
18+
},
19+
UI.Facets : [
20+
{
21+
$Type : 'UI.CollectionFacet',
22+
Label : '{i18n>Overview}',
23+
ID : 'i18nOverview',
24+
Facets : [
25+
{
26+
$Type : 'UI.ReferenceFacet',
27+
ID : 'GeneratedFacet1',
28+
Label : '{i18n>GeneralInformation}',
29+
Target : '@UI.FieldGroup#GeneratedGroup',
30+
},
31+
{
32+
$Type : 'UI.ReferenceFacet',
33+
Label : '{i18n>Details}',
34+
ID : 'i18nDetails',
35+
Target : '@UI.FieldGroup#i18nDetails',
36+
},
37+
],
38+
},
39+
{
40+
$Type : 'UI.ReferenceFacet',
41+
Label : '{i18n>Conversation}',
42+
ID : 'i18nConversation',
43+
Target : 'conversation/@UI.LineItem#i18nConversation',
44+
},
45+
],
46+
UI.LineItem : [
47+
{
48+
$Type : 'UI.DataField',
49+
Value : title,
50+
Label : '{i18n>Title}',
51+
},
52+
{
53+
$Type : 'UI.DataField',
54+
Value : customer.name,
55+
Label : '{i18n>Customer}',
56+
},
57+
{
58+
$Type : 'UI.DataField',
59+
Value : status.descr,
60+
Label : '{i18n>Status}',
61+
Criticality : status.criticality,
62+
},
63+
{
64+
$Type : 'UI.DataField',
65+
Value : urgency.descr,
66+
Label : '{i18n>Urgency}',
67+
},
68+
],
69+
UI.SelectionFields : [
70+
status_code,
71+
urgency_code,
72+
],
73+
UI.HeaderInfo : {
74+
Title : {
75+
$Type : 'UI.DataField',
76+
Value : title,
77+
},
78+
TypeName : '',
79+
TypeNamePlural : '',
80+
Description : {
81+
$Type : 'UI.DataField',
82+
Value : customer.name,
83+
},
84+
TypeImageUrl : 'sap-icon://alert',
85+
},
86+
UI.FieldGroup #i18nDetails : {
87+
$Type : 'UI.FieldGroupType',
88+
Data : [
89+
{
90+
$Type : 'UI.DataField',
91+
Value : status_code,
92+
},
93+
{
94+
$Type : 'UI.DataField',
95+
Value : urgency_code,
96+
},
97+
],
98+
},
99+
);
100+
101+
annotate service.Incidents with {
102+
customer @(
103+
Common.ValueList : {
104+
$Type : 'Common.ValueListType',
105+
CollectionPath : 'Customers',
106+
Parameters : [
107+
{
108+
$Type : 'Common.ValueListParameterInOut',
109+
LocalDataProperty : customer_ID,
110+
ValueListProperty : 'ID',
111+
},
112+
{
113+
$Type : 'Common.ValueListParameterDisplayOnly',
114+
ValueListProperty : 'name',
115+
},
116+
{
117+
$Type : 'Common.ValueListParameterDisplayOnly',
118+
ValueListProperty : 'email',
119+
},
120+
],
121+
},
122+
Common.Text : {
123+
$value : customer.name,
124+
![@UI.TextArrangement] : #TextOnly
125+
},
126+
Common.ValueListWithFixedValues : false,
127+
)
128+
};
129+
130+
annotate service.Incidents with {
131+
status @(
132+
Common.Label : '{i18n>Status}',
133+
Common.ValueListWithFixedValues : true,
134+
Common.Text : status.descr,
135+
)
136+
};
137+
138+
annotate service.Incidents with {
139+
urgency @(
140+
Common.Label : '{i18n>Urgency}',
141+
Common.ValueListWithFixedValues : true,
142+
Common.Text : urgency.descr,
143+
)
144+
};
145+
146+
annotate service.Urgency with {
147+
code @Common.Text : descr
148+
};
149+
150+
annotate service.Status with {
151+
code @Common.Text : descr
152+
};
153+
154+
annotate service.Incidents.conversation with @(
155+
UI.LineItem #i18nConversation : [
156+
{
157+
$Type : 'UI.DataField',
158+
Value : author,
159+
Label : '{i18n>Author}',
160+
},
161+
{
162+
$Type : 'UI.DataField',
163+
Value : message,
164+
Label : '{i18n>Message}',
165+
},
166+
{
167+
$Type : 'UI.DataField',
168+
Value : timestamp,
169+
Label : '{i18n>Date}',
170+
},
171+
]
172+
);
173+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "incidents",
3+
"version": "0.0.1",
4+
"description": "An SAP Fiori application.",
5+
"keywords": [
6+
"ui5",
7+
"openui5",
8+
"sapui5"
9+
],
10+
"main": "webapp/index.html",
11+
"dependencies": {},
12+
"devDependencies": {
13+
"@ui5/cli": "^3.0.0",
14+
"@sap/ux-ui5-tooling": "1"
15+
},
16+
"scripts": {
17+
"deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf"
18+
}
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json
2+
3+
specVersion: "3.1"
4+
metadata:
5+
name: ns.incidents
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
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=An SAP Fiori application.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
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.134.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)