web/user: fix search not updating app (cherry-pick #7825) (#7933)

web/user: fix search not updating app (#7825)

web/user: fix app not updating

so when using two classes in a classMap directive, the update fails (basically saying that each class must be separated), however this error only shows when directly calling requestUpdate and is swallowed somewhere when relying on the default render cycle

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens L <jens@goauthentik.io>
This commit is contained in:
gcp-cherry-pick-bot[bot] 2023-12-19 18:30:23 +01:00 committed by GitHub
parent 3c1163fabd
commit 70100fc105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -96,7 +96,7 @@ export class LibraryApplication extends AKElement {
this.application.metaPublisher !== "" || this.application.metaPublisher !== "" ||
this.application.metaDescription !== ""; this.application.metaDescription !== "";
const classes = { "pf-m-selectable pf-m-selected": this.selected }; const classes = { "pf-m-selectable": this.selected, "pf-m-selected": this.selected };
const styles = this.background ? { background: this.background } : {}; const styles = this.background ? { background: this.background } : {};
return html` <div return html` <div

View File

@ -38,7 +38,9 @@ export class LibraryPageApplicationList extends AKElement {
]; ];
@property({ attribute: false }) @property({ attribute: false })
apps: Application[] = []; set apps(value: Application[]) {
this.fuse.setCollection(value);
}
@property() @property()
query = getURLParam<string | undefined>("search", undefined); query = getURLParam<string | undefined>("search", undefined);
@ -63,7 +65,7 @@ export class LibraryPageApplicationList extends AKElement {
shouldSort: true, shouldSort: true,
ignoreFieldNorm: true, ignoreFieldNorm: true,
useExtendedSearch: true, useExtendedSearch: true,
threshold: 0.5, threshold: 0.3,
}); });
} }
@ -77,7 +79,6 @@ export class LibraryPageApplicationList extends AKElement {
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
this.fuse.setCollection(this.apps);
if (!this.query) { if (!this.query) {
return; return;
} }