Skip to content

Commit f0de2c0

Browse files
authored
Merge branch 'main' into minor-styling-fixes
2 parents 7cae7bf + 251604e commit f0de2c0

File tree

41 files changed

+815
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+815
-52
lines changed

projects/common/src/time/time-range.service.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,11 @@ describe('Time range service', () => {
8181
});
8282
});
8383
});
84+
85+
test('returns custom time filter', () => {
86+
const spectator = buildService();
87+
expect(spectator.service.toQueryParams(new Date(1642296703000), new Date(1642396703000))).toStrictEqual({
88+
['time']: new FixedTimeRange(new Date(1642296703000), new Date(1642396703000)).toUrlString()
89+
});
90+
});
8491
});

projects/common/src/time/time-range.service.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
22
import { isEmpty } from 'lodash-es';
33
import { EMPTY, ReplaySubject } from 'rxjs';
44
import { catchError, defaultIfEmpty, filter, map, switchMap, take } from 'rxjs/operators';
5-
import { NavigationService } from '../navigation/navigation.service';
5+
import { NavigationService, QueryParamObject } from '../navigation/navigation.service';
66
import { ReplayObservable } from '../utilities/rxjs/rxjs-utils';
77
import { FixedTimeRange } from './fixed-time-range';
88
import { RelativeTimeRange } from './relative-time-range';
@@ -110,4 +110,12 @@ export class TimeRangeService {
110110
public static toFixedTimeRange(startTime: Date, endTime: Date): FixedTimeRange {
111111
return new FixedTimeRange(startTime, endTime);
112112
}
113+
114+
public toQueryParams(startTime: Date, endTime: Date): QueryParamObject {
115+
const newTimeRange = new FixedTimeRange(startTime, endTime);
116+
117+
return {
118+
[TimeRangeService.TIME_RANGE_QUERY_PARAM]: newTimeRange.toUrlString()
119+
};
120+
}
113121
}

projects/components/src/combo-box/combo-box.component.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
}
4646
}
4747

48+
&.disabled {
49+
background-color: $gray-2;
50+
.trigger-input {
51+
color: black;
52+
}
53+
}
54+
4855
.trigger-control {
4956
height: 100%;
5057
width: 24px;

projects/components/src/combo-box/combo-box.component.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,21 @@ import { ComboBoxMode, ComboBoxOption, ComboBoxResult } from './combo-box-api';
3434
}
3535
],
3636
template: `
37-
<ht-popover (popoverOpen)="this.onPopoverOpen($event)" (popoverClose)="this.onPopoverClose()" class="combo-box">
37+
<ht-popover
38+
class="combo-box"
39+
[disabled]="this.disabled"
40+
(popoverOpen)="this.onPopoverOpen($event)"
41+
(popoverClose)="this.onPopoverClose()"
42+
>
3843
<ht-popover-trigger>
3944
<div
4045
#trigger
4146
class="popover-trigger"
4247
[ngClass]="{
4348
input: this.mode === '${ComboBoxMode.Input}',
4449
chip: this.mode === '${ComboBoxMode.Chip}',
45-
'show-border': this.showBorder
50+
'show-border': this.showBorder,
51+
disabled: this.disabled
4652
}"
4753
[class.has-text]="this.text"
4854
[class.input-focused]="input.matches(':focus')"
@@ -79,6 +85,7 @@ import { ComboBoxMode, ComboBoxOption, ComboBoxResult } from './combo-box-api';
7985
8086
<!-- Clear Button -->
8187
<div
88+
*ngIf="!this.disabled"
8289
[class.has-text]="this.text"
8390
[class.input-focused]="input.matches(':focus')"
8491
[ngClass]="this.mode"
@@ -427,6 +434,10 @@ export class ComboBoxComponent<TValue = string> implements AfterViewInit, OnChan
427434
});
428435
}
429436

437+
public setDisabledState(isDisabled?: boolean): void {
438+
this.disabled = isDisabled ?? false;
439+
}
440+
430441
private propagateValueChangeToFormControl(value?: string): void {
431442
this.propagateControlValueChange?.(value);
432443
this.propagateControlValueChangeOnTouch?.(value);

projects/components/src/copy-to-clipboard/copy-to-clipboard.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class CopyToClipboardComponent implements OnInit, OnDestroy {
132132
locationPreferences: [PopoverRelativePositionLocation.AboveCentered]
133133
},
134134
componentOrTemplate: this.notificationTemplate,
135-
backdrop: PopoverBackdrop.Transparent
135+
backdrop: PopoverBackdrop.None
136136
});
137137

138138
return of(popoverRef).pipe(

projects/components/src/input/input.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export class InputComponent<T extends string | number> implements ControlValueAc
8686
public registerOnTouched(onTouch: (value: T | undefined) => void): void {
8787
this.propagateControlValueChangeOnTouch = onTouch;
8888
}
89+
8990
public setDisabledState(isDisabled?: boolean): void {
9091
this.disabled = isDisabled ?? false;
9192
}

projects/components/src/overlay/sheet/sheet-overlay.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import { SheetOverlayConfig, SheetSize } from './sheet';
4444
class="trigger-icon"
4545
icon="{{ this.isViewCollapsed ? '${IconType.ChevronUp}' : '${IconType.ChevronDown}' }}"
4646
size="${IconSize.Small}"
47-
htTooltip="{{ this.isViewCollapsed ? 'Expand Sheet' : 'Collapse Sheet' }}"
4847
></ht-icon>
4948
<ng-container *ngTemplateOutlet="this.attachedTriggerTemplate"></ng-container>
5049
</div>

projects/components/src/popover/popover-position-builder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ export class PopoverPositionBuilder {
109109
return globalPosition.centerHorizontally().centerVertically();
110110
case PopoverFixedPositionLocation.Right:
111111
return globalPosition.right('0').top('0');
112+
113+
case PopoverFixedPositionLocation.Custom:
114+
return globalPosition
115+
.left(`${popoverPosition.customLocation!.x}px`)
116+
.top(`${popoverPosition.customLocation!.y}px`);
112117
case PopoverFixedPositionLocation.RightUnderHeader:
113118
default:
114119
return globalPosition.right('0').top(this.headerHeight ?? '0');

projects/components/src/popover/popover.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export interface PopoverRelativePosition {
3434
export interface PopoverFixedPosition {
3535
type: PopoverPositionType.Fixed;
3636
location: PopoverFixedPositionLocation;
37+
customLocation?: {
38+
x: number;
39+
y: number;
40+
};
3741
}
3842

3943
export type PopoverPosition =
@@ -65,7 +69,8 @@ export const enum PopoverRelativePositionLocation {
6569
export const enum PopoverFixedPositionLocation {
6670
RightUnderHeader,
6771
Centered,
68-
Right
72+
Right,
73+
Custom
6974
}
7075

7176
export const POPOVER_DATA = new InjectionToken<unknown>('POPOVER_DATA');

projects/components/src/select/select.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ export class SelectComponent<V> implements ControlValueAccessor, AfterContentIni
324324
this.propagateControlValueChangeOnTouch = onTouch;
325325
}
326326

327+
public setDisabledState(isDisabled?: boolean): void {
328+
this.disabled = isDisabled ?? false;
329+
}
330+
327331
private propagateValueChangeToFormControl(value: V | undefined): void {
328332
this.propagateControlValueChange?.(value);
329333
this.propagateControlValueChangeOnTouch?.(value);

0 commit comments

Comments
 (0)