Skip to content

Commit 96dd30e

Browse files
authored
Merge branch 'main' into minor-changes-to-components
2 parents ab74fe6 + f271859 commit 96dd30e

23 files changed

+378
-54
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"@types/jest": "^27.4.1",
9595
"@types/lodash-es": "^4.17.6",
9696
"@types/mixpanel-browser": "^2.38.0",
97-
"@types/node": "^17.0.21",
97+
"@types/node": "^17.0.23",
9898
"@types/uuid": "^8.3.4",
9999
"@types/webpack-env": "^1.16.3",
100100
"codelyzer": "^6.0.2",

projects/assets-library/assets/styles/_interaction.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,18 @@
9999
cursor: not-allowed;
100100
}
101101
}
102+
103+
@mixin nav-primary-background {
104+
background: $blue-6;
105+
opacity: 0.95;
106+
}
107+
108+
@mixin nav-primary-background-hover {
109+
background: $blue-8;
110+
opacity: 0.95;
111+
}
112+
113+
@mixin nav-secondary-background {
114+
background: $blue-9;
115+
opacity: 0.95;
116+
}
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import { Pipe, PipeTransform } from '@angular/core';
2+
import { TimeDuration, TimeUnit, UnitStringType } from './../../../public-api';
23
import { durationFormatter } from './duration-formatter';
34

45
@Pipe({
56
name: 'htDisplayDuration'
67
})
78
export class DisplayDurationPipe implements PipeTransform {
8-
public transform(millis?: number): string {
9-
return durationFormatter(millis);
9+
public transform(millis?: number, unitStringType: UnitStringType = UnitStringType.Short): string {
10+
if (millis === undefined) {
11+
return '-';
12+
}
13+
14+
if (unitStringType === UnitStringType.Short) {
15+
return durationFormatter(millis);
16+
}
17+
18+
return new TimeDuration(millis, TimeUnit.Millisecond).toMultiUnitString(TimeUnit.Second, true, UnitStringType.Long);
1019
}
1120
}

projects/common/src/utilities/formatters/string/highlight.pipe.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Pipe, PipeTransform } from '@angular/core';
22
import { isArray } from 'lodash-es';
33
import { assertUnreachable } from '../../lang/lang-utils';
44

