Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ test/*/
generators/app/templates/webapp/Component.ts
generators/app/templates/webapp/model/models.ts
generators/app/templates/webapp/view/*.xml
generators/app/templates/webapp/index*.html
1 change: 1 addition & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export default class extends Generator {
// version parameters
this.config.set("gte1_98_0", semver.gte(props.frameworkVersion, "1.98.0"));
this.config.set("gte1_104_0", semver.gte(props.frameworkVersion, "1.104.0"));
this.config.set("gte1_120_0", semver.gte(props.frameworkVersion, "1.120.0"));
this.config.set("lt1_124_0", semver.lt(props.frameworkVersion, "1.124.0"));
});
}
Expand Down
14 changes: 7 additions & 7 deletions generators/app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"test": "npm run lint && npm run karma-ci-cov"
},
"devDependencies": {
"@ui5/cli": "^4.0.6",
"@ui5/middleware-code-coverage": "^2.0.0",
"eslint": "^9.9.1",
"eslint-plugin-jsdoc": "^50.2.2",
"globals": "^15.9.0",
"@ui5/cli": "^4.0.22",
"@ui5/middleware-code-coverage": "^2.0.1",
"eslint": "^9.31.0",
"eslint-plugin-jsdoc": "^51.4.1",
"globals": "^16.3.0",
"karma": "^6.4.4",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-ui5": "^4.0.1",
"karma-ui5": "^4.1.0",
"rimraf": "^6.0.1",
"ui5-middleware-livereload": "^3.0.3"
"ui5-middleware-livereload": "^3.1.2"
}
}
8 changes: 0 additions & 8 deletions generators/app/templates/webapp/controller/BaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/UIComponent", "sap/ui/
"use strict";

return Controller.extend("<%= appId %>.controller.BaseController", {
/**
* Convenience method for accessing the component of the controller's view.
* @returns {sap.ui.core.Component} The component of the controller's view
*/
getOwnerComponent: function () {
return Controller.prototype.getOwnerComponent.call(this);
},

/**
* Convenience method to get the components' router instance.
* @returns {sap.m.routing.Router} The router instance
Expand Down
15 changes: 11 additions & 4 deletions generators/app/templates/webapp/index-cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@

<script
id="sap-ui-bootstrap"
src="https://<%= cdnDomain %>/<%= frameworkVersion %>/resources/sap-ui-core.js"
src="https://<%= cdnDomain %>/<%= frameworkVersion %>/resources/sap-ui-core.js"<% if (gte1_120_0) { %>
data-sap-ui-resource-roots='{
"<%= appId %>": "./"
}'
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
data-sap-ui-compat-version="edge"
data-sap-ui-frame-options="trusted"<% } else { %>
data-sap-ui-theme="<%= defaultTheme %>"
data-sap-ui-resourceroots='{
"<%= appId %>": "./"
}'
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-async="true"
data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-frameOptions="trusted"
data-sap-ui-frameOptions="trusted"<% } %>
data-sap-ui-async="true"
></script>
</head>

Expand Down
15 changes: 11 additions & 4 deletions generators/app/templates/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@

<script
id="sap-ui-bootstrap"
src="resources/sap-ui-core.js"
src="resources/sap-ui-core.js"<% if (gte1_120_0) { %>
data-sap-ui-resource-roots='{
"<%= appId %>": "./"
}'
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
data-sap-ui-compat-version="edge"
data-sap-ui-frame-options="trusted"<% } else { %>
data-sap-ui-theme="<%= defaultTheme %>"
data-sap-ui-resourceroots='{
"<%= appId %>": "./"
}'
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-async="true"
data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-frameOptions="trusted"
data-sap-ui-frameOptions="trusted"<% } %>
data-sap-ui-async="true"
></script>
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
sap.ui.define(["<%= appURI %>/controller/Main.controller"], function (MainController) {
"use strict";

QUnit.module("Sample App controller test");
QUnit.module("Sample Main controller test");

QUnit.test("The AppController class has a sayHello method", function (assert) {
QUnit.test("The MainController class has a sayHello method", function (assert) {
// as a very basic test example just check the presence of the "sayHello" method
assert.strictEqual(typeof MainController.prototype.sayHello, "function");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ QUnit.config.autostart = false;
sap.ui.getCore().attachInit(function () {
"use strict";

sap.ui.require(["unit/controller/App.qunit"], function () {
sap.ui.require(["unit/controller/Main.qunit"], function () {
QUnit.start();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
sap.ui.define(["<%= appURI %>/controller/Main.controller"], function (MainController) {
"use strict";

QUnit.module("Sample App controller test");
QUnit.module("Sample Main controller test");

QUnit.test("The AppController class has a sayHello method", function (assert) {
QUnit.test("The MainController class has a sayHello method", function (assert) {
// as a very basic test example just check the presence of the "sayHello" method
assert.strictEqual(typeof MainController.prototype.sayHello, "function");
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sap.ui.define(["./controller/App.qunit"]);
sap.ui.define(["./controller/Main.qunit"]);