Skip to content

Commit

Permalink
Merge branch 'pu/cw/fixCalAttendeeFilterRow' into '2024.11'
Browse files Browse the repository at this point in the history
fix(Calendar): attendeeFilter shows name proxy

See merge request tine20/tine20!4727
  • Loading branch information
corneliusweiss committed Jan 10, 2024
2 parents 38868e4 + 4ca2b83 commit 0ef438c
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions tine20/Calendar/js/AttendeeFilterModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,26 @@ Tine.Calendar.AttendeeFilterModelValueField = Ext.extend(Ext.ux.form.LayerCombo,
setValue: function(value) {
value = Ext.isArray(value) ? value : [value];
this.attendeeData = value;
this.currentValue = [];

var attendeeStore = Tine.Calendar.Model.Attender.getAttendeeStore(value);

var a = [];
attendeeStore.each(function(attender) {
this.currentValue.push(attender.data);
var name = Tine.Calendar.AttendeeGridPanel.prototype.renderAttenderName.call(Tine.Calendar.AttendeeGridPanel.prototype, attender.get('user_id'), {noIcon: true}, attender);
//var status = Tine.Calendar.AttendeeGridPanel.prototype.renderAttenderStatus.call(Tine.Calendar.AttendeeGridPanel.prototype, attender.get('status'), {}, attender);
a.push(name/* + ' (' + status + ')'*/);
}, this);

this.setRawValue(a.join(', '));
const currentValue = this.currentValue = [];
const attendeeStore = Tine.Calendar.Model.Attender.getAttendeeStore(value);

Promise.all(_.map(attendeeStore.data.items, function(attendee) {
currentValue.push(attendee.data);
return new Promise(resolve => {
const name = Tine.Calendar.AttendeeGridPanel.prototype.renderAttenderName.call(Tine.Calendar.AttendeeGridPanel.prototype, attendee.get('user_id'), {noIcon: true}, attendee);
if (name && name.registerReplacer) {
name.registerReplacer((name) => {
resolve(name);
});
} else {
resolve(name);
}
});
})).then(names => {
const value = names.join(', ');
this.setRawValue(value || this.emptyText);
this.el[(value ? 'remove' : 'add') + 'Class'](this.emptyClass);
});
return this;

},
Expand Down

0 comments on commit 0ef438c

Please sign in to comment.