From 0f155af7439375cba086b626bd1b2ccc39925c66 Mon Sep 17 00:00:00 2001 From: oblomov-dev <102328295+oblomov-dev@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:57:54 +0100 Subject: [PATCH] Ui5 v2 adjustments (#1578) * update * update * Update abaplint.jsonc * update * update * fixes --- .github/workflows/ui5lint.yml | 2 +- app/package.json | 2 +- app/webapp/Component.js | 6 +-- app/webapp/controller/App.controller.js | 24 +++++---- app/webapp/controller/View1.controller.js | 50 +++++++++++------- ci/abaplint/abaplint.jsonc | 2 +- src/01/03/z2ui5_cl_app_app_js.clas.abap | 24 +++++---- src/01/03/z2ui5_cl_app_component_js.clas.abap | 2 +- src/01/03/z2ui5_cl_app_view1_js.clas.abap | 52 ++++++++++++------- 9 files changed, 99 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ui5lint.yml b/.github/workflows/ui5lint.yml index 22f43a04..c041d491 100644 --- a/.github/workflows/ui5lint.yml +++ b/.github/workflows/ui5lint.yml @@ -16,4 +16,4 @@ jobs: with: node-version: '20.11.0' - run: cd app && npm i - - run: cd app && npm install --global @ui5/linter && ui5lint --details + - run: cd app && npm install --global @ui5/linter && ui5lint --ignore-pattern "webapp/index.html" --details diff --git a/app/package.json b/app/package.json index ff89cf7e..bacdc227 100644 --- a/app/package.json +++ b/app/package.json @@ -31,7 +31,7 @@ "undeploy": "cf undeploy z2ui5 --delete-services --delete-service-keys --delete-service-brokers", "deploy-test": "npm run build && fiori deploy --config ui5-deploy.yaml --testMode true", "build:cf": "ui5 build preload --clean-dest --config ui5-deploy.yaml --include-task=generateCachebusterInfo", - "transform": "node ../ci/app2string/trans2abap.js && abaplint --fix ../ci/app2string/abaplint.jsonc", + "transform": "node ../ci/app2string/trans2abap.js", "build:mta": "rimraf resources mta_archives && mbt build" }, "sapuxLayer": "CUSTOMER_BASE" diff --git a/app/webapp/Component.js b/app/webapp/Component.js index 005ae92c..6ca35092 100644 --- a/app/webapp/Component.js +++ b/app/webapp/Component.js @@ -16,9 +16,9 @@ sap.ui.define(["sap/ui/core/UIComponent", "z2ui5/model/models","z2ui5/cc/Server" z2ui5.oConfig.ComponentData = this.getComponentData(); try { - z2ui5.oLaunchpadService = await this.getService("ShellUIService"); - } catch (e) {} - + z2ui5.oLaunchpadService = await this.getService("ShellUIService"); + } catch (e) {} + let oVersionInfo = await VersionInfo.load(); z2ui5.oConfig.UI5VersionInfo = { version : oVersionInfo.version, diff --git a/app/webapp/controller/App.controller.js b/app/webapp/controller/App.controller.js index 72bff939..739285ca 100644 --- a/app/webapp/controller/App.controller.js +++ b/app/webapp/controller/App.controller.js @@ -639,7 +639,7 @@ sap.ui.define("z2ui5/MultiInputExt", ["sap/ui/core/Control", "sap/m/Token", "sap let table = z2ui5.oView.byId(this.getProperty("MultiInputId")); if (!table) { try { - table = Core.byId(Element.getElementsByName(this.getProperty("MultiInputName"))[0].id.replace('-inner', '')); + // table = Core.byId(Element.getElementsByName(this.getProperty("MultiInputName"))[0].id.replace('-inner', '')); } catch (e) { return; } @@ -667,8 +667,10 @@ sap.ui.define("z2ui5/MultiInputExt", ["sap/ui/core/Control", "sap/m/Token", "sap ); sap.ui.define("z2ui5/CameraPicture" , [ - "sap/ui/core/Control" -], function (Control) { + "sap/ui/core/Control", + "sap/m/Dialog", + "sap/m/Button" +], function (Control, Dialog, Button) { "use strict"; return Control.extend("z2ui5.CameraPicture", { metadata: { @@ -708,30 +710,30 @@ sap.ui.define("z2ui5/CameraPicture" , [ onPicture: function (oEvent) { if (!this._oScanDialog) { - this._oScanDialog = new sap.m.Dialog({ + this._oScanDialog = new Dialog({ title: "Device Photo Function", contentWidth: "640px", contentHeight: "480px", horizontalScrolling: false, verticalScrolling: false, - stretchOnPhone: true, + stretch: true, content: [ - new sap.ui.core.HTML({ + new HTML({ id: this.getId() + 'PictureContainer', content: '