Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
19,838 changes: 19,838 additions & 0 deletions package-lock.json

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"], function (Controller) {
"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/Main.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.Main", {});
});
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
3 changes: 3 additions & 0 deletions webapp/i18n/i18n_en.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
appTitle=ui5-challenge
appDescription=ui5-challenge-desc
mainButton=Start
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>
32 changes: 28 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,40 @@
"controlId": "app",
"clearControlAggregation": false
},
"routes": [],
"targets": {}
"routes": [
{
"name": "Main",
"pattern": "",
"target": ["Main"]
}
],
"targets": {
"Main": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewName": "Main"
}
}
},
"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>
16 changes: 16 additions & 0 deletions webapp/view/Main.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
xmlns="sap.m" controllerName="ui5.challenge.controller.Main">
<Page id="Main" title="{i18n>appTitle}">
<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}"/>
</OverflowToolbar>
</footer>
</Page>
</mvc:View>