From ff50df67d06a51ee41e7b4cb78b02b73541adcdc Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 23 Jan 2020 09:21:41 -0700 Subject: [PATCH] Use correct refresh methods for delete so app can handle it --- api/js/jsapi/egw_app.js | 3 +-- api/js/jsapi/egw_app.ts | 2 +- timesheet/js/app.js | 12 +++++++++++- timesheet/js/app.ts | 16 ++++++++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/api/js/jsapi/egw_app.js b/api/js/jsapi/egw_app.js index e0c1c5dac3..1f6505c3b9 100644 --- a/api/js/jsapi/egw_app.js +++ b/api/js/jsapi/egw_app.js @@ -152,7 +152,7 @@ var EgwApp = /** @class */ (function () { EgwApp.prototype.push = function (_type, _app, _id, _data) { // only handle delete by default, for simple case of uid === "$app::$id" if (_type === 'delete') { - egw.dataDeleteUID(_app + '::' + _id); + egw(window).refresh('', _app, _id, "delete"); } }; /** @@ -1636,4 +1636,3 @@ var EgwApp = /** @class */ (function () { return EgwApp; }()); exports.EgwApp = EgwApp; -//# sourceMappingURL=egw_app.js.map \ No newline at end of file diff --git a/api/js/jsapi/egw_app.ts b/api/js/jsapi/egw_app.ts index 1bac01d2c5..ba806540ac 100644 --- a/api/js/jsapi/egw_app.ts +++ b/api/js/jsapi/egw_app.ts @@ -225,7 +225,7 @@ export abstract class EgwApp // only handle delete by default, for simple case of uid === "$app::$id" if (_type === 'delete') { - egw.dataDeleteUID(_app+'::'+_id); + egw(window).refresh('', _app, _id, "delete"); } } diff --git a/timesheet/js/app.js b/timesheet/js/app.js index 57eac75487..bb98b19ad2 100644 --- a/timesheet/js/app.js +++ b/timesheet/js/app.js @@ -56,6 +56,17 @@ var TimesheetApp = /** @class */ (function (_super) { this.filter2_change(); } }; + TimesheetApp.prototype.observer = function (_msg, _app, _id, _type, _msg_type, _links) { + switch (_app) { + case 'timesheet': + switch (_type) { + case 'delete': + egw.dataStoreUID(_app + '::' + _id, null); + break; + } + break; + } + }; /** * */ @@ -198,4 +209,3 @@ var TimesheetApp = /** @class */ (function (_super) { return TimesheetApp; }(egw_app_1.EgwApp)); app.classes.timesheet = TimesheetApp; -//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/timesheet/js/app.ts b/timesheet/js/app.ts index 3e9c0b50ed..031f52f005 100644 --- a/timesheet/js/app.ts +++ b/timesheet/js/app.ts @@ -48,6 +48,22 @@ class TimesheetApp extends EgwApp } } + observer(_msg, _app, _id, _type, _msg_type, _links) { + + switch(_app) + { + case 'timesheet': + switch(_type) + { + case 'delete': + egw.dataStoreUID(_app + '::' + _id, null); + break; + } + break; + } + + } + /** * */