Fix some missing account names

- egw().accounts() were not cleaned
- accounts not in normal cache did not call requestUpdate() properly
This commit is contained in:
nathan 2022-12-19 12:00:50 -07:00
parent c4feb6c36f
commit 7d94692dfd
2 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@
*/
import {Et2Select} from "./Et2Select";
import {SelectOption} from "./FindSelectOptions";
import {cleanSelectOptions, SelectOption} from "./FindSelectOptions";
import {Et2Image} from "../Et2Image/Et2Image";
import {SelectAccountMixin} from "./SelectAccountMixin";
import {Et2StaticSelectMixin} from "./StaticOptions";
@ -58,14 +58,14 @@ export class Et2SelectAccount extends SelectAccountMixin(Et2StaticSelectMixin(Et
{
if(this.accountType === 'both')
{
fetch.push(this.egw().accounts('accounts').then(options => {this.static_options = this.static_options.concat(options)}));
fetch.push(this.egw().accounts('accounts').then(options => {this.static_options = this.static_options.concat(cleanSelectOptions(options))}));
}
fetch.push(this.egw().accounts('owngroups').then(options => {this.static_options = this.static_options.concat(options)}));
fetch.push(this.egw().accounts('owngroups').then(options => {this.static_options = this.static_options.concat(cleanSelectOptions(options))}));
}
else
{
fetch.push(this.egw().accounts(this.accountType).then(options => {this.static_options = this.static_options.concat(options)}));
fetch.push(this.egw().accounts(this.accountType).then(options => {this.static_options = this.static_options.concat(cleanSelectOptions(options))}));
}
this.fetchComplete = Promise.all(fetch)
.then(() => this._renderOptions());

View File

@ -79,7 +79,7 @@ export const SelectAccountMixin = <T extends Constructor<LitElement>>(superclass
this.egw().link_title('api-accounts', id, true).then(title =>
{
option.label = title;
this.requestUpdate();
this.requestUpdate('select_options');
});
}
}