Skip to content

Commit c1f29f2

Browse files
committed
add test incidents app
1 parent efca85b commit c1f29f2

26 files changed

+848
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
"lint": "npx eslint --fix . --no-cache",
7373
"in-cap-dev": "cd node_modules && rm -fr @sap/cds* @cap-js/db-service @cap-js/sqlite",
7474
"prettier": "npx -y prettier@3 --write .",
75-
"prettier:check": "npx -y prettier@3 --check ."
75+
"prettier:check": "npx -y prettier@3 --check .",
76+
"watch-sample": "cd test/incidents-app && cds watch",
77+
"watch-sample:hybrid": "cd test/incidents-app && cds watch --profile hybrid"
7678
}
7779
}
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>Mon Jun 19 2023 18:20:55 GMT+0530 (India Standard Time)|
5+
|**App Generator**<br>@sap/generator-fiori-elements|
6+
|**App Generator Version**<br>1.9.7|
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/processor/
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.0|
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>conversations|
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 and navigate to the following location in your browser:
29+
30+
http://localhost:4004/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: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
using ProcessorService as service from '../../srv/processor-service';
2+
using from '../../db/schema';
3+
4+
annotate service.Customers with @title : '{i18n>Customer}';
5+
annotate service.Incidents with @title : '{i18n>Incident}';
6+
annotate service.Incidents with @odata.draft.enabled;
7+
8+
annotate service.Incidents with @(
9+
UI.LineItem : [
10+
{
11+
$Type : 'UI.DataField',
12+
Value : title,
13+
Label : '{i18n>Title}',
14+
},
15+
{
16+
$Type : 'UI.DataField',
17+
Value : customer.name,
18+
Label : '{i18n>Customer}',
19+
},
20+
{
21+
$Type : 'UI.DataField',
22+
Value : status.descr,
23+
Criticality : status.criticality,
24+
Label : '{i18n>Status}',
25+
},
26+
{
27+
$Type : 'UI.DataField',
28+
Value : urgency.descr,
29+
Label : '{i18n>Urgency}',
30+
},
31+
]
32+
);
33+
annotate service.Incidents with @(
34+
UI.FieldGroup #GeneratedGroup1 : {
35+
$Type : 'UI.FieldGroupType',
36+
Data : [
37+
{
38+
$Type : 'UI.DataField',
39+
Value : title,
40+
Label : '{i18n>Title}',
41+
},
42+
{
43+
$Type : 'UI.DataField',
44+
Value : customer_ID,
45+
Label : '{i18n>Customer}',
46+
},
47+
],
48+
},
49+
UI.Facets : [
50+
{
51+
$Type : 'UI.CollectionFacet',
52+
Label : '{i18n>Overview}',
53+
ID : 'i18nOverview',
54+
Facets : [
55+
{
56+
$Type : 'UI.ReferenceFacet',
57+
ID : 'GeneratedFacet1',
58+
Label : 'General Information',
59+
Target : '@UI.FieldGroup#GeneratedGroup1',
60+
},
61+
{
62+
$Type : 'UI.ReferenceFacet',
63+
Label : '{i18n>Details}',
64+
ID : 'i18nDetails',
65+
Target : '@UI.FieldGroup#i18nDetails',
66+
},],
67+
},
68+
{
69+
$Type : 'UI.ReferenceFacet',
70+
Label : '{i18n>Conversation}',
71+
ID : 'i18nConversation',
72+
Target : 'conversation/@UI.LineItem#i18nConversation1',
73+
},
74+
]
75+
);
76+
annotate service.Incidents with @(
77+
UI.SelectionFields : [
78+
urgency_code,
79+
status_code,
80+
]
81+
);
82+
annotate service.Incidents with {
83+
status @Common.Label : '{i18n>Status}'
84+
};
85+
annotate service.Incidents with {
86+
urgency @Common.Label : '{i18n>Urgency}'
87+
};
88+
annotate service.Incidents with {
89+
status @Common.ValueListWithFixedValues : true
90+
};
91+
annotate service.Incidents with {
92+
urgency @Common.ValueListWithFixedValues : true
93+
};
94+
annotate service.Incidents with @(
95+
UI.HeaderInfo : {
96+
Title : {
97+
$Type : 'UI.DataField',
98+
Value : title,
99+
},
100+
TypeName : '',
101+
TypeNamePlural : '',
102+
Description : {
103+
$Type : 'UI.DataField',
104+
Value : customer.name,
105+
},
106+
TypeImageUrl : 'sap-icon://alert',
107+
}
108+
);
109+
annotate service.Incidents with @(
110+
UI.FieldGroup #i18nDetails : {
111+
$Type : 'UI.FieldGroupType',
112+
Data : [
113+
{
114+
$Type : 'UI.DataField',
115+
Value : status_code,
116+
Criticality : status.criticality,
117+
},
118+
{
119+
$Type : 'UI.DataField',
120+
Value : urgency_code,
121+
},],
122+
}
123+
);
124+
annotate service.Status with {
125+
code @Common.Text : descr
126+
};
127+
annotate service.Urgency with {
128+
code @Common.Text : descr
129+
};
130+
annotate service.Incidents with {
131+
customer @(Common.ValueList : {
132+
$Type : 'Common.ValueListType',
133+
CollectionPath : 'Customers',
134+
Parameters : [
135+
{
136+
$Type : 'Common.ValueListParameterInOut',
137+
LocalDataProperty : customer_ID,
138+
ValueListProperty : 'ID',
139+
},
140+
{
141+
$Type : 'Common.ValueListParameterDisplayOnly',
142+
ValueListProperty : 'name',
143+
},
144+
{
145+
$Type : 'Common.ValueListParameterDisplayOnly',
146+
ValueListProperty : 'email',
147+
},
148+
],
149+
},
150+
Common.ValueListWithFixedValues : false
151+
)};
152+
153+
annotate service.Incidents with {
154+
status @Common.Text : status.descr
155+
};
156+
annotate service.Incidents with {
157+
urgency @Common.Text : urgency.descr
158+
};
159+
annotate service.Incidents with {
160+
customer @Common.Text : {
161+
$value : customer.name,
162+
![@UI.TextArrangement] : #TextOnly,
163+
}
164+
};
165+
annotate service.Incidents.conversation with @(
166+
title : '{i18n>Conversation}',
167+
UI.LineItem #i18nConversation1 : [
168+
{
169+
$Type : 'UI.DataField',
170+
Value : author,
171+
Label : '{i18n>Author}',
172+
},
173+
{
174+
$Type : 'UI.DataField',
175+
Value : timestamp,
176+
Label : '{i18n>ConversationDate}',
177+
},{
178+
$Type : 'UI.DataField',
179+
Value : message,
180+
Label : '{i18n>Message}',
181+
},]
182+
);
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+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
specVersion: "2.5"
2+
metadata:
3+
name: ns.incidents
4+
type: application
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.
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://ui5.sap.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)