Compare commits
4 Commits
d034457-UI
...
use-db-con
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a6ddfd9bb | ||
|
|
ae247d493e | ||
|
|
a524e419db | ||
|
|
379ddc9fb0 |
@@ -1,7 +1,7 @@
|
||||
using { Currency, managed, sap, extensible } from '@sap/cds/common';
|
||||
using { Currency, managed, sap } from '@sap/cds/common';
|
||||
namespace sap.capire.bookshop;
|
||||
|
||||
entity Books : managed, extensible {
|
||||
entity Books : managed {
|
||||
key ID : Integer;
|
||||
title : localized String(111);
|
||||
descr : localized String(1111);
|
||||
@@ -13,7 +13,7 @@ entity Books : managed, extensible {
|
||||
image : LargeBinary @Core.MediaType : 'image/png';
|
||||
}
|
||||
|
||||
entity Authors : managed, extensible {
|
||||
entity Authors : managed {
|
||||
key ID : Integer;
|
||||
name : String(111);
|
||||
dateOfBirth : Date;
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
"db": {
|
||||
"kind": "sql"
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"assert_integrity": "db"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ GET {{server}}/browse/$metadata
|
||||
### ------------------------------------------------------------------------
|
||||
# Browse Books as any user
|
||||
GET {{server}}/browse/Books?
|
||||
# &$select=title,stock
|
||||
&$select=title,stock,author
|
||||
# &$expand=currency
|
||||
# &sap-language=de
|
||||
{{me}}
|
||||
@@ -62,6 +62,22 @@ Authorization: Basic alice:
|
||||
"currency": { "code": "USD" }
|
||||
}
|
||||
|
||||
### ------------------------------------------------------------------------
|
||||
# Create book with invalid author ID -> will fail
|
||||
POST {{server}}/admin/Books
|
||||
Content-Type: application/json;IEEE754Compatible=true
|
||||
Authorization: Basic alice:
|
||||
|
||||
{
|
||||
"ID": 34,
|
||||
"title": "Let constraints do the magic",
|
||||
"descr": "Database constraints are helpful little things that prevent messing up your data.",
|
||||
"author": { "ID": 777 },
|
||||
"genre": { "ID": 14 },
|
||||
"stock": 4,
|
||||
"price": "19.99",
|
||||
"currency": { "code": "USD" }
|
||||
}
|
||||
|
||||
### ------------------------------------------------------------------------
|
||||
# Put image to books
|
||||
|
||||
@@ -50,10 +50,6 @@
|
||||
}
|
||||
},
|
||||
"sap.ui5": {
|
||||
"flexEnabled": true,
|
||||
"config": {
|
||||
"experimentalCAPScenario": true
|
||||
},
|
||||
"dependencies": {
|
||||
"minUI5Version": "1.81.0",
|
||||
"libs": {
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
}
|
||||
},
|
||||
"sap.ui5": {
|
||||
"flexEnabled": true,
|
||||
"config": {
|
||||
"experimentalCAPScenario": true
|
||||
},
|
||||
"dependencies": {
|
||||
"libs": {
|
||||
"sap.fe.templates": {}
|
||||
|
||||
@@ -10,21 +10,7 @@
|
||||
<script>
|
||||
window["sap-ushell-config"] = {
|
||||
defaultRenderer: "fiori2",
|
||||
applications: {},
|
||||
bootstrapPlugins: {
|
||||
RuntimeAuthoringPlugin: {
|
||||
component: "sap.ushell.plugins.rta",
|
||||
config: {
|
||||
validateAppVersion: false,
|
||||
},
|
||||
},
|
||||
PersonalizePlugin: {
|
||||
component: "sap.ushell.plugins.rta-personalize",
|
||||
config: {
|
||||
validateAppVersion: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
applications: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -36,13 +22,8 @@
|
||||
data-sap-ui-frameOptions="allow"
|
||||
></script>
|
||||
<script>
|
||||
sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content"));
|
||||
sap.ui
|
||||
.getCore()
|
||||
.getConfiguration()
|
||||
.setFlexibilityServices([{ connector: "SessionStorageConnector" }]);
|
||||
sap.ui.getCore().getConfiguration().setLanguage("en");
|
||||
</script>
|
||||
sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content"))
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="sapUiBody" id="content"></body>
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
},
|
||||
"cds": {
|
||||
"requires": {
|
||||
"extensibility": {
|
||||
"kind": "uiflex"
|
||||
},
|
||||
"auth": {
|
||||
"strategy": "dummy"
|
||||
},
|
||||
|
||||
@@ -4,5 +4,10 @@
|
||||
"dependencies": {
|
||||
"@capire/common": "*",
|
||||
"@sap/cds": "^5"
|
||||
},
|
||||
"cds": {
|
||||
"features": {
|
||||
"assert_integrity": "db"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
3372
package-lock.json
generated
3372
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@
|
||||
"@capire/media": "./media",
|
||||
"@capire/orders": "./orders",
|
||||
"@capire/reviews": "./reviews",
|
||||
"@sap/cds": "^5.5.3"
|
||||
"@sap/cds": "^5.7.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.4",
|
||||
@@ -30,6 +30,7 @@
|
||||
"media": "cds watch media",
|
||||
"mocha": "npx mocha || echo",
|
||||
"jest": "npx jest",
|
||||
"start": "cds watch fiori",
|
||||
"test": "npm run jest -- --silent",
|
||||
"test:hello": "cd hello && npm test"
|
||||
},
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
"[production]": { "kind": "enterprise-messaging" }
|
||||
},
|
||||
"db": { "kind": "sql" }
|
||||
},
|
||||
"features": {
|
||||
"assert_integrity": "db"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user