Fixed device filter bug

This commit is contained in:
mpetrov 2025-01-31 19:08:56 +02:00
parent 14feedbfa0
commit 8dca91c909
3 changed files with 10 additions and 5 deletions

View File

@ -97,7 +97,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
name: this.translate.instant('action.edit'),
icon: 'edit',
isEnabled: () => true,
onAction: (_, entity) => this.editCalculatedField(entity)
onAction: (_, entity) => this.editCalculatedField(entity),
}
);
}
@ -171,7 +171,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
tenantId: this.tenantId,
}
})
.afterClosed()
.afterClosed();
}
private getDebugConfigLabel(debugSettings: EntityDebugSettings): string {
@ -180,7 +180,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
if (!isDebugActive) {
return debugSettings?.failuresEnabled ? this.translate.instant('debug-settings.failures') : this.translate.instant('common.disabled');
} else {
return this.durationLeft.transform(debugSettings?.allEnabledUntil)
return this.durationLeft.transform(debugSettings?.allEnabledUntil);
}
}

View File

@ -15,4 +15,6 @@
limitations under the License.
-->
<tb-entities-table [entitiesTableConfig]="calculatedFieldsTableConfig"></tb-entities-table>
@if (calculatedFieldsTableConfig) {
<tb-entities-table [entitiesTableConfig]="calculatedFieldsTableConfig"></tb-entities-table>
}

View File

@ -16,6 +16,7 @@
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
DestroyRef,
effect,
@ -43,7 +44,7 @@ export class CalculatedFieldsTableComponent {
@ViewChild(EntitiesTableComponent, {static: true}) entitiesTable: EntitiesTableComponent;
active = input();
active = input<boolean>();
entityId = input<EntityId>();
calculatedFieldsTableConfig: CalculatedFieldsTableConfig;
@ -54,6 +55,7 @@ export class CalculatedFieldsTableComponent {
private store: Store<AppState>,
private durationLeft: DurationLeftPipe,
private popoverService: TbPopoverService,
private cd: ChangeDetectorRef,
private destroyRef: DestroyRef) {
effect(() => {
@ -68,6 +70,7 @@ export class CalculatedFieldsTableComponent {
this.popoverService,
this.destroyRef,
);
this.cd.markForCheck();
}
});
}