Skip to content

Commit

Permalink
fix(Calendar): attendeeFilter shows name proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusweiss committed Jan 10, 2024
1 parent 38868e4 commit 4ca2b83
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 4ca2b83

Please sign in to comment.