Skip to content

Commit f257ff3

Browse files
committed
UI5 Week 2 Challenge
1 parent a885dd9 commit f257ff3

File tree

14 files changed

+10750
-499
lines changed

14 files changed

+10750
-499
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"SAP HANA Database Explorer.displaySapWebAnalyticsStartupNotification": false
3+
}

CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

package-lock.json

Lines changed: 10627 additions & 452 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
"wdio-chromedriver-service": "^7.3.2",
3939
"wdio-ui5-service": "^0.9.0"
4040
}
41-
}
41+
}
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
sap.ui.define([
2-
"sap/ui/core/mvc/Controller"
3-
], function (Controller) {
2+
"sap/ui/core/mvc/Controller",
3+
"sap/ui/core/UIComponent",
4+
"sap/ui/core/routing/History"
5+
], function (Controller, UIComponent, History) {
46
"use strict";
57

68
return Controller.extend("ui5.challenge.controller.BaseController", {
79
navTo: function (psTarget, pmParameters, pbReplace) {
810
this.getRouter().navTo(psTarget, pmParameters, pbReplace);
911
},
10-
getRouter: function () {
11-
return UIComponent.getRouterFor(this);
12+
13+
onNavBack: function () {
14+
const sPreviousHash = History.getInstance().getPreviousHash();
15+
16+
if (sPreviousHash !== undefined) {
17+
window.history.back();
18+
} else {
19+
this.getRouter().navTo("RouteMainView", {}, true /* no history*/ );
20+
}
1221
},
13-
onPress: function () {
1422

23+
getRouter: function () {
24+
return UIComponent.getRouterFor(this);
1525
}
1626
});
17-
});
27+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
sap.ui.define([
2+
"./BaseController",
3+
"sap/ui/model/json/JSONModel",
4+
"sap/m/MessageToast",
5+
], function (Controller, JSONModel, MessageToast) {
6+
"use strict";
7+
8+
return Controller.extend("ui5.challenge.controller.DetailController", {
9+
10+
goBack: function () {
11+
this.onNavBack();
12+
}
13+
14+
});
15+
});

webapp/controller/MainController.controller.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,23 @@ sap.ui.define([
1010
// This is used for Dynamically change title
1111
// document.title = 'ui5-challenge';
1212

13+
console.log(this.getView().byId('titleId'));
14+
1315
var oDummyData = {
1416
Employees: [{
15-
Name: "Name1",
16-
Surname: "Surname1",
17+
Id: 1,
18+
Name: "Betty",
19+
Surname: "Buzzell",
1720
Age: 26
1821
}, {
19-
Name: "Name2",
20-
Surname: "Surname2",
22+
Id: 2,
23+
Name: "Donna",
24+
Surname: "Rosen",
2125
Age: 23
2226
}, {
23-
Name: "Name3",
24-
Surname: "Surname3",
27+
Id: 3,
28+
Name: "Craig",
29+
Surname: "Reid",
2530
Age: 32
2631
}]
2732
};
@@ -31,8 +36,15 @@ sap.ui.define([
3136

3237
},
3338

34-
onPress: function () {
35-
MessageToast.show("You pressed the Button!");
39+
onTestBtnPress: function (oEvent) {
40+
console.log(oEvent);
41+
MessageToast.show("You pressed the Test Button!");
42+
},
43+
44+
45+
onNextPagePress: function () {
46+
this.navTo("RouteDetailView");
3647
}
48+
3749
});
3850
});

webapp/i18n/i18n.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

22
browserTitle=ui5-challenge
33

4-
54
# Main Page
6-
mainPageTitle=ui5-challenge
5+
mainTitleText=wdi5 rocks
76
appTitle=ui5-challenge
87
appDescription=App test Desciption
98

109
mainButtonText=Test Button
10+
nextNacButton=Go to Detail Page
1111

1212
listEmployees=Employees
1313

14+

webapp/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>ui5-challenge</title>
4+
<title id="titleId">ui5-challenge</title>
55

66
<script
77
id="sap-ui-bootstrap"

webapp/manifest.json

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,35 @@
4747
"controlId": "app",
4848
"clearControlAggregation": false
4949
},
50-
"routes": [],
51-
"targets": {}
50+
"routes": [{
51+
"pattern": "",
52+
"name": "RouteMainView",
53+
"target": ["MainView"]
54+
},
55+
{
56+
"pattern": "RouteDetail",
57+
"name": "RouteDetailView",
58+
"target": ["DetailView"]
59+
}
60+
],
61+
"targets": {
62+
"MainView": {
63+
"viewId": "Main",
64+
"viewName": "Main",
65+
"viewLevel": 1
66+
},
67+
"DetailView": {
68+
"viewId": "Detail",
69+
"viewName": "Detail",
70+
"viewLevel": 2
71+
}
72+
}
5273
},
5374
"rootView": {
54-
"viewName": "ui5.challenge.view.Main",
75+
"viewName": "ui5.challenge.view.App",
5576
"type": "XML",
5677
"async": true,
57-
"id": "shell"
78+
"id": "app"
5879
},
5980
"models": {
6081
"i18n": {

0 commit comments

Comments
 (0)