Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
597 changes: 295 additions & 302 deletions wdio.conf.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions webapp/controller/App.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sap.ui.define(["./BaseController"], function (BaseController) {
"use strict";

return BaseController.extend("ui5.challenge.controller.App", {
onAfterRendering: function () {
document.title = this.getView().getModel("i18n").getResourceBundle().getText("appTitle");
},
});
});
26 changes: 11 additions & 15 deletions webapp/controller/BaseController.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function (Controller) {
"use strict";
sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/UIComponent"], function (Controller, UIComponent) {
"use strict";

return Controller.extend("ui5.challenge.controller.BaseController", {
navTo: function (psTarget, pmParameters, pbReplace) {
this.getRouter().navTo(psTarget, pmParameters, pbReplace);
},
getRouter: function () {
return UIComponent.getRouterFor(this);
},
onPress: function () {

}
});
return Controller.extend("ui5.challenge.controller.BaseController", {
navTo: function (psTarget, pmParameters, pbReplace) {
this.getRouter().navTo(psTarget, pmParameters, pbReplace);
},
getRouter: function () {
return UIComponent.getRouterFor(this);
},
onPress: function () {},
});
});
5 changes: 5 additions & 0 deletions webapp/controller/Detail.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sap.ui.define(["./BaseController"], function (BaseController) {
"use strict";

return BaseController.extend("ui5.challenge.controller.Detail", {});
});
9 changes: 9 additions & 0 deletions webapp/controller/Main.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sap.ui.define(["./BaseController"], function (BaseController) {
"use strict";

return BaseController.extend("ui5.challenge.controller.Main", {
onNavToDetails: function (event) {
this.navTo("RouteDetail");
},
});
});
3 changes: 3 additions & 0 deletions webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
appTitle=ui5-challenge
appDescription=ui5-challenge-desc
mainButton=Start
7 changes: 7 additions & 0 deletions webapp/i18n/i18n_en.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
appTitle = ui5-challenge
appDescription = ui5-challenge-desc
mainButton = Start
mainTitleText = wdi5 rocks
detailButton = Goto Details
detailTitle = Details
detailHello = Hello World
36 changes: 15 additions & 21 deletions webapp/index.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<head>
<title>ui5-challenge</title>

<script
id="sap-ui-bootstrap"
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_horizon"
data-sap-ui-resourceroots='{
id="sap-ui-bootstrap"
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_horizon"
data-sap-ui-resourceroots='{
"ui5.challenge": "./"
}'
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-frameOptions="trusted"
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-frameOptions="trusted"
></script>
</head>
<body class="sapUiBody sapUiSizeCompact" id="content">
<div
data-sap-ui-component
data-name="ui5.challenge"
data-id="container"
data-settings='{"id" : "ui5.challenge"}'
data-handle-validation="true"
></div>
</body>
</html>
</head>
<body class="sapUiBody sapUiSizeCompact" id="content">
<div data-sap-ui-component data-name="ui5.challenge" data-id="container" data-settings='{"id" : "ui5.challenge"}' data-handle-validation="true"></div>
</body>
</html>
43 changes: 39 additions & 4 deletions webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
"version": "0.0.1"
},
"title": "{{appTitle}}",
"description": "{{appDescription}}"
"description": "{{appDescription}}",
"dataSources": {
"localJson": {
"uri": "model/Items.json",
"type": "JSON"
}
}
},
"sap.ui": {
"technology": "UI5",
Expand Down Expand Up @@ -47,22 +53,51 @@
"controlId": "app",
"clearControlAggregation": false
},
"routes": [],
"targets": {}
"routes": [
{
"name": "Main",
"pattern": "",
"target": ["Main"]
},
{
"name": "RouteDetail",
"pattern": "RouteDetail",
"target": ["Detail"]
}
],
"targets": {
"Main": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewName": "Main"
},
"Detail": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewName": "Detail"
}
}
},
"rootView": {
"viewName": "ui5.challenge.view.App",
"type": "XML",
"async": true,
"id": "app"
},

"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "ui5.challenge.i18n.i18n"
}
},
"": {
"type": "sap.ui.model.json.JSONModel",
"dataSource": "localJson"
}
}
}
}
}
22 changes: 22 additions & 0 deletions webapp/model/Items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Items": [
{
"Id": "1",
"Title": "Item 1",
"Description": "Best Item",
"Icon": "sap-icon://activity-assigned-to-goal"
},
{
"Id": "2",
"Title": "Item 2",
"Description": "a Item",
"Icon": "sap-icon://activity-assigned-to-goal"
},
{
"Id": "3",
"Title": "Item 3",
"Description": "Maybe not an Item",
"Icon": "sap-icon://activity-assigned-to-goal"
}
]
}
6 changes: 4 additions & 2 deletions webapp/view/App.view.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
xmlns="sap.m" controllerName="ui5.challenge.controller.App">
<Shell id="shell">
<App id="app" />
<App id="app">
</App>
</Shell>
</mvc:View>
6 changes: 6 additions & 0 deletions webapp/view/Detail.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
xmlns="sap.m" controllerName="ui5.challenge.controller.Detail">
<Page id="Detail" title="{i18n>detailTitle}">
<Text id="detailText" text="{i18n>detailHello}"></Text>
</Page>
</mvc:View>
18 changes: 18 additions & 0 deletions webapp/view/Main.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
xmlns="sap.m" controllerName="ui5.challenge.controller.Main">
<Page id="Main" title="{i18n>appTitle}">
<Title text="{i18n>mainTitleText}" id="mainTitle"></Title>
<List headerText="Products" items="{/Items}">
<items>
<StandardListItem title="{Title}" description="{Description}" icon="{Icon}" />
</items>
</List>
<footer>
<OverflowToolbar>
<ToolbarSpacer/>
<Button id="mainButton" type="Emphasized" text="{i18n>mainButton}"/>
<Button id="myControl" type="Ghost" text="{i18n>detailButton}" press=".onNavToDetails"/>
</OverflowToolbar>
</footer>
</Page>
</mvc:View>