Skip to content

Commit ad636a6

Browse files
authored
Merge branch 'main' into filters-and-table
2 parents 0683a41 + 5545b9d commit ad636a6

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
AfterContentInit,
33
ChangeDetectionStrategy,
4+
ChangeDetectorRef,
45
Component,
56
ContentChildren,
67
EventEmitter,
@@ -201,6 +202,8 @@ export class MultiSelectComponent<V> implements ControlValueAccessor, AfterConte
201202
private propagateControlValueChange?: (value: V[] | undefined) => void;
202203
private propagateControlValueChangeOnTouch?: (value: V[] | undefined) => void;
203204

205+
public constructor(private readonly cdr: ChangeDetectorRef) {}
206+
204207
public ngAfterContentInit(): void {
205208
this.allOptions$ = this.allOptionsList !== undefined ? queryListAndChanges$(this.allOptionsList) : EMPTY;
206209
this.filteredOptions$ = combineLatest([this.allOptions$, this.searchSubject]).pipe(
@@ -265,6 +268,7 @@ export class MultiSelectComponent<V> implements ControlValueAccessor, AfterConte
265268

266269
public writeValue(value?: V[]): void {
267270
this.setSelection(value ?? []);
271+
this.cdr.markForCheck();
268272
}
269273

270274
public registerOnChange(onChange: (value: V[] | undefined) => void): void {

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,7 @@ export class SelectComponent<V> implements ControlValueAccessor, AfterContentIni
252252
return this.showBorder ? SelectJustify.Left : SelectJustify.Right;
253253
}
254254

255-
public constructor(
256-
private readonly loggerService: LoggerService,
257-
private readonly changeDetector: ChangeDetectorRef
258-
) {}
255+
public constructor(private readonly loggerService: LoggerService, private readonly cdr: ChangeDetectorRef) {}
259256

260257
public ngAfterContentInit(): void {
261258
this.selected$ = this.buildObservableOfSelected();
@@ -282,7 +279,7 @@ export class SelectComponent<V> implements ControlValueAccessor, AfterContentIni
282279

283280
public updateGroupPosition(position: SelectGroupPosition): void {
284281
this.groupPosition = position;
285-
this.changeDetector.markForCheck();
282+
this.cdr.markForCheck();
286283
}
287284

288285
public searchOptions(searchText: string): void {
@@ -341,6 +338,7 @@ export class SelectComponent<V> implements ControlValueAccessor, AfterContentIni
341338

342339
public writeValue(value?: V): void {
343340
this.setSelection(value);
341+
this.cdr.markForCheck();
344342
}
345343

346344
public registerOnChange(onChange: (value: V | undefined) => void): void {

projects/components/src/textarea/textarea.component.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
1+
import {
2+
ChangeDetectionStrategy,
3+
ChangeDetectorRef,
4+
Component,
5+
EventEmitter,
6+
Input,
7+
OnInit,
8+
Output
9+
} from '@angular/core';
210
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
311
import { LoggerService } from '@hypertrace/common';
412

@@ -44,7 +52,7 @@ export class TextareaComponent implements ControlValueAccessor, OnInit {
4452
@Output()
4553
public readonly valueChange: EventEmitter<string> = new EventEmitter();
4654

47-
public constructor(private readonly loggerService: LoggerService) {}
55+
public constructor(private readonly loggerService: LoggerService, private readonly cdr: ChangeDetectorRef) {}
4856

4957
public ngOnInit(): void {
5058
// tslint:disable-next-line:strict-type-predicates
@@ -64,6 +72,7 @@ export class TextareaComponent implements ControlValueAccessor, OnInit {
6472

6573
public writeValue(value?: string): void {
6674
this.value = value;
75+
this.cdr.markForCheck();
6776
}
6877

6978
public registerOnChange(onChange: (value?: string) => void): void {
@@ -74,6 +83,10 @@ export class TextareaComponent implements ControlValueAccessor, OnInit {
7483
this.propagateControlValueChangeOnTouch = onTouch;
7584
}
7685

86+
public setDisabledState(isDisabled?: boolean): void {
87+
this.disabled = isDisabled ?? false;
88+
}
89+
7790
private propagateValueChangeToFormControl(value?: string): void {
7891
this.propagateControlValueChange?.(value);
7992
this.propagateControlValueChangeOnTouch?.(value);

0 commit comments

Comments
 (0)