first commit

This commit is contained in:
2025-04-25 22:19:01 +02:00
commit 777a29d3bc
35 changed files with 14665 additions and 0 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
node_modules/
dist/
.scp/
.env
Makefile*.mta
mta_archives
mta-*
resources
archive.zip
.*_mta_build_tmp

36
README.md Normal file
View File

@ -0,0 +1,36 @@
## Application Details
| |
| ------------- |
|**Generation Date and Time**<br>Fri Apr 25 2025 11:02:37 GMT+0200 (Central European Summer Time)|
|**App Generator**<br>@sap/generator-fiori-freestyle|
|**App Generator Version**<br>1.17.3|
|**Generation Platform**<br>Visual Studio Code|
|**Template Used**<br>Basic|
|**Service Type**<br>None|
|**Service URL**<br>N/A|
|**Module Name**<br>mvcapp00124|
|**Application Title**<br>Flighty|
|**Namespace**<br>|
|**UI5 Theme**<br>sap_fiori_3|
|**UI5 Version**<br>1.135.0|
|**Enable Code Assist Libraries**<br>False|
|**Enable TypeScript**<br>False|
|**Add Eslint configuration**<br>False|
## mvcapp00124
Flighty
### Starting the generated app
- This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply run the following from the generated app root folder:
```
npm start
```
#### Pre-requisites:
1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org)

13500
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

28
package.json Normal file
View File

@ -0,0 +1,28 @@
{
"name": "mvcapp00124",
"version": "0.0.1",
"description": "Flighty",
"keywords": [
"ui5",
"openui5",
"sapui5"
],
"main": "webapp/index.html",
"dependencies": {},
"devDependencies": {
"@ui5/cli": "^3.0.0",
"@sap/ux-ui5-tooling": "1"
},
"scripts": {
"start": "fiori run --open \"test/flpSandbox.html?sap-ui-xx-viewCache=false#mvcapp00124-display\"",
"start-local": "fiori run --config ./ui5-local.yaml --open \"test/flpSandbox.html?sap-ui-xx-viewCache=false#mvcapp00124-display\"",
"build": "ui5 build --config=ui5.yaml --clean-dest --dest dist",
"deploy": "fiori verify",
"deploy-config": "fiori add deploy-config",
"start-noflp": "fiori run --open \"index.html?sap-ui-xx-viewCache=false\"",
"int-test": "fiori run --open 'test/integration/opaTests.qunit.html'",
"start-variants-management": "fiori run --open \"preview.html?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=true&sap-ui-rta-skip-flex-validation=true#preview-app\"",
"unit-test": "fiori run --open 'test/unit/unitTests.qunit.html'"
},
"sapuxLayer": "CUSTOMER_BASE"
}

31
ui5-local.yaml Normal file
View File

@ -0,0 +1,31 @@
# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json
specVersion: "3.1"
metadata:
name: mvcapp00124
type: application
framework:
name: SAPUI5
version: 1.135.0
libraries:
- name: sap.m
- name: sap.ui.core
- name: sap.ushell
- name: themelib_sap_fiori_3
server:
customMiddleware:
- name: fiori-tools-appreload
afterMiddleware: compression
configuration:
port: 35729
path: webapp
delay: 300
- name: fiori-tools-preview
afterMiddleware: fiori-tools-appreload
configuration:
component: mvcapp00124
ui5Theme: sap_fiori_3
- name: fiori-tools-proxy
afterMiddleware: compression
configuration:
ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted

28
ui5.yaml Normal file
View File

@ -0,0 +1,28 @@
# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json
specVersion: "3.1"
metadata:
name: mvcapp00124
type: application
server:
customMiddleware:
- name: fiori-tools-proxy
afterMiddleware: compression
configuration:
ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
ui5:
path:
- /resources
- /test-resources
url: https://ui5.sap.com
- name: fiori-tools-appreload
afterMiddleware: compression
configuration:
port: 35729
path: webapp
delay: 300
- name: fiori-tools-preview
afterMiddleware: fiori-tools-appreload
configuration:
component: mvcapp00124
ui5Theme: sap_fiori_3

37
webapp/Component.js Normal file
View File

