Browse Source

Added value changes observable for color type

pull/15065/head
Maksym Tsymbarov 7 months ago
committed by Vladyslav Prykhodko
parent
commit
77b469d9a7
  1. 7
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts

7
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts

@ -34,6 +34,7 @@ import { IAliasController } from '@core/api/widget-api.models';
import { coerceBoolean } from '@shared/decorators/coercion'; import { coerceBoolean } from '@shared/decorators/coercion';
import { DataKeysCallbacks } from '@home/components/widget/lib/settings/common/key/data-keys.component.models'; import { DataKeysCallbacks } from '@home/components/widget/lib/settings/common/key/data-keys.component.models';
import { Datasource } from '@shared/models/widget.models'; import { Datasource } from '@shared/models/widget.models';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@Component({ @Component({
selector: 'tb-color-settings-panel', selector: 'tb-color-settings-panel',
@ -107,6 +108,12 @@ export class ColorSettingsPanelComponent extends PageComponent implements OnInit
colorFunction: [this.colorSettings?.colorFunction, []] colorFunction: [this.colorSettings?.colorFunction, []]
} }
); );
this.colorSettingsFormGroup.get('type').valueChanges.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => {
this.updateValidators();
setTimeout(() => {this.popover?.updatePosition();}, 0);
});
this.updateValidators(); this.updateValidators();
} }

Loading…
Cancel
Save