diff --git a/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.html b/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.html index 81563f4bf8..8bc399974c 100644 --- a/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.html @@ -24,8 +24,8 @@ (click)="openDebugStrategyPanel($event, matButton)"> bug_report @if (isDebugAllActive$ | async) { - {{ !allEnabled() ? (allEnabledUntil | durationLeft) : (maxDebugModeDuration | milliSecondsToTimeString: true : true) }} + {{ (allEnabled$ | async) === false ? (allEnabledUntil | durationLeft) : (maxDebugModeDuration | milliSecondsToTimeString: true : true) }} } @else { - {{ (failuresEnabled ? 'debug-config.failures' : 'common.disabled') | translate }} + {{ (failuresEnabled ? 'debug-settings.failures' : 'common.disabled') | translate }} } diff --git a/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.ts b/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.ts index 932658f9bf..e46112dd9c 100644 --- a/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.ts @@ -21,7 +21,6 @@ import { forwardRef, Input, Renderer2, - signal, ViewContainerRef } from '@angular/core'; import { CommonModule } from '@angular/common'; @@ -30,8 +29,8 @@ import { DurationLeftPipe } from '@shared/pipe/duration-left.pipe'; import { TbPopoverService } from '@shared/components/popover.service'; import { MatButton } from '@angular/material/button'; import { EntityDebugSettingsPanelComponent } from './entity-debug-settings-panel.component'; -import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'; -import { of, shareReplay, timer } from 'rxjs'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { BehaviorSubject, of, shareReplay, timer } from 'rxjs'; import { SECOND, MINUTE } from '@shared/models/time/time.models'; import { EntityDebugSettings } from '@shared/models/entity.models'; import { map, switchMap, takeWhile } from 'rxjs/operators'; @@ -61,6 +60,7 @@ import { ControlValueAccessor, FormBuilder, NG_VALUE_ACCESSOR } from '@angular/f export class EntityDebugSettingsButtonComponent implements ControlValueAccessor { @Input() debugLimitsConfiguration: string; + @Input() entityLabel = 'entity'; debugSettingsFormGroup = this.fb.group({ failuresEnabled: [false], @@ -69,9 +69,10 @@ export class EntityDebugSettingsButtonComponent implements ControlValueAccessor }); disabled = false; - allEnabled = signal(false); + private allEnabledSubject = new BehaviorSubject(false); + allEnabled$ = this.allEnabledSubject.asObservable(); - isDebugAllActive$ = toObservable(this.allEnabled).pipe( + isDebugAllActive$ = this.allEnabled$.pipe( switchMap((value) => { if (value) { return of(true); @@ -105,7 +106,7 @@ export class EntityDebugSettingsButtonComponent implements ControlValueAccessor this.debugSettingsFormGroup.get('allEnabled').valueChanges.pipe( takeUntilDestroyed() - ).subscribe(value => this.allEnabled.set(value)); + ).subscribe(value => this.allEnabledSubject.next(value)); } get failuresEnabled(): boolean { @@ -131,7 +132,8 @@ export class EntityDebugSettingsButtonComponent implements ControlValueAccessor { ...debugSettings, maxDebugModeDuration: this.maxDebugModeDuration, - debugLimitsConfiguration: this.debugLimitsConfiguration + debugLimitsConfiguration: this.debugLimitsConfiguration, + entityLabel: this.entityLabel }, {}, {}, {}, true); @@ -152,7 +154,7 @@ export class EntityDebugSettingsButtonComponent implements ControlValueAccessor writeValue(settings: EntityDebugSettings): void { this.debugSettingsFormGroup.patchValue(settings, {emitEvent: false}); - this.allEnabled.set(settings?.allEnabled); + this.allEnabledSubject.next(settings?.allEnabled); this.debugSettingsFormGroup.get('allEnabled').updateValueAndValidity({onlySelf: true}); } diff --git a/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-panel.component.html b/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-panel.component.html index d47ee69091..27717c0f54 100644 --- a/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-panel.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-panel.component.html @@ -16,26 +16,26 @@ -->
-
debug-config.label
+
debug-settings.label
@if (debugLimitsConfiguration) { - {{ 'debug-config.hint.main-limited' | translate: { msg: maxMessagesCount, time: (maxTimeFrameDuration | milliSecondsToTimeString: true : true) } }} + {{ 'debug-settings.hint.main-limited' | translate: { entity: entityLabel, msg: maxMessagesCount, time: (maxTimeFrameDuration | milliSecondsToTimeString: true : true) } }} } @else { - {{ 'debug-config.hint.main' | translate }} + {{ 'debug-settings.hint.main' | translate }} }
-
- {{ 'debug-config.on-failure' | translate }} +
+ {{ 'debug-settings.on-failure' | translate }}
-
- {{ 'debug-config.all-messages' | translate: { time: (isDebugAllActive$ | async) && !allEnabled ? (allEnabledUntil | durationLeft) : (maxDebugModeDuration | milliSecondsToTimeString: true : true) } }} +
+ {{ 'debug-settings.all-messages' | translate: { time: (isDebugAllActive$ | async) && !allEnabled ? (allEnabledUntil | durationLeft) : (maxDebugModeDuration | milliSecondsToTimeString: true : true) } }}