Skip to content

Commit 231385f

Browse files
authored
Merge pull request #2523 from ORCID/lmendpza/9803-truncate-extremely-long-user-names-in-the-global-header
9803-truncate-extremely-long-user-names-in-the-global-header
2 parents 2440b62 + 8672684 commit 231385f

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/app/layout/header/header.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,7 @@ nav {
191191
}
192192
}
193193
}
194+
195+
app-search {
196+
overflow: hidden;
197+
}

src/app/layout/search/search.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,7 @@
128128
button {
129129
border: none;
130130
}
131+
132+
app-user-menu {
133+
overflow: hidden;
134+
}

src/app/layout/user-menu/user-menu.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
id="cy-user-info"
1212
>
1313
<img src="./assets/vectors/profile-icon.svg" alt="" />
14-
<ng-container *ngIf="platform.columns12" class="name-container">{{
14+
<span *ngIf="platform.columns12" class="name-text-container">{{
1515
displayName
16-
}}</ng-container>
16+
}}</span>
1717

1818
<mat-icon *ngIf="platform.columns12">expand_more</mat-icon>
1919
</button>

src/app/layout/user-menu/user-menu.component.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
:host {
3838
.user-menu-button {
39+
max-width: 100%;
3940
padding: 0 32px;
4041
.columns-4 & {
4142
padding: 0;
@@ -65,3 +66,10 @@
6566
margin-right: 12px;
6667
}
6768
}
69+
70+
span.name-text-container {
71+
overflow: hidden;
72+
width: calc(100% - 59px);
73+
display: inline-block;
74+
text-overflow: ellipsis;
75+
}

0 commit comments

Comments
 (0)