You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/11/30 21:23:34 UTC

[streampipes] branch dev updated: [hotfix] Shorten longer username in profile menu to prevent overflow

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new dce159811 [hotfix] Shorten longer username in profile menu to prevent overflow
dce159811 is described below

commit dce159811021d8892d8b39e28ac5ad3ece537a64
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Wed Nov 30 22:23:25 2022 +0100

    [hotfix] Shorten longer username in profile menu to prevent overflow
---
 ui/src/app/core/components/toolbar/toolbar.component.html | 2 +-
 ui/src/app/core/components/toolbar/toolbar.component.scss | 4 ++++
 ui/src/app/core/components/toolbar/toolbar.component.ts   | 3 ++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ui/src/app/core/components/toolbar/toolbar.component.html b/ui/src/app/core/components/toolbar/toolbar.component.html
index 2767609f5..850f40cd7 100644
--- a/ui/src/app/core/components/toolbar/toolbar.component.html
+++ b/ui/src/app/core/components/toolbar/toolbar.component.html
@@ -60,7 +60,7 @@
             </div>
             <mat-menu #menu="matMenu" id="account">
                 <div class="current-user">
-                    {{userEmail}}
+                    <span class="user-email">{{userEmail}}</span>
                 </div>
                 <mat-divider></mat-divider>
                 <button mat-menu-item (click)="openProfile()" style="min-width:0px;">
diff --git a/ui/src/app/core/components/toolbar/toolbar.component.scss b/ui/src/app/core/components/toolbar/toolbar.component.scss
index 679963c90..08091c430 100644
--- a/ui/src/app/core/components/toolbar/toolbar.component.scss
+++ b/ui/src/app/core/components/toolbar/toolbar.component.scss
@@ -62,3 +62,7 @@
   padding: 5px;
   border-radius: 2px;
 }
+
+.user-email {
+  font-size: 11pt;
+}
diff --git a/ui/src/app/core/components/toolbar/toolbar.component.ts b/ui/src/app/core/components/toolbar/toolbar.component.ts
index c8722b60b..4bb727dee 100644
--- a/ui/src/app/core/components/toolbar/toolbar.component.ts
+++ b/ui/src/app/core/components/toolbar/toolbar.component.ts
@@ -69,7 +69,8 @@ export class ToolbarComponent extends BaseNavigationComponent implements OnInit,
       this.unreadNotificationCount = count;
     });
     this.authService.user$.subscribe(user => {
-      this.userEmail = user.displayName;
+      const displayName = user.displayName;
+      this.userEmail = (displayName.length > 33) ? displayName.slice(0, 32) + '...' : displayName;
       this.profileService.getUserProfile(user.username).subscribe(userInfo => {
         this.darkMode = this.authService.darkMode$.getValue();
         this.modifyAppearance(userInfo.darkMode);