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

View File

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