5+
// TODO: Currently htHighlight does not escape reserved regex characters
56
@Pipe({ name: 'htHighlight' })
67
export class HighlightPipe implements PipeTransform {
78
public transform(fullText: string, highlightSnippets: TextHighlightConfig | TextHighlightConfig[]): string {

projects/components/src/navigation/nav-item/nav-item.component.scss

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010
justify-content: flex-start;
1111
align-items: center;
1212

13-
border-radius: 4px;
13+
border-bottom-left-radius: 4px;
14+
border-top-left-radius: 4px;
1415
padding-left: 16px;
1516
padding-right: 16px;
1617

18+
&.collapsed {
19+
border-radius: 0;
20+
}
21+
1722
.label-container {
1823
flex-grow: 1;
1924
margin-left: 14px;
@@ -27,40 +32,37 @@
2732
}
2833

2934
.icon {
30-
color: $gray-4;
35+
color: $gray-1;
3136
}
3237

3338
.label {
3439
flex: 1;
35-
@include body-1-medium($gray-6);
40+
@include body-1-medium($gray-2);
3641
}
3742

3843
&.active {
39-
background-color: $gray-2;
44+
@include nav-primary-background;
4045

41-
.label {
42-
color: $gray-9;
46+
&:hover {
47+
background-color: $blue-5;
4348
}
4449

45-
.icon {
46-
color: $gray-6;
50+
.label {
51+
color: white;
4752
}
4853

49-
&:hover {
50-
background-color: $gray-1;
54+
.icon {
55+
color: white;
5156
}
5257
}
5358

5459
&:hover {
55-
background-color: $gray-1;
60+
@include nav-primary-background;
5661
}
5762

5863
.soon-container {
5964
flex: 0;
60-
display: flex;
61-
flex-direction: row;
62-
vertical-align: center;
63-
align-items: center;
65+
@include center-contents;
6466
}
6567

6668
.soon {
@@ -71,6 +73,36 @@
7173
font-weight: 600;
7274
padding: 2px 4px;
7375
}
76+
77+
&:not(.navigation-dark) {
78+
border-radius: 4px;
79+
.icon {
80+
color: $gray-4;
81+
}
82+
.label {
83+
@include body-1-medium($gray-6);
84+
}
85+
86+
&:hover {
87+
background-color: $gray-1;
88+
}
89+
90+
&.active {
91+
background-color: $gray-2;
92+
93+
.label {
94+
color: $gray-9;
95+
}
96+
97+
.icon {
98+
color: $gray-6;
99+
}
100+
101+
&:hover {
102+
background-color: $gray-1;
103+
}
104+
}
105+
}
74106
}
75107

76108
:hover {

projects/components/src/navigation/nav-item/nav-item.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
22
import { ActivatedRoute } from '@angular/router';
33
import { FeatureState, NavigationParams, NavigationParamsType } from '@hypertrace/common';
44
import { IconSize } from '../../icon/icon-size';
5-
import { NavItemLinkConfig } from '../navigation.config';
5+
import { NavItemLinkConfig, NavViewStyle } from '../navigation.config';
66

77
@Component({
88
selector: 'ht-nav-item',
@@ -13,7 +13,7 @@ import { NavItemLinkConfig } from '../navigation.config';
1313
<div
1414
*htIfFeature="this.config.featureState$ | async as featureState"
1515
class="nav-item"
16-
[ngClass]="{ active: this.active }"
16+
[ngClass]="[this.active ? 'active' : '', this.navItemViewStyle ?? '', this.collapsed ? 'collapsed' : '']"
1717
>
1818
<ht-icon
1919
class="icon"
@@ -54,6 +54,9 @@ export class NavItemComponent {
5454
@Input()
5555
public collapsed: boolean = true;
5656

57+
@Input()
58+
public readonly navItemViewStyle?: NavViewStyle;
59+
5760
public buildNavigationParam = (item: NavItemLinkConfig): NavigationParams => ({
5861
navType: NavigationParamsType.InApp,
5962
path: item.matchPaths[0],

projects/components/src/navigation/navigation-list.component.scss

Lines changed: 84 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@import 'color-palette';
2-
@import 'font';
1+
@import 'mixins';
32

43
.navigation-list {
4+
@include nav-secondary-background;
55
position: relative;
66
display: flex;
77
flex-direction: column;
@@ -12,7 +12,8 @@
1212

1313
.content {
1414
overflow-y: auto;
15-
padding: 18px 12px;
15+
overflow-x: hidden;
16+
padding: 18px 0 12px 12px;
1617

1718
.nav-header {
1819
padding-top: 24px;
@@ -23,7 +24,7 @@
2324
align-items: center;
2425

2526
.label {
26-
@include overline($gray-9);
27+
@include overline($blue-2);
2728
}
2829

2930
.beta {
@@ -33,19 +34,17 @@
3334
}
3435

3536
.resize-tab-button {
37+
@include nav-secondary-background;
3638
position: absolute;
3739
display: flex;
3840
align-items: center;
3941
top: 22px;
4042
right: -12px;
4143
height: 28px;
4244
width: 12px;
43-
border: 1px solid $gray-2;
44-
border-left-color: white;
4545
border-radius: 0 6px 6px 0;
4646
cursor: pointer;
47-
color: $gray-7;
48-
background: white;
47+
color: white;
4948

5049
&:hover {
5150
color: $gray-4;
@@ -58,31 +57,100 @@
5857
}
5958

6059
.footer {
60+
display: flex;
61+
flex-direction: column;
6162
position: relative;
62-
margin-left: 6px;
6363
color: $gray-5;
6464
padding: 8px 12px 18px;
6565

6666
.footer-item {
6767
display: flex;
6868
align-items: center;
69-
margin-left: 12px;
69+
justify-content: center;
70+
71+
.nav-group-icon {
72+
height: 190px;
73+
opacity: 0.15;
74+
color: $blue-gray-4;
75+
}
76+
77+
.nav-group-label {
78+
margin: 10px auto 0 0;
79+
padding-right: 20px;
80+
font-size: 24px;
81+
font-weight: bold;
82+
color: $gray-4;
83+
}
7084

7185
.link {
86+
margin-right: auto;
7287
@include link;
7388
@include footnote($gray-5);
7489
}
7590
}
7691

7792
.nav-divider {
78-
position: absolute;
79-
top: 0;
80-
left: 24px;
81-
margin: 0;
93+
margin: 12px auto 8px 0;
8294
height: 1px;
8395
width: 16px;
84-
background-color: $gray-2;
85-
border: none;
96+
background-color: $gray-4;
97+
}
98+
}
99+
100+
&:not(.expanded) {
101+
.footer .footer-item .link {
102+
margin-right: 0;
103+
}
104+
105+
.footer .nav-divider {
106+
margin: 8px auto;
107+
}
108+
109+
.content {
110+
padding: 18px 0 12px 0;
111+
}
112+
}
113+
114+
&:not(.navigation-dark) {
115+
background: white;
116+
117+
.content {
118+
padding: 18px 12px;
119+
}
120+
&:not(.expanded) {
121+
.content {
122+
padding: 18px 12px;
123+
}
124+
}
125+
126+
.content .nav-header .label {
127+
@include overline($gray-9);
128+
}
129+
130+
.footer {
131+
margin-left: 6px;
132+
133+
.footer-item {
134+
margin-left: 12px;
135+
justify-content: unset;
136+
}
137+
.nav-divider {
138+
position: absolute;
139+
top: 0;
140+
left: 24px;
141+
margin: 0;
142+
height: 1px;
143+
width: 16px;
144+
background-color: $gray-2;
145+
border: none;
146+
}
147+
}
148+
149+
.resize-tab-button {
150+
border: 1px solid $gray-2;
151+
border-left-color: white;
152+
color: $gray-7;
153+
background: white;
86154
}
87155
}
88156
}

0 commit comments

Comments
 (0)