1 Commits

Author SHA1 Message Date
Eric Tuvesson
ec2ea33ffd feat(runtime): Save fetched records ACL in a global object 2024-10-01 16:11:03 +02:00
4 changed files with 12 additions and 21 deletions

View File

@@ -596,6 +596,12 @@ function _fromJSON(item, collectionName, modelScope) {
model.set(key, _deserializeJSON(item[key], _type, modelScope));
}
// Add the ACL roles to a global object
if (item.objectId && item.ACL) {
const aclModel = modelStore.get('--ndl--acl');
aclModel.set(item.objectId, item.ACL);
}
return model;
}

View File

@@ -5,14 +5,9 @@ const navigation = {
async showPopup(componentPath, params) {
return new Promise((resolve) => {
navigation._noodlRuntime.context.showPopup(componentPath, params, {
senderNode: this.nodeScope.componentOwner,
/**
* @param {string | undefined} action
* @param {*} results
*/
onClosePopup: (action, results) => {
resolve({
action: (action || '').replace('closeAction-', ''),
action: action.replace('closeAction-', ''),
parameters: results
});
}

View File

@@ -51,9 +51,8 @@ const ClosePopupNode = {
}
},
close: function () {
if (this._internal.closeCallback) {
if (this._internal.closeCallback)
this._internal.closeCallback(this._internal.closeAction, this._internal.resultValues);
}
},
closeActionTriggered: function (name) {
this._internal.closeAction = name;

View File

@@ -53,24 +53,15 @@ const ShowPopupNode = {
this.context.showPopup(this._internal.target, this._internal.popupParams, {
senderNode: this.nodeScope.componentOwner,
/**
* @param {string | undefined} action
* @param {*} results
*/
onClosePopup: (action, results) => {
this._internal.closeResults = results;
for (const key in results) {
if (this.hasOutput('closeResult-' + key)) {
this.flagOutputDirty('closeResult-' + key);
}
for (var key in results) {
if (this.hasOutput('closeResult-' + key)) this.flagOutputDirty('closeResult-' + key);
}
if (!action) {
this.sendSignalOnOutput('Closed');
} else {
this.sendSignalOnOutput(action);
}
if (!action) this.sendSignalOnOutput('Closed');
else this.sendSignalOnOutput(action);
}
});
},