From 3001346829b5d1d3cc7b09483d04adaec18f0553 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 14 Nov 2024 11:25:33 -0700 Subject: [PATCH] Calendar: Use ajax_owner() to find missing names instead of ajax_search(), much faster & gives the results we actually want --- calendar/js/CalendarOwner.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/calendar/js/CalendarOwner.ts b/calendar/js/CalendarOwner.ts index 3f22581293..9d68facd31 100644 --- a/calendar/js/CalendarOwner.ts +++ b/calendar/js/CalendarOwner.ts @@ -57,6 +57,25 @@ export class CalendarOwner extends Et2StaticSelectMixin(Et2Select) this.searchOptions['checkgrants'] = true; } + /** + * Some [part of a] value is missing from the available options, but should be there, so find and add it. + * + * This is used when not all options are sent to the client (search, link list). Ideally we want to send + * the options for the current value, but sometimes this is not the best option so here we search or create + * the option as needed. These are not free entries, but need to match some list somewhere. + * + * @param {string} newValueElement + * @protected + */ + protected _missingOption(newValueElement : string) + { + // Call ajax_owner + return this.egw().request(this.egw().link(this.egw().ajaxUrl(this.egw().decodePath("calendar_owner_etemplate_widget::ajax_owner"))), + [newValueElement]).then((results) => + { + return this._processResultCount(results); + }); + } /** * Override parent to show email address in options *