Skip to content
Closed
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
10,918 changes: 10,887 additions & 31 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.1.0",
"description": "SAP Community Code Challenge: This repository contains an empty OpenUI5 application and end-to-end test written with wdi5. Take part in the challenge and develop an app that passes the tests.",
"scripts": {
"start": "ui5 serve --port 8080",
"start": "ui5 serve --port 8080 -o index.html",
"test": "wdio run wdio.conf.js",
"ci-test": "run-p -r start wait-then-test",
"wait-then-test": "wait-on tcp:8080 && npm run test -- --headless"
Expand Down Expand Up @@ -36,6 +36,12 @@
"rimraf": "^3.0.2",
"wait-on": "^6.0.1",
"wdio-chromedriver-service": "^7.3.2",
"wdio-ui5-service": "^0.9.0"
"wdio-ui5-service": "^0.9.0",
"ui5-middleware-livereload": "^0.5.11"
},
"ui5": {
"dependencies": [
"ui5-middleware-livereload"
]
}
}
9 changes: 9 additions & 0 deletions ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ specVersion: '2.6'
metadata:
name: ui5-challenge
type: application
server:
customMiddleware:
- name: ui5-middleware-livereload
afterMiddleware: compression
configuration:
debug: true
extraExts: "xml,json,properties"
port: 35729
path: "webapp"
2 changes: 1 addition & 1 deletion wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exports.config = {
// Define all options that are relevant for the WebdriverIO instance here
//
// Level of logging verbosity: trace | debug | info | warn | error | silent
logLevel: 'info',
logLevel: 'error',
//
// Set specific log levels per logger
// loggers:
Expand Down
5 changes: 3 additions & 2 deletions webapp/controller/BaseController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function (Controller) {
"sap/ui/core/mvc/Controller",
"sap/ui/core/UIComponent"
], function (Controller, UIComponent) {
"use strict";

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

return BaseController.extend("ui5.challenge.controller.Detail", {
onInit: function () {},
openDialog: function () {
// ui5 create dialog
var oDialog = new sap.m.Dialog({
id: "myDialog",
title: "Dialog",
content: [
new sap.m.Text({
text: "Dialog content",
}),
],
beginButton: new sap.m.Button({
text: "OK",
press: function () {
oDialog.close();
},
}),
afterClose: function () {
oDialog.destroy();
},
});
// open dialog
oDialog.open();
},
});
});
17 changes: 17 additions & 0 deletions webapp/controller/Main.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sap.ui.define([
"./BaseController"
], function(BaseController) {
"use strict";

return BaseController.extend("ui5.challenge.controller.Main", {

onInit: function() {
},
navToDetail: function() {
this.navTo("Detail");
}


});

});
2 changes: 2 additions & 0 deletions webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mainTitleText=wdi5 rocks
detailTitleText=wdi5 rocks detail
2 changes: 1 addition & 1 deletion webapp/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<title>ui5-challenge</title>

<script
id="sap-ui-bootstrap"
Expand Down
44 changes: 40 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": {
"data": {
"uri": "model/data.json",
"type": "JSON"
}
}
},
"sap.ui": {
"technology": "UI5",
Expand Down Expand Up @@ -47,8 +53,34 @@
"controlId": "app",
"clearControlAggregation": false
},
"routes": [],
"targets": {}
"routes": [
{
"name": "default",
"pattern": "",
"target": "MainView"
},
{
"name": "Detail",
"pattern": "RouteDetail",
"target": "DetailView"
}
],
"targets": {
"MainView": {
"viewType": "XML",
"transition": "slide",
"viewLevel": 1,
"viewId": "Main",
"viewName": "Main"
},
"DetailView": {
"viewType": "XML",
"transition": "slide",
"viewLevel": 1,
"viewId": "Detail",
"viewName": "Detail"
}
}
},
"rootView": {
"viewName": "ui5.challenge.view.App",
Expand All @@ -62,7 +94,11 @@
"settings": {
"bundleName": "ui5.challenge.i18n.i18n"
}
},
"data": {
"type": "sap.ui.model.json.JSONModel",
"dataSource": "data"
}
}
}
}
}
11 changes: 11 additions & 0 deletions webapp/model/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"name": "first"
},
{
"name": "second"
},
{
"name": "third"
}
]
3 changes: 2 additions & 1 deletion webapp/view/App.view.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<Shell id="shell">
<App id="app" />
<App id="app">
</App>
</Shell>
</mvc:View>
10 changes: 10 additions & 0 deletions webapp/view/Detail.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<mvc:View
controllerName="ui5.challenge.controller.Detail"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<Page showNavButton="true">
<Title text="{i18n>detailTitleText}"></Title>
<Button id="dialogButton" text="openDialog" press="openDialog"></Button>
</Page>

</mvc:View>
14 changes: 14 additions & 0 deletions webapp/view/Main.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<mvc:View
controllerName="ui5.challenge.controller.Main"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<Title text="{i18n>mainTitleText}"></Title>
<Button id="mainButton" text="Hello" />
<Button id="myControl" press=".navToDetail" text="Navigate to Detail" />
<List items="{data>/}">
<StandardListItem
title="{data>name}"
type="Navigation"
press=".navToDetail"/>
</List>
</mvc:View>