@ -0,0 +1,37 @@
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/Device",
"mvcapp00124/model/models"
], function (UIComponent, Device, models) {
"use strict";
return UIComponent.extend("mvcapp00124.Component", {
metadata: {
manifest: "json",
},
init: function() {
// call the base component's init function
UIComponent.prototype.init.apply(this, arguments);
// enable routing
this.getRouter().initialize();
// set the device model
this.setModel(models.createDeviceModel(), "device");
},
createContent: function() {
var oViewData = {
component: this,
};
return sap.ui.view({
viewName: "mvcapp00124.view.App",
type: sap.ui.core.mvc.ViewType.XML,
viewData: oViewData,
});
}
});
});

View File

@ -0,0 +1,10 @@
sap.ui.define([
"sap/ui/core/mvc/Controller"
], (BaseController) => {
"use strict";
return BaseController.extend("mvcapp00124.controller.App", {
onInit() {
}
});
});

View File

@ -0,0 +1,30 @@
sap.ui.define(
["sap/ui/core/mvc/Controller", "sap/ui/core/routing/History"],
/**
* @param {typeof sap.ui.core.mvc.Controller} Controller
*/
function (Controller, History) {
"use strict";
return Controller.extend("mvcapp00124.controller.BaseController", {
/**
* @override
*/
onInit: function () { },
getRouter: function() {
return sap.ui.core.UIComponent.getRouterFor(this);
},
onNavBack: function(oEvent) {
var oHistory, sPreviousHash;
oHistory = History.getInstance();
sPreviousHash = oHistory.getPreviousHash();
if(sPreviousHash !== undefined) {
window.history.go(-1);
}else {
this.getRouter().navTo("home", {}, {}, true);
}
}
});
},
);

View File

@ -0,0 +1,25 @@
sap.ui.define(
["mvcapp00124/controller/BaseController"],
/**
* @param {typeof sap.ui.core.mvc.Controller} Controller
*/
function (Controller) {
"use strict";
return Controller.extend("mvcapp00124.controller.Enter", {
/**
* @override
*/
onInit: function () { },
onPressNavTo: function(oEvent) {
this.getRouter().navTo("flightList", {}, {}, false);
},
onPressTargets: function(oEvent) {
this.getRouter().getTargets().display("flightList");
}
});
}
);

View File

@ -0,0 +1,25 @@
sap.ui.define(
["mvcapp00124/controller/BaseController"],
/**
* @param {typeof sap.ui.core.mvc.Controller} Controller
*/
function (Controller) {
"use strict";
return Controller.extend("mvcapp00124.controller.Main", {
onInit: function () {
// var oRootPath = jQuery.sap.getModulePath("mvcapp00124");
// var oModel = new sap.ui.model.json.JSONModel(
// oRootPath + "/model/flights.json"
// );
// this.getView().setModel(oModel);
},
handleLineItemPress: function () {
alert("Line item passed.");
},
});
}
);

1
webapp/css/style.css Normal file
View File

@ -0,0 +1 @@
/* Enter your custom styles here */

View File

@ -0,0 +1,11 @@
# This is the resource bundle for mvcapp00124
#Texts for manifest.json
#XTIT: Application name
appTitle=Flighty
#YDES: Application description
appDescription=Flighty
#XTIT: Main view title
title=Flighty

45
webapp/index.html Normal file
View File

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Flighty</title>
<style>
html,
body,
body>div,
#container,
#container-uiarea {
height: 100%;
}
</style>
<script id="sap-ui-bootstrap" src="resources/sap-ui-core.js" data-sap-ui-theme="sap_fiori_3"
data-sap-ui-resourceroots='{
"mvcapp00124": "./"
}' 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>
<script>
sap.ui.getCore().attachInit(function () {
sap.ui.require([
"sap/m/Shell",
"sap/ui/core/ComponentContainer"
], function (Shell, ComponentContainer) {
new Shell({
app: new ComponentContainer({
name: "mvcapp00124",
settings: {
id: "webapp"
}
})
}).placeAt("content");
});
});
</script>
</head>
<body class="sapUiBody sapUiSizeCompact" id="content">
</body>
</html>

124
webapp/manifest.json Normal file
View File

