From 32043f7a4106e05af5bb361a1956eab56a39cd79 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 22 Jul 2020 16:58:21 +0200 Subject: [PATCH] trigger full refresh / applyFilters, if app refresh_add returns false --- api/js/etemplate/et2_extension_nextmatch.js | 9 ++++++--- api/js/etemplate/et2_extension_nextmatch.ts | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index 7295596d2b..2cdd69c95d 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -511,8 +511,9 @@ var et2_nextmatch = /** @class */ (function (_super) { // Handled above, more code to execute after loop break; case "add": - this.refresh_add(uid); - break; + if (this.refresh_add(uid)) + break; + // fall-through / full refresh, if refresh_add returns false case "edit": default: // Trigger refresh @@ -527,6 +528,7 @@ var et2_nextmatch = /** @class */ (function (_super) { * An entry has been added. Put it in the list. * * @param uid + * @return boolean false: not added, true: added */ et2_nextmatch.prototype.refresh_add = function (uid) { var index = 0; @@ -537,7 +539,7 @@ var et2_nextmatch = /** @class */ (function (_super) { } // App cancelled the add if (index === false) { - return; + return false; } // Insert at the top of the list, or where app said var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid); @@ -550,6 +552,7 @@ var et2_nextmatch = /** @class */ (function (_super) { this.egw().dataUnregisterUID(uid, callback, this); }; this.egw().dataRegisterUID(uid, callback, this, this.getInstanceManager().etemplate_exec_id, this.id); + return true; }; et2_nextmatch.prototype._get_appname = function () { var app = ''; diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index d170924827..db7c211603 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -777,8 +777,8 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 // Handled above, more code to execute after loop break; case "add": - this.refresh_add(uid); - break; + if (this.refresh_add(uid)) break; + // fall-through / full refresh, if refresh_add returns false case "edit": default: // Trigger refresh @@ -794,6 +794,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 * An entry has been added. Put it in the list. * * @param uid + * @return boolean false: not added, true: added */ protected refresh_add(uid:string) { @@ -808,7 +809,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 // App cancelled the add if(index === false) { - return; + return false; } // Insert at the top of the list, or where app said @@ -823,6 +824,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 this.egw().dataUnregisterUID(uid, callback, this); }; this.egw().dataRegisterUID(uid, callback, this, this.getInstanceManager().etemplate_exec_id, this.id); + return true; } private _get_appname()