From a885dd940cd0ef70804e226e57d9438a1d24add7 Mon Sep 17 00:00:00 2001 From: nailspahija Date: Sat, 11 Jun 2022 15:47:43 +0200 Subject: [PATCH 1/4] Week1 Challenge --- .../controller/MainController.controller.js | 38 +++++++++++++++++++ webapp/i18n/i18n.properties | 13 +++++++ webapp/index.html | 2 +- webapp/manifest.json | 4 +- webapp/test/e2e/week1.test.js | 8 ++-- webapp/view/App.view.xml | 5 --- webapp/view/Main.view.xml | 31 +++++++++++++++ 7 files changed, 90 insertions(+), 11 deletions(-) create mode 100644 webapp/controller/MainController.controller.js delete mode 100644 webapp/view/App.view.xml create mode 100644 webapp/view/Main.view.xml diff --git a/webapp/controller/MainController.controller.js b/webapp/controller/MainController.controller.js new file mode 100644 index 0000000..ac2d69c --- /dev/null +++ b/webapp/controller/MainController.controller.js @@ -0,0 +1,38 @@ +sap.ui.define([ + "./BaseController", + "sap/ui/model/json/JSONModel", + "sap/m/MessageToast", +], function (Controller, JSONModel, MessageToast) { + "use strict"; + + return Controller.extend("ui5.challenge.controller.MainController", { + onInit: function () { + // This is used for Dynamically change title + // document.title = 'ui5-challenge'; + + var oDummyData = { + Employees: [{ + Name: "Name1", + Surname: "Surname1", + Age: 26 + }, { + Name: "Name2", + Surname: "Surname2", + Age: 23 + }, { + Name: "Name3", + Surname: "Surname3", + Age: 32 + }] + }; + + const oModel = new JSONModel(oDummyData); + this.getView().setModel(oModel); + + }, + + onPress: function () { + MessageToast.show("You pressed the Button!"); + } + }); +}); \ No newline at end of file diff --git a/webapp/i18n/i18n.properties b/webapp/i18n/i18n.properties index e69de29..74cdc55 100644 --- a/webapp/i18n/i18n.properties +++ b/webapp/i18n/i18n.properties @@ -0,0 +1,13 @@ + +browserTitle=ui5-challenge + + +# Main Page +mainPageTitle=ui5-challenge +appTitle=ui5-challenge +appDescription=App test Desciption + +mainButtonText=Test Button + +listEmployees=Employees + diff --git a/webapp/index.html b/webapp/index.html index 01c1bb6..f3ea286 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -1,7 +1,7 @@ - title + ui5-challenge