@ -0,0 +1,124 @@
{
"_version": "1.65.0",
"sap.app": {
"id": "mvcapp00124",
"type": "application",
"i18n": "i18n/i18n.properties",
"applicationVersion": {
"version": "0.0.1"
},
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"resources": "resources.json",
"sourceTemplate": {
"id": "@sap/generator-fiori:basic",
"version": "1.17.3",
"toolsId": "4a8f3414-8cba-4741-abb8-b4eba97f9c60"
},
"dataSources": {
"localJsonModel": {
"uri": "model/flights.json",
"type": "JSON"
}
}
},
"sap.ui": {
"technology": "UI5",
"icons": {
"icon": "",
"favIcon": "",
"phone": "",
"phone@2": "",
"tablet": "",
"tablet@2": ""
},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
}
},
"sap.ui5": {
"flexEnabled": false,
"dependencies": {
"minUI5Version": "1.135.0",
"libs": {
"sap.m": {},
"sap.ui.core": {},
"sap.f": {},
"sap.suite.ui.generic.template": {},
"sap.ui.comp": {},
"sap.ui.generic.app": {},
"sap.ui.table": {},
"sap.ushell": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "mvcapp00124.i18n.i18n"
}
},
"": {
"type": "sap.ui.model.json.JSONModel",
"dataSource": "localJsonModel"
}
},
"resources": {
"css": [
{
"uri": "css/style.css"
}
]
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"controlAggregation": "pages",
"controlId": "app",
"transition": "slide",
"type": "View",
"viewType": "XML",
"path": "mvcapp00124.view",
"async": true,
"viewPath": "mvcapp00124.view"
},
"routes": [
{
"name": "home",
"pattern": "",
"target": "home"
}, {
"name": "flightList",
"pattern": "flightList",
"target": "flightList"
}
],
"targets": {
"home": {
"viewId": "enter",
"viewName": "enter",
"controlId": "app",
"viewLevel": 1
},
"flightList": {
"viewId": "main",
"viewName": "main",
"controlId": "app",
"viewLevel": 1
}
}
},
"rootView": {
"viewName": "mvcapp00124.view.enter",
"type": "XML",
"id": "App",
"async": true
}
}
}

44
webapp/model/flights.json Normal file
View File

@ -0,0 +1,44 @@
{
"Flight":[
{
"flightId" : "LH1234",
"from" : "Munich",
"to" : "Frankfurt",
"date" : "11.05.2013",
"time" : "16.50",
"status" : "On time",
"plannedArrival" : "16:45",
"info" : "Arrives early"
},
{
"flightId" : "LH2345",
"from" : "Frankfurt",
"to" : "Montreal",
"date" : "23.12.2015",
"time" : "11.20",
"status" : "Delayed",
"plannedArrival" : "12:20",
"info" : "Delayed due to technical problems"
},
{
"flightId" : "LH3456",
"from" : "Montreal",
"to" : "New York",
"date" : "23.07.2016",
"time" : "12.30",
"status" : "Canceled",
"plannedArrival" : "CANCELED",
"info" : "Canceled due to bad weather"
},
{
"flightId" : "LH7890",
"from" : "Dortmund",
"to" : "Sharm-el-Sheikh",
"date" : "26.08.2016",
"time" : "12.30",
"status" : "On time",
"plannedArrival" : "09:00",
"info" : "Arrives on time"
}
]
}

20
webapp/model/models.js Normal file
View File

@ -0,0 +1,20 @@
sap.ui.define([
"sap/ui/model/json/JSONModel",
"sap/ui/Device"
],
function (JSONModel, Device) {
"use strict";
return {
/**
* Provides runtime information for the device the UI5 app is running on as a JSONModel.
* @returns {sap.ui.model.json.JSONModel} The device model.
*/
createDeviceModel: function () {
var oModel = new JSONModel(Device);
oModel.setDefaultBindingMode("OneWay");
return oModel;
}
};
});

View File

@ -0,0 +1,81 @@
<!DOCTYPE HTML>
<html lang="en">
<!-- Copyright (c) 2015 SAP AG, All Rights Reserved -->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{appTitle}}</title>
<!-- Bootstrap the unified shell in sandbox mode for standalone usage.
The renderer is specified in the global Unified Shell configuration object "sap-ushell-config".
The fiori2 renderer will render the shell header allowing, for instance,
testing of additional application setting buttons.
The navigation target resolution service is configured in a way that the empty URL hash is
resolved to our own application.
This example uses relative path references for the SAPUI5 resources and test-resources;
it might be necessary to adapt them depending on the target runtime platform.
The sandbox platform is restricted to development or demo use cases and must NOT be used
for productive scenarios.
-->
<script type="text/javascript">
window["sap-ushell-config"] = {
defaultRenderer: "fiori2",
bootstrapPlugins: {
"RuntimeAuthoringPlugin": {
component: "sap.ushell.plugins.rta",
config: {
validateAppVersion: false
}
}
},
renderers: {
fiori2: {
componentData: {
config: {
search: "hidden",
enableSearch: false
}
}
}
},
applications: {
"mvcapp00124-display": {
title: "Flighty",
description: "Flighty",
additionalInformation: "SAPUI5.Component=mvcapp00124",
applicationType: "URL",
url: "../"
}
}
};
</script>
<script src="../test-resources/sap/ushell/bootstrap/sandbox.js" id="sap-ushell-bootstrap"></script>
<!-- Bootstrap the UI5 core library. 'data-sap-ui-frameOptions="allow"'' is a NON-SECURE setting for test environments -->
<script id="sap-ui-bootstrap"
src="../resources/sap-ui-core.js"
data-sap-ui-libs="sap.m,sap.ui.core,sap.ushell"
data-sap-ui-async="true"
data-sap-ui-preload="async"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-compatVersion="edge"
data-sap-ui-language="en"
data-sap-ui-resourceroots='{"mvcapp00124": "../"}'
data-sap-ui-frameOptions="allow"
data-sap-ui-flexibilityServices='[{"connector": "LocalStorageConnector"}]'>
</script>
<script id="locate-reuse-libs" src="./locate-reuse-libs.js" data-sap-ui-manifest-uri="../manifest.json">
</script>
</head>
<!-- UI Content -->
<body class="sapUiBody" id="content">
</body>
</html>

View File

@ -0,0 +1,13 @@
sap.ui.define([
"sap/ui/test/Opa5",
"./arrangements/Startup",
"./NavigationJourney"
], function (Opa5, Startup) {
"use strict";
Opa5.extendConfig({
arrangements: new Startup(),
viewNamespace: "mvcapp00124.view.",
autoWait: true
});
});

View File

@ -0,0 +1,23 @@
/*global QUnit*/
sap.ui.define([
"sap/ui/test/opaQunit",
"./pages/App",
"./pages/Main"
], function (opaTest) {
"use strict";
QUnit.module("Navigation Journey");
opaTest("Should see the initial page of the app", function (Given, When, Then) {
// Arrangements
Given.iStartMyApp();
// Assertions
Then.onTheAppPage.iShouldSeeTheApp();
Then.onTheViewPage.iShouldSeeThePageView();
//Cleanup
Then.iTeardownMyApp();
});
});

View File

@ -0,0 +1,25 @@
sap.ui.define([
"sap/ui/test/Opa5"
], function (Opa5) {
"use strict";
return Opa5.extend("integration.arrangements.Startup", {
iStartMyApp: function (oOptionsParameter) {
var oOptions = oOptionsParameter || {};
// start the app with a minimal delay to make tests fast but still async to discover basic timing issues
oOptions.delay = oOptions.delay || 50;
// start the app UI component
this.iStartMyUIComponent({
componentConfig: {
name: "mvcapp00124",
async: true
},
hash: oOptions.hash,
autoWait: oOptions.autoWait
});
}
});
});

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Integration tests for Basic Template</title>
<script
id="sap-ui-bootstrap"
src="../../resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-resourceroots='{
"mvcapp00124": "../../",
"integration": "./"
}'
data-sap-ui-animation="false"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-preload="async">
</script>
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css">
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-junit.js"></script>
<script src="opaTests.qunit.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
</body>
</html>

View File

@ -0,0 +1,7 @@
/* global QUnit */
sap.ui.require(["mvcapp00124/test/integration/AllJourneys"
], function () {
QUnit.config.autostart = false;
QUnit.start();
});

View File

@ -0,0 +1,28 @@
sap.ui.define([
"sap/ui/test/Opa5"
], function (Opa5) {
"use strict";
var sViewName = "App";
Opa5.createPageObjects({
onTheAppPage: {
actions: {},
assertions: {
iShouldSeeTheApp: function () {
return this.waitFor({
id: "app",
viewName: sViewName,
success: function () {
Opa5.assert.ok(true, "The " + sViewName + " view is displayed");
},
errorMessage: "Did not find the " + sViewName + " view"
});
}
}
}
});
});

View File

@ -0,0 +1,28 @@
sap.ui.define([
"sap/ui/test/Opa5"
], function (Opa5) {
"use strict";
var sViewName = "Main";
Opa5.createPageObjects({
onTheViewPage: {
actions: {},
assertions: {
iShouldSeeThePageView: function () {
return this.waitFor({
id: "page",
viewName: sViewName,
success: function () {
Opa5.assert.ok(true, "The " + sViewName + " view is displayed");
},
errorMessage: "Did not find the " + sViewName + " view"
});
}
}
}
});
});

View File

@ -0,0 +1,267 @@
(function (sap) {
var fioriToolsGetManifestLibs = function (manifestPath) {
var url = manifestPath;
var result = "";
// SAPUI5 delivered namespaces from https://ui5.sap.com/#/api/sap
var ui5Libs = [
"sap.apf",
"sap.base",
"sap.chart",
"sap.collaboration",
"sap.f",
"sap.fe",
"sap.fileviewer",
"sap.gantt",
"sap.landvisz",
"sap.m",
"sap.ndc",
"sap.ovp",
"sap.rules",
"sap.suite",
"sap.tnt",
"sap.ui",
"sap.uiext",
"sap.ushell",
"sap.uxap",
"sap.viz",
"sap.webanalytics",
"sap.zen"
];
var getKeys = function (libOrComp, libOrCompKeysString) {
var libOrCompKeysStringTmp = libOrCompKeysString;
Object.keys(libOrComp).forEach(function (libOrCompKey) {
// ignore libs or Components that start with SAPUI5 delivered namespaces
if (!ui5Libs.some(function (substring) { return libOrCompKey === substring || libOrCompKey.startsWith(substring + "."); })) {
if (libOrCompKeysStringTmp.length > 0) {
libOrCompKeysStringTmp = libOrCompKeysStringTmp + "," + libOrCompKey;
} else {
libOrCompKeysStringTmp = libOrCompKey;
}
}
});
return libOrCompKeysStringTmp;
};
var getComponentUsageNames = function (compUsages, libOrCompKeysString) {
var libOrCompKeysStringTmp = libOrCompKeysString;
var compNames = Object.keys(compUsages).map(function (compUsageKey) {
return compUsages[compUsageKey].name;
});
compNames.forEach(function (compName) {
// ignore libs or Components that start with SAPUI5 delivered namespaces
if (!ui5Libs.some(function (substring) { return compName === substring || compName.startsWith(substring + "."); })) {
if (libOrCompKeysStringTmp.length > 0) {
libOrCompKeysStringTmp = libOrCompKeysStringTmp + "," + compName;
} else {
libOrCompKeysStringTmp = compName;
}
}
});
return libOrCompKeysStringTmp;
};
return new Promise(function (resolve, reject) {
sap.ui.require(["sap/ui/thirdparty/jquery"], function (localJQuery) {
localJQuery.ajax(url)
.done(function (manifest) {
if (manifest) {
if (
manifest["sap.ui5"] &&
manifest["sap.ui5"].dependencies
) {
if (manifest["sap.ui5"].dependencies.libs) {
result = getKeys(manifest["sap.ui5"].dependencies.libs, result);
}
if (manifest["sap.ui5"].dependencies.components) {
result = getKeys(manifest["sap.ui5"].dependencies.components, result);
}
}
if (
manifest["sap.ui5"] &&
manifest["sap.ui5"].componentUsages
) {
result = getComponentUsageNames(manifest["sap.ui5"].componentUsages, result);
}
}
resolve(result);
})
.fail(function () {
reject(new Error("Could not fetch manifest at '" + manifestPath));
});
});
});
};
var registerModules = function (dataFromAppIndex) {
Object.keys(dataFromAppIndex).forEach(function (moduleDefinitionKey) {
var moduleDefinition = dataFromAppIndex[moduleDefinitionKey];
if (moduleDefinition && moduleDefinition.dependencies) {
moduleDefinition.dependencies.forEach(function (dependency) {
if (dependency.url && dependency.url.length > 0 && dependency.type === "UI5LIB") {
sap.ui.require(["sap/base/Log"], function (Log) {
Log.info("Registering Library " +
encodeURI(dependency.componentId) +
" from server " +
encodeURI(dependency.url));
});
var compId = dependency.componentId.replace(/\./g, "/");
var config = {
paths: {
}
};
config.paths[compId] = dependency.url;
sap.ui.loader.config(config);
}
});
}
});
};
/**
* Registers the module paths for dependencies of the given component.
* @param {string} manifestPath The the path to the app manifest path
* for which the dependencies should be registered.
* @returns {Promise} A promise which is resolved when the ajax request for
* the app-index was successful and the module paths were registered.
*/
var registerComponentDependencyPaths = function (manifestPath) {
return fioriToolsGetManifestLibs(manifestPath).then(function (libs) {
if (libs && libs.length > 0) {
var url = "/sap/bc/ui2/app_index/ui5_app_info?id=" + libs;
var sapClient = "";
return new Promise(
function (resolve) {
sapClient = new URLSearchParams(window.location.search).get("sap-client");
if (sapClient && sapClient.length === 3) {
url = url + "&sap-client=" + sapClient;
}
resolve(url);
}).then(function (url2) {
sap.ui.require(["sap/ui/thirdparty/jquery"], function (localJQuery) {
return localJQuery.ajax(url2)
.done(function (data) {
if (data) {
registerModules(data);
}
});
});
});
} else {
return undefined;
}
});
};
var registerSAPFonts = function () {
sap.ui.require(["sap/ui/core/IconPool"], function (IconPool) {
//Fiori Theme font family and URI
var fioriTheme = {
fontFamily: "SAP-icons-TNT",
fontURI: sap.ui.require.toUrl("sap/tnt/themes/base/fonts/")
};
//Registering to the icon pool
IconPool.registerFont(fioriTheme);
//SAP Business Suite Theme font family and URI
var bSuiteTheme = {
fontFamily: "BusinessSuiteInAppSymbols",
fontURI: sap.ui.require.toUrl("sap/ushell/themes/base/fonts/")
};
//Registering to the icon pool
IconPool.registerFont(bSuiteTheme);
});
};
/*eslint-disable fiori-custom/sap-browser-api-warning, fiori-custom/sap-no-dom-access*/
var currentScript = document.getElementById("locate-reuse-libs");
if (!currentScript) {
currentScript = document.currentScript;
}
var manifestUri = currentScript.getAttribute("data-sap-ui-manifest-uri");
var componentName = currentScript.getAttribute("data-sap-ui-componentName");
var useMockserver = currentScript.getAttribute("data-sap-ui-use-mockserver");
// Patch (KW): resourceRoot is needed to load the correct ResourceBundles
var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1);
return registerComponentDependencyPaths(manifestUri)
.catch(function (error) {
sap.ui.require(["sap/base/Log"], function (Log) {
Log.error(error);
});
})
.finally(function () {
// setting the app title with internationalization
sap.ui.require(["sap/ui/core/Core"], async function(Core) {
Core.ready(() => {
sap.ui.require(["sap/base/i18n/Localization"], function (Localization) {
sap.ui.require(["sap/base/i18n/ResourceBundle"], function (ResourceBundle) {
var oResourceBundle = ResourceBundle.create({
// Patch (KW): resourceRoot is needed to load the correct ResourceBundles
url: resourceRoot + "i18n/i18n.properties",
locale: Localization.getLanguage()
});
document.title = oResourceBundle.getText("appTitle");
});
});
});
});
if (componentName && componentName.length > 0) {
if (useMockserver && useMockserver === "true") {
sap.ui.require(["sap/ui/core/Core"], async function(Core) {
Core.ready(() => {
registerSAPFonts();
sap.ui.require([componentName.replace(/\./g, "/") + "/localService/mockserver"], function (server) {
// set up test service for local testing
server.init();
// initialize the ushell sandbox component
sap.ui.require(["sap/ushell/Container"], async function (Container) {
Container.createRenderer(true).then(function (component) {
component.placeAt("content");
});
});
});
});
});
} else {
// Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components
sap.ui.require(["sap/ui/core/ComponentSupport"]);
// setting the app title with the i18n text
sap.ui.require(["sap/ui/core/Core"], async function(Core) {
Core.ready(() => {
registerSAPFonts();
sap.ui.require(["sap/base/i18n/Localization"], function (Localization) {
sap.ui.require(["sap/base/i18n/ResourceBundle"], function (ResourceBundle) {
var oResourceBundle = ResourceBundle.create({
// Patch (KW): resourceRoot is needed to load the correct ResourceBundles
url: resourceRoot + "i18n/i18n.properties",
locale: Localization.getLanguage()
});
document.title = oResourceBundle.getText("appTitle");
});
});
});
});
}
} else {
sap.ui.require(["sap/ui/core/Core"], async function(Core) {
Core.ready(() => {
registerSAPFonts();
// initialize the ushell sandbox component
sap.ui.require(["sap/ushell/Container"], async function (Container) {
try {
Container.createRenderer(true).then(function (component) {
component.placeAt("content");
});
} catch (error) {
// support older versions of ui5
Container.createRenderer().placeAt("content");
}
});
});
});
}
});
})(sap);

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>QUnit test suite</title>
<script src="../resources/sap/ui/qunit/qunit-redirect.js"></script>
<script src="testsuite.qunit.js" data-sap-ui-testsuite></script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,16 @@
/* global window, parent, location */
// eslint-disable-next-line fiori-custom/sap-no-global-define
window.suite = function() {
"use strict";
// eslint-disable-next-line
var oSuite = new parent.jsUnitTestSuite(),
sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1);
oSuite.addTestPage(sContextPath + 'unit/unitTests.qunit.html');
oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html');
return oSuite;
};

View File

@ -0,0 +1,5 @@
sap.ui.define([
"mvcapp00124/test/unit/controller/Main.controller"
], function () {
"use strict";
});

View File

@ -0,0 +1,16 @@
/*global QUnit*/
sap.ui.define([
"mvcapp00124/controller/Main.controller"
], function (Controller) {
"use strict";
QUnit.module("Main Controller");
QUnit.test("I should test the Main controller", function (assert) {
var oAppController = new Controller();
oAppController.onInit();
assert.ok(oAppController);
});
});

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Unit tests for mvcapp00124</title>
<script
id="sap-ui-bootstrap"
src="../../resources/sap-ui-core.js"
data-sap-ui-resourceroots='{
"mvcapp00124": "../../",
"unit": "."
}'
data-sap-ui-async="true"
data-sap-ui-compat-version="edge">
</script>
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css">
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-junit.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-coverage.js"></script>
<script src="../../resources/sap/ui/thirdparty/sinon.js"></script>
<script src="../../resources/sap/ui/thirdparty/sinon-qunit.js"></script>
<script src="unitTests.qunit.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
</body>
</html>

View File

@ -0,0 +1,12 @@
/* global QUnit */
QUnit.config.autostart = false;
sap.ui.getCore().attachInit(function () {
"use strict";
sap.ui.require([
"mvcapp00124/test/unit/AllTests"
], function () {
QUnit.start();
});
});

7
webapp/view/App.view.xml Normal file
View File

@ -0,0 +1,7 @@
<mvc:View controllerName="mvcapp00124.controller.App"
displayBlock="true"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<App id="app">
</App>
</mvc:View>

View File

@ -0,0 +1,15 @@
<mvc:View controllerName="mvcapp00124.controller.Enter"
displayBlock="true"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<Page id="page" title="{i18n>title}">
<content>
<FlexBox alignItems="Center" justifyContent="Center" height="100%" width="100%">
<Button text="Show flights list using navTo" press="onPressNavTo"
class="sapUiSmallMargin" />
<Button text="Show flight list using getTargets" press="onPressTargets"
class="sapUiSmallMargin" />
</FlexBox>
</content>
</Page>
</mvc:View>

51
webapp/view/Main.view.xml Normal file
View File

@ -0,0 +1,51 @@
<mvc:View controllerName="mvcapp00124.controller.Main"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<Page id="page" title="{i18n>title}">
<content>
<IconTabBar id="centralTabBar" class="sapUiResponsiveContentPadding" expandable="false">
<items>
<IconTabFilter text="Arrival">
<Table id="arrivalFlights" items="{/Flight}" growing="true">
<columns>
<Column>
<Text text="Flight ID" />
</Column>
<Column>
<Text text="From" />
</Column>
<Column>
<Text text="To" />
</Column>
<Column>
<Text text="Date" />
</Column>
<Column>
<Text text="Time" />
</Column>
<Column>
<Text text="Status" />
</Column>
</columns>
<items>
<ColumnListItem type="Navigation" press="handleLineItemPress">
<cells>
<Text text="{flightId}"/>
<Text text="{from}"/>
<Text text="{to}"/>
<Text text="{date}"/>
<Text text="{time}"/>
<Text text="{status}"/>
</cells>
</ColumnListItem>
</items>
</Table>
</IconTabFilter>
<IconTabFilter text="Departure">
<Text text="Here you will see departing flights soon!"/>
</IconTabFilter>
</items>
</IconTabBar>
</content>
</Page>
</mvc:View>