${t`My applications`}

- { - const query = (ev.target as HTMLInputElement).value; - if (!this.fuse) return; - const apps = this.fuse.search(query); - if (apps.length < 1) return; - this.selectedApp = apps[0].item; - }} - @keydown=${(ev: KeyboardEvent) => { - if (ev.key === "Enter" && this.selectedApp?.launchUrl) { - window.location.assign(this.selectedApp.launchUrl); - } else if (ev.key === "Escape") { - (ev.target as HTMLInputElement).value = ""; - this.selectedApp = undefined; + ${until( + uiConfig().then((config) => { + if (!config.enabledFeatures.search) { + return html``; } - }} - type="text" - autofocus - placeholder=${t`Search...`} - /> + return html` { + const query = (ev.target as HTMLInputElement).value; + if (!this.fuse) return; + const apps = this.fuse.search(query); + if (apps.length < 1) return; + this.selectedApp = apps[0].item; + }} + @keydown=${(ev: KeyboardEvent) => { + if (ev.key === "Enter" && this.selectedApp?.launchUrl) { + window.location.assign(this.selectedApp.launchUrl); + } else if (ev.key === "Escape") { + (ev.target as HTMLInputElement).value = ""; + this.selectedApp = undefined; + } + }} + type="text" + autofocus + placeholder=${t`Search...`} + />`; + }), + )}
${loading( diff --git a/web/src/user/config.ts b/web/src/user/config.ts index 5108a3ca3..1139deb14 100644 --- a/web/src/user/config.ts +++ b/web/src/user/config.ts @@ -8,6 +8,8 @@ export interface UIConfig { settings: boolean; // Application edit in library (only shown when user is superuser) applicationEdit: boolean; + // Search bar + search: boolean; }; navbar: { userDisplay: "username" | "name" | "email"; @@ -20,6 +22,7 @@ export const DefaultUIConfig: UIConfig = { notificationDrawer: true, settings: true, applicationEdit: true, + search: true, }, navbar: { userDisplay: "name",