Skip to content

Commit

Permalink
Merge branch 'main' into eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
danjoa authored Jul 15, 2024
2 parents 6f3b0bd + 09f0267 commit bb26b86
Show file tree
Hide file tree
Showing 7 changed files with 3,729 additions and 3,428 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ updates:
- dependency-name: "chai"
# chai 5 doesn't work atm w/ cds.test, TODO fix that in cds.test
versions: ["5.x"]
- dependency-name: "chai-as-promised"
# chai-as-promised 8 doesn't work atm w/ cds.test, TODO fix that in cds.test
versions: ["8.x"]
7 changes: 4 additions & 3 deletions bookshop/srv/admin-service.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
const cds = require('@sap/cds')

module.exports = class AdminService extends cds.ApplicationService { init(){
this.before ('NEW','Authors', genid)
this.before ('NEW','Books', genid)
this.before (['NEW','CREATE'],'Authors', genid)
this.before (['NEW','CREATE'],'Books', genid)
return super.init()
}}

/** Generate primary keys for target entity in request */
async function genid (req) {
if (req.data.ID) return
const {id} = await SELECT.one.from(req.target).columns('max(ID) as id')
req.data.ID = id - id % 100 + 100 + 1
req.data.ID = id + 4 // Note: that is not safe! ok for this sample only.
}
1 change: 1 addition & 0 deletions bookshop/srv/cat-service.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const cds = require('@sap/cds')
module.exports = class CatalogService extends cds.ApplicationService { init() {

const { Books } = cds.entities('sap.capire.bookshop')
Expand Down
27 changes: 14 additions & 13 deletions fiori/app/fiori-apps.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand All @@ -10,21 +10,22 @@
<script>
window["sap-ushell-config"] = {
defaultRenderer: "fiori2",
applications: {}
applications: {},
};
</script>

<script id="sap-ushell-bootstrap" src="https://sapui5.hana.ondemand.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
<script id="sap-ui-bootstrap" src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout"
data-sap-ui-compatVersion="edge"
data-sap-ui-theme="sap_horizon"
data-sap-ui-frameOptions="allow"
></script>
<script id="sap-ushell-bootstrap" src="https://ui5.sap.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout" data-sap-ui-compatVersion="edge"
data-sap-ui-theme="sap_horizon"></script>
<script>
sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content"))
sap.ui.getCore().attachInit(() =>
sap.ushell.Container.createRenderer().placeAt("content")
);
</script>

</head>
<body class="sapUiBody" id="content"></body>

<body class="sapUiBody" id="content">
</body>

</html>
Loading

0 comments on commit bb26b86

Please sign in to comment.