From b0a678c0ec35492660572646b4546d32c4c103a2 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 20 Jul 2020 13:44:28 -0600 Subject: [PATCH] Timesheet: Fix push owner filter was preventing updating --- timesheet/js/app.js | 7 +++---- timesheet/js/app.ts | 11 +++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/timesheet/js/app.js b/timesheet/js/app.js index 0f3fadde66..5ba7e00788 100644 --- a/timesheet/js/app.js +++ b/timesheet/js/app.js @@ -203,11 +203,10 @@ var TimesheetApp = /** @class */ (function (_super) { // check if we might not see it because of an owner filter var nm = (_a = this.et2) === null || _a === void 0 ? void 0 : _a.getWidgetById('nm'); var nm_value = (_b = nm) === null || _b === void 0 ? void 0 : _b.getValue(); - if (nm && nm_value && typeof ((_c = nm_value.col_filter) === null || _c === void 0 ? void 0 : _c.ts_owner) !== 'undefined') { - if (!nm_value.col_filter.ts_owner || nm_value.col_filter.ts_owner == pushData.acl) { - this.updateList(nm, pushData); - } + if (nm && nm_value && ((_c = nm_value.col_filter) === null || _c === void 0 ? void 0 : _c.ts_owner) && nm_value.col_filter.ts_owner != pushData.acl) { + return; } + this.updateList(nm, pushData); }; return TimesheetApp; }(egw_app_1.EgwApp)); diff --git a/timesheet/js/app.ts b/timesheet/js/app.ts index 5b66c51f57..c601f3b5c4 100644 --- a/timesheet/js/app.ts +++ b/timesheet/js/app.ts @@ -18,6 +18,7 @@ import '../jsapi/egw_global'; import '../etemplate/et2_types'; import {EgwApp} from '../../api/js/jsapi/egw_app'; +import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch"; /** * UI for timesheet @@ -232,15 +233,13 @@ class TimesheetApp extends EgwApp if (typeof this._grants[pushData.acl] === 'undefined') return; // check if we might not see it because of an owner filter - let nm = this.et2?.getWidgetById('nm'); + let nm = this.et2?.getWidgetById('nm'); let nm_value = nm?.getValue(); - if (nm && nm_value && typeof nm_value.col_filter?.ts_owner !== 'undefined') + if (nm && nm_value && nm_value.col_filter?.ts_owner && nm_value.col_filter.ts_owner != pushData.acl) { - if (!nm_value.col_filter.ts_owner || nm_value.col_filter.ts_owner == pushData.acl) - { - this.updateList(nm, pushData); - } + return; } + this.updateList(nm, pushData); } }