Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: truncate observable token size #1482

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/app/users/user-settings/_user-settings-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
background-color: mat.get-color-from-palette($header-1, "lighter");
}
}

td {
.copy-button {
color: mat.get-color-from-palette($primary, "default");
}
}
}

@mixin theme($theme) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/users/user-settings/user-settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<tr *ngIf="tokenValue" data-cy="user-token">
<th>SciCat Token</th>
<td>
{{ tokenValue }}
<span class="token-truncate">{{ tokenValue }}</span>
<span class="copy-button" (click)="onCopy(tokenValue)">
<mat-icon matTooltip="Copy token to clipboard"
>post_add</mat-icon
Expand Down
12 changes: 10 additions & 2 deletions src/app/users/user-settings/user-settings.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ mat-card {
margin: 1em 0em;
}

.token-truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
max-width: 20ch;
}

table {
th {
min-width: 10em;
Expand All @@ -22,9 +30,9 @@ mat-card {
}

td {
width: 100%;
padding: 0.5em;
display: inline-block;
display: flex;
align-items: center;
word-break: break-all;

.copy-button {
Expand Down
Loading