From 629cf7c404d4fa691517dcbe7c58058fb954fdee Mon Sep 17 00:00:00 2001 From: Emma Segal-Grossman Date: Mon, 17 Feb 2025 17:42:36 -0500 Subject: [PATCH] Add a small sticky banner when logged in as superadmin (#2393) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While ideally we don't need to use superadmin for many things, there are still a lot of places where it's necessary, especially around customer service. This makes it a little more visible when that's the case, just as a reminder. I could see this coming in handy especially for newer people who might not have the experience to know to look for the "admin" and "running crawls" buttons. Screenshot 2025-02-13 at 1 12 58 PM --- frontend/src/index.ts | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/frontend/src/index.ts b/frontend/src/index.ts index 83513acb..95968cea 100644 --- a/frontend/src/index.ts +++ b/frontend/src/index.ts @@ -331,7 +331,8 @@ export class App extends BtrixElement { return html`
- ${this.renderNavBar()} ${this.renderAlertBanner()} + ${this.renderSuperadminBanner()} ${this.renderNavBar()} + ${this.renderAlertBanner()}
${this.renderPage()}
@@ -373,6 +374,28 @@ export class App extends BtrixElement { `; } + private renderSuperadminBanner() { + if (this.userInfo?.isSuperAdmin) { + return html`
+
+ + + ${msg("You are logged in as a superadmin")} – + ${msg("please be careful.")} + +
+
`; + } + } + private renderAlertBanner() { if (this.userInfo?.orgs && !this.userInfo.orgs.length) { return this.renderNoOrgsBanner();