Skip to content

Commit 6938263

Browse files
authored
Fix several styling issues (#495)
* fix minor styles and fonts * Removed unused property
1 parent 21ff11d commit 6938263

22 files changed

Lines changed: 272 additions & 383 deletions

web/package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@angular/platform-browser": "^21.0.6",
1919
"@angular/platform-browser-dynamic": "^21.0.6",
2020
"@angular/router": "^21.0.6",
21+
"@fontsource/google-sans-code": "^5.2.3",
2122
"@fontsource/roboto": "^5.2.9",
2223
"angular-split": "^20.0.0",
2324
"highlight.js": "^11.11.1",

web/src/app/annotator/common-field-annotator.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
-->
1616

1717
<div class="container">
18-
<p class="label">
19-
<mat-icon class="icon">{{ icon }}</mat-icon
20-
>{{ label }}
21-
</p>
18+
<div class="label">
19+
<mat-icon class="icon">{{ icon }}</mat-icon>
20+
<p class="label-text">{{ label }}</p>
21+
</div>
2222
@if (value | async; as valueResolved) {
2323
<p class="value" (click)="onValueClick(valueResolved)">
2424
<span class="copy-icon-container"

web/src/app/annotator/common-field-annotator.component.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@use "@angular/material" as mat;
1818

1919
$ICON_SIZE: 18px;
20-
$FONT_SIZE: 12px;
20+
$FONT_SIZE: 10px;
2121
$LABEL_WIDTH: 100px;
2222
$LABEL_BACKGROUND: mat.m2-get-color-from-palette(mat.$m2-indigo-palette, 600);
2323
$BACKGROUND: mat.m2-get-color-from-palette(mat.$m2-indigo-palette, 100);
@@ -31,7 +31,7 @@ $COPY_BUTTON_SIZE: 15px;
3131
column-gap: 3px;
3232
background-color: $BACKGROUND;
3333
color: $LABEL_COLOR;
34-
line-height: 1.7;
34+
align-items: center;
3535

3636
.icon {
3737
width: $FONT_SIZE;
@@ -43,12 +43,13 @@ $COPY_BUTTON_SIZE: 15px;
4343
user-select: none;
4444
font-weight: 600;
4545
font-size: $FONT_SIZE;
46-
margin: 0.5px 0 0.5px 0;
4746
width: $LABEL_WIDTH;
4847
background-color: $LABEL_BACKGROUND;
49-
50-
.icon {
51-
margin: 3px 3px -3px 1px;
48+
display: flex;
49+
align-items: center;
50+
.label-text {
51+
flex: 1;
52+
text-align: center;
5253
}
5354
}
5455

@@ -76,7 +77,6 @@ $COPY_BUTTON_SIZE: 15px;
7677
font-size: $FONT_SIZE;
7778
flex: 1;
7879
margin: 0;
79-
line-height: 1.7;
8080
white-space: nowrap;
8181
text-overflow: ellipsis;
8282
overflow: hidden;

web/src/app/annotator/common-toolbar-button.component.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@
1616

1717
@use "@angular/material" as mat;
1818

19-
$BUTTON_SIZE: 25px;
19+
$BUTTON_SIZE: 20px;
2020
$ICON_SIZE_DIFF: 8px;
2121
$BUTTON_COLOR: mat.m2-get-color-from-palette(mat.$m2-indigo-palette, 600);
2222
$BUTTON_HOVER_COLOR: mat.m2-get-color-from-palette(mat.$m2-indigo-palette, 500);
2323
$ICON_COLOR: mat.m2-get-color-from-palette(mat.$m2-indigo-palette, 100);
2424

2525
.button {
26-
height: 25px;
26+
height: $BUTTON_SIZE;
2727
appearance: none;
2828
border: none;
2929
width: $BUTTON_SIZE;
30-
height: $BUTTON_SIZE;
3130
display: flex;
3231
justify-content: center;
3332
align-items: center;

web/src/app/annotator/log/default.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ export function getDefaultLogAnnotatorResolver(): LogAnnotatorResolver {
4141
(l) => l['insertId'],
4242
),
4343
),
44-
new Annotator(
45-
CommonFieldAnnotatorComponent,
46-
CommonFieldAnnotatorComponent.inputMapperForSummary(
47-
'summarize',
48-
'Summary',
49-
),
50-
),
5144
new Annotator(
5245
ResourceReferenceListAnnotatorComponent,
5346
ResourceReferenceListAnnotatorComponent.inputMapper,

web/src/app/annotator/log/resource-reference-list.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ $VALUE_COLOR: black;
3131
color: $LABEL_COLOR;
3232
white-space: nowrap;
3333
text-overflow: ellipsis;
34+
display: flex;
35+
align-items: center;
3436

3537
mat-icon {
3638
margin-right: 3px;

web/src/app/annotator/log/type-severity-annotator.component.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@
1515
-->
1616

1717
<div class="container">
18-
<p class="log-type">
19-
<span class="label"> <mat-icon>article_shortcut</mat-icon> Type</span>
20-
<span class="value" [ngClass]="logType">{{ logType }}</span>
21-
</p>
22-
<p class="log-severity">
23-
<span class="label"> <mat-icon>warning</mat-icon> Severity</span>
24-
<span class="value" [ngClass]="severity | lowercase">{{ severity }}</span>
18+
<p
19+
class="log-type"
20+
[ngClass]="logType"
21+
matTooltip="Type of the log. Usually it represents its source."
22+
>
23+
Type: <span class="value">{{ logType }}</span>
2524
</p>
25+
@if (severity === "UNKNOWN") {
26+
<p class="log-severity-empty"></p>
27+
} @else {
28+
<p class="log-severity" [ngClass]="severity | lowercase">
29+
Severity: <span class="value">{{ severity }}</span>
30+
</p>
31+
}
2632
</div>

web/src/app/annotator/log/type-severity-annotator.component.scss

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,12 @@ $FONT_SIZE: 12px;
2222
$LABEL_BACKGROUND: mat.m2-get-color-from-palette(mat.$m2-indigo-palette, 600);
2323
$BACKGROUND: mat.m2-get-color-from-palette(mat.$m2-indigo-palette, 100);
2424
$LABEL_COLOR: white;
25-
$LABEL_WIDTH: 100px;
26-
27-
mat-icon {
28-
width: $FONT_SIZE;
29-
height: $FONT_SIZE;
30-
font-size: $FONT_SIZE;
31-
margin: 3px 3px -3px 1px;
32-
}
3325

3426
.container {
3527
color: $LABEL_COLOR;
3628
background-color: $BACKGROUND;
3729
display: flex;
38-
flex-wrap: wrap;
39-
column-gap: 10px;
40-
41-
.label {
42-
display: inline-block;
43-
width: $LABEL_WIDTH;
44-
white-space: nowrap;
45-
font-weight: bold;
46-
margin-right: 10px;
47-
font-size: $FONT_SIZE;
48-
background-color: $LABEL_BACKGROUND;
49-
}
30+
user-select: none;
5031

5132
.value {
5233
text-align: center;
@@ -57,32 +38,31 @@ mat-icon {
5738
white-space: nowrap;
5839
overflow: hidden;
5940
text-overflow: ellipsis;
60-
min-width: 200px;
6141
}
6242
}
6343

6444
.log-type {
6545
flex: 1;
46+
@include gen.log-type-shape-colors-for-all;
6647

67-
.value {
68-
@include gen.log-type-shape-colors-for-all;
69-
70-
color: white;
71-
padding: 0px 8px;
72-
border-radius: 8px;
73-
font-size: $FONT_SIZE;
74-
}
48+
color: white;
49+
padding: 0px 8px;
50+
font-size: $FONT_SIZE;
7551
}
7652

7753
.log-severity {
7854
flex: 1;
55+
@include gen.log-severity-colors-for-all;
7956

80-
.value {
81-
@include gen.log-severity-colors-for-all;
57+
color: white;
58+
padding: 0px 8px;
59+
font-size: $FONT_SIZE;
60+
}
8261

83-
color: white;
84-
padding: 0px 8px;
85-
border-radius: 8px;
86-
font-size: $FONT_SIZE;
87-
}
62+
.log-severity-empty {
63+
flex: 1;
64+
}
65+
66+
.value {
67+
font-weight: 600;
8868
}

web/src/app/annotator/log/type-severity-annotator.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ import { MatIconModule } from '@angular/material/icon';
2020
import { AnnotationDecider } from '../annotator';
2121
import { LogTypeMetadata } from 'src/app/zzz-generated';
2222
import { LogEntry } from 'src/app/store/log';
23+
import { MatTooltipModule } from '@angular/material/tooltip';
2324

2425
@Component({
2526
standalone: true,
2627
templateUrl: './type-severity-annotator.component.html',
2728
styleUrls: ['./type-severity-annotator.component.scss'],
28-
imports: [CommonModule, MatIconModule],
29+
imports: [CommonModule, MatIconModule, MatTooltipModule],
2930
})
3031
export class TypeSeverityAnnotatorComponent {
3132
@Input()

0 commit comments

Comments
 (0)