From c3f001e9922ee986bfe6d74e1b53d1fe063352b0 Mon Sep 17 00:00:00 2001 From: nicogeburek Date: Wed, 8 Jun 2022 15:16:56 +0200 Subject: [PATCH 01/16] pass week1 --- webapp/controller/Main.controller.js | 37 ++++++++++++++++++++++++++++ webapp/i18n/i18n.properties | 1 + webapp/index.html | 2 +- webapp/manifest.json | 20 +++++++++++++-- webapp/view/Main.view.xml | 33 +++++++++++++++++++++++++ 5 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 webapp/controller/Main.controller.js create mode 100644 webapp/view/Main.view.xml diff --git a/webapp/controller/Main.controller.js b/webapp/controller/Main.controller.js new file mode 100644 index 0000000..c57f3b5 --- /dev/null +++ b/webapp/controller/Main.controller.js @@ -0,0 +1,37 @@ +sap.ui.define([ + "ui5/challenge/controller/BaseController", + "sap/m/Dialog", + "sap/m/Button", + "sap/m/Text" +], + /** + * @param {typeof sap.ui.core.mvc.Controller} Controller + */ + function (Controller, Dialog, Button, Text) { + "use strict"; + + return Controller.extend("ui5.challenge.controller.Main", { + onNav: function (oEvent) { + let oItem = oEvent.getSource() + let routeTo = oItem.getProperty("title") + let oRouter = this.getOwnerComponent().getRouter() + oRouter.navTo(routeTo, {}, false) + }, + onFeedback: function () { + this.oFeedbackDialog = new Dialog({ + type: "Standard", + title: "Bear with us.", + state: "Error", + content: new Text({ text: "We are working on implementing this feature." }) + .addStyleClass("sapUiTinyMargin"), + beginButton: new Button({ + text: "OK", + press: function () { + this.oFeedbackDialog.close() + }.bind(this) + }) + }) + this.oFeedbackDialog.open(); + } + }); + }); diff --git a/webapp/i18n/i18n.properties b/webapp/i18n/i18n.properties index e69de29..b584f6a 100644 --- a/webapp/i18n/i18n.properties +++ b/webapp/i18n/i18n.properties @@ -0,0 +1 @@ +title=Strokes Gained \ No newline at end of file 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