chore: reformatted with Prettier
This commit is contained in:
+2
-4
@@ -1,5 +1,3 @@
|
|||||||
import fioriTools from '@sap-ux/eslint-plugin-fiori-tools';
|
import fioriTools from "@sap-ux/eslint-plugin-fiori-tools";
|
||||||
|
|
||||||
export default [
|
export default [...fioriTools.configs.recommended];
|
||||||
...fioriTools.configs.recommended
|
|
||||||
];
|
|
||||||
|
|||||||
+5
-16
@@ -10,22 +10,11 @@
|
|||||||
"rootDir": "./webapp",
|
"rootDir": "./webapp",
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"paths": {
|
"paths": {
|
||||||
"de/paulvincenthorn/weekorganizer/weekorganizerapp/*": [
|
"de/paulvincenthorn/weekorganizer/weekorganizerapp/*": ["./webapp/*"],
|
||||||
"./webapp/*"
|
"unit/*": ["./webapp/test/unit/*"],
|
||||||
],
|
"integration/*": ["./webapp/test/integration/*"]
|
||||||
"unit/*": [
|
|
||||||
"./webapp/test/unit/*"
|
|
||||||
],
|
|
||||||
"integration/*": [
|
|
||||||
"./webapp/test/integration/*"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"typeRoots": [
|
"typeRoots": ["./node_modules/@types", "./node_modules/@sapui5/types"]
|
||||||
"./node_modules/@types",
|
|
||||||
"./node_modules/@sapui5/types"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["./webapp/**/*"]
|
||||||
"./webapp/**/*"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-16
@@ -5,22 +5,19 @@ import { createDeviceModel } from "./model/models";
|
|||||||
* @namespace de.paulvincenthorn.weekorganizer.weekorganizerapp
|
* @namespace de.paulvincenthorn.weekorganizer.weekorganizerapp
|
||||||
*/
|
*/
|
||||||
export default class Component extends BaseComponent {
|
export default class Component extends BaseComponent {
|
||||||
|
public static metadata = {
|
||||||
|
manifest: "json",
|
||||||
|
interfaces: ["sap.ui.core.IAsyncContentCreation"],
|
||||||
|
};
|
||||||
|
|
||||||
public static metadata = {
|
public init(): void {
|
||||||
manifest: "json",
|
// call the base component's init function
|
||||||
interfaces: [
|
super.init();
|
||||||
"sap.ui.core.IAsyncContentCreation"
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
public init() : void {
|
// set the device model
|
||||||
// call the base component's init function
|
this.setModel(createDeviceModel(), "device");
|
||||||
super.init();
|
|
||||||
|
|
||||||
// set the device model
|
// enable routing
|
||||||
this.setModel(createDeviceModel(), "device");
|
this.getRouter().initialize();
|
||||||
|
}
|
||||||
// enable routing
|
}
|
||||||
this.getRouter().initialize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,8 +4,5 @@ import Controller from "sap/ui/core/mvc/Controller";
|
|||||||
* @namespace de.paulvincenthorn.weekorganizer.weekorganizerapp.controller
|
* @namespace de.paulvincenthorn.weekorganizer.weekorganizerapp.controller
|
||||||
*/
|
*/
|
||||||
export default class App extends Controller {
|
export default class App extends Controller {
|
||||||
|
public onInit(): void {}
|
||||||
public onInit(): void {
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,8 +4,5 @@ import Controller from "sap/ui/core/mvc/Controller";
|
|||||||
* @namespace de.paulvincenthorn.weekorganizer.weekorganizerapp.controller
|
* @namespace de.paulvincenthorn.weekorganizer.weekorganizerapp.controller
|
||||||
*/
|
*/
|
||||||
export default class Main extends Controller {
|
export default class Main extends Controller {
|
||||||
|
public onInit(): void {}
|
||||||
public onInit(): void {
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+29
-25
@@ -1,35 +1,39 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<title>Week Organizer</title>
|
<title>Week Organizer</title>
|
||||||
<style>
|
<style>
|
||||||
html, body, body > div, #container, #container-uiarea {
|
html,
|
||||||
height: 100%;
|
body,
|
||||||
}
|
body > div,
|
||||||
|
#container,
|
||||||
|
#container-uiarea {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script
|
<script
|
||||||
id="sap-ui-bootstrap"
|
id="sap-ui-bootstrap"
|
||||||
src="resources/sap-ui-core.js"
|
src="resources/sap-ui-core.js"
|
||||||
data-sap-ui-theme="sap_horizon"
|
data-sap-ui-theme="sap_horizon"
|
||||||
data-sap-ui-resource-roots='{
|
data-sap-ui-resource-roots='{
|
||||||
"de.paulvincenthorn.weekorganizer.weekorganizerapp": "./"
|
"de.paulvincenthorn.weekorganizer.weekorganizerapp": "./"
|
||||||
}'
|
}'
|
||||||
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
|
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
|
||||||
data-sap-ui-compat-version="edge"
|
data-sap-ui-compat-version="edge"
|
||||||
data-sap-ui-async="true"
|
data-sap-ui-async="true"
|
||||||
data-sap-ui-frame-options="trusted"
|
data-sap-ui-frame-options="trusted"
|
||||||
></script>
|
></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="sapUiBody sapUiSizeCompact" id="content">
|
<body class="sapUiBody sapUiSizeCompact" id="content">
|
||||||
<div
|
<div
|
||||||
data-sap-ui-component
|
data-sap-ui-component
|
||||||
data-name="de.paulvincenthorn.weekorganizer.weekorganizerapp"
|
data-name="de.paulvincenthorn.weekorganizer.weekorganizerapp"
|
||||||
data-id="container"
|
data-id="container"
|
||||||
data-settings='{"id" : "de.paulvincenthorn.weekorganizer.weekorganizerapp"}'
|
data-settings='{"id" : "de.paulvincenthorn.weekorganizer.weekorganizerapp"}'
|
||||||
data-handle-validation="true"
|
data-handle-validation="true"
|
||||||
></div>
|
></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -76,9 +76,7 @@
|
|||||||
{
|
{
|
||||||
"name": "RouteMain",
|
"name": "RouteMain",
|
||||||
"pattern": ":?query:",
|
"pattern": ":?query:",
|
||||||
"target": [
|
"target": ["TargetMain"]
|
||||||
"TargetMain"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"targets": {
|
"targets": {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import JSONModel from "sap/ui/model/json/JSONModel";
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
||||||
import Device from "sap/ui/Device";
|
import Device from "sap/ui/Device";
|
||||||
|
|
||||||
export function createDeviceModel () {
|
export function createDeviceModel() {
|
||||||
const model = new JSONModel(Device);
|
const model = new JSONModel(Device);
|
||||||
model.setDefaultBindingMode("OneWay");
|
model.setDefaultBindingMode("OneWay");
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,25 +10,24 @@ QUnit.module("Navigation Journey");
|
|||||||
const onTheAppPage = new AppPage();
|
const onTheAppPage = new AppPage();
|
||||||
const onTheViewPage = new ViewPage();
|
const onTheViewPage = new ViewPage();
|
||||||
Opa5.extendConfig({
|
Opa5.extendConfig({
|
||||||
viewNamespace: "de.paulvincenthorn.weekorganizer.weekorganizerapp.view.",
|
viewNamespace: "de.paulvincenthorn.weekorganizer.weekorganizerapp.view.",
|
||||||
autoWait: true
|
autoWait: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
opaTest("Should see the initial page of the app", function () {
|
opaTest("Should see the initial page of the app", function () {
|
||||||
// Arrangements
|
// Arrangements
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
onTheAppPage.iStartMyUIComponent({
|
onTheAppPage.iStartMyUIComponent({
|
||||||
componentConfig: {
|
componentConfig: {
|
||||||
name: "de.paulvincenthorn.weekorganizer.weekorganizerapp"
|
name: "de.paulvincenthorn.weekorganizer.weekorganizerapp",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Assertions
|
// Assertions
|
||||||
onTheAppPage.iShouldSeeTheApp();
|
onTheAppPage.iShouldSeeTheApp();
|
||||||
onTheViewPage.iShouldSeeThePageView();
|
onTheViewPage.iShouldSeeThePageView();
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
// Cleanup
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
onTheAppPage.iTeardownMyApp();
|
||||||
onTheAppPage.iTeardownMyApp();
|
});
|
||||||
});
|
|
||||||
|
|||||||
@@ -3,20 +3,17 @@ import Opa5 from "sap/ui/test/Opa5";
|
|||||||
const sViewName = "App";
|
const sViewName = "App";
|
||||||
|
|
||||||
export default class AppPage extends Opa5 {
|
export default class AppPage extends Opa5 {
|
||||||
// Actions
|
// Actions
|
||||||
|
|
||||||
|
|
||||||
// Assertions
|
|
||||||
iShouldSeeTheApp() {
|
|
||||||
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"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Assertions
|
||||||
|
iShouldSeeTheApp() {
|
||||||
|
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",
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,21 +3,17 @@ import Opa5 from "sap/ui/test/Opa5";
|
|||||||
const sViewName = "Main";
|
const sViewName = "Main";
|
||||||
|
|
||||||
export default class MainPage extends Opa5 {
|
export default class MainPage extends Opa5 {
|
||||||
// Actions
|
// Actions
|
||||||
|
|
||||||
|
|
||||||
// Assertions
|
|
||||||
iShouldSeeThePageView() {
|
|
||||||
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"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Assertions
|
||||||
|
iShouldSeeThePageView() {
|
||||||
|
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",
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Controller from "de/paulvincenthorn/weekorganizer/weekorganizerapp/contro
|
|||||||
QUnit.module("Main Controller");
|
QUnit.module("Main Controller");
|
||||||
|
|
||||||
QUnit.test("I should test the Main controller", function (assert: Assert) {
|
QUnit.test("I should test the Main controller", function (assert: Assert) {
|
||||||
const oAppController = new Controller("Main");
|
const oAppController = new Controller("Main");
|
||||||
oAppController.onInit();
|
oAppController.onInit();
|
||||||
assert.ok(oAppController);
|
assert.ok(oAppController);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
xmlns:mvc="sap.ui.core.mvc"
|
xmlns:mvc="sap.ui.core.mvc"
|
||||||
xmlns="sap.m">
|
xmlns="sap.m">
|
||||||
<Page id="page" title="{i18n>title}">
|
<Page id="page" title="{i18n>title}">
|
||||||
|
|
||||||
</Page>
|
</Page>
|
||||||
</mvc:View>
|
</mvc:View>
|
||||||
Reference in New Issue
Block a user