Skip to content
Merged
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
},
"dependencies": {
"@cap-js/sqlite": "^3",
"@cap2ui5/cds-plugin": "^0.6.0",
"@cap2ui5/cds-plugin": "^0.8.0",
"@sap/cds": "^10",
"@sap/cds-rfc": "^2.2.1"
},
"devDependencies": {
"@abap2ui5/linter": "^0.11.0",
"@abap2ui5/linter": "^0.12.0",
"@cap-js/cds-test": "^1.0.2",
"eslint": "^10",
"fast-xml-parser": "^5.11.1"
Expand Down
15 changes: 8 additions & 7 deletions test/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ export async function post(url, { app, id = "", event = "", args = [], model = {
return { status: r.status, text, json, id: json?.S_FRONT?.ID, app: json?.S_FRONT?.APP };
}

/** Every action of a response, system and custom. */
export const actions = (r) => [
...(r.json?.S_FRONT?.S_ACTION?.T_SYSTEM ?? []),
...(r.json?.S_FRONT?.S_ACTION?.T_CUSTOM ?? []),
];
// What a response says, as protocol 3 carries it (abap2UI5/protocol): the
// screen in S_FRONT.VIEWS - one entry per slot the roundtrip changes,
// { XML, OPT } to display it or { DESTROY: true } to take it down - and what
// to do on it in S_FRONT.ACTIONS.

/** The front-end actions of a response, in order. */
export const actions = (r) => r.json?.S_FRONT?.ACTIONS ?? [];

/** The XML a response displays into a view slot (MAIN, POPUP, NEST, …), or undefined. */
export const slot = (r, name) => actions(r)
.find((a) => a[0] === "VIEW_SLOTS" && a[1] === "display" && a[2] === name)?.[3];
export const slot = (r, name) => r.json?.S_FRONT?.VIEWS?.[name]?.XML;

/** The message box a response opens, as { type, text }, or undefined. */
export const messageBox = (r) => {
Expand Down