diff --git a/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.html b/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.html index 6f7946a6f6..9ac6ac1846 100644 --- a/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.html +++ b/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.html @@ -254,6 +254,7 @@ [widgets]="widgets" [columns]="20" [isEdit]="false" + [isPreview]="true" [isMobileDisabled]="true" [isEditActionEnabled]="false" [isRemoveActionEnabled]="false"> diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/cards/api-usage-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/cards/api-usage-widget.component.ts index b41f5ed02a..97efac2cc8 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/cards/api-usage-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/cards/api-usage-widget.component.ts @@ -104,12 +104,16 @@ export class ApiUsageWidgetComponent implements OnInit, OnDestroy { }; this.ctx.subscriptionApi.createSubscription(apiUsageSubscriptionOptions, true).subscribe(); - this.currentState = this.ctx.stateController.getStateId(); - this.ctx.stateController.stateId().subscribe((state) => { - this.ctx.updateParamsFromData(true); - this.currentState = state; - this.cd.markForCheck(); - }); + const simulated = this.ctx.utilsService.widgetEditMode || this.ctx.isPreview; + + if (!simulated) { + this.currentState = this.ctx.stateController.getStateId(); + this.ctx.stateController.stateId().subscribe((state) => { + this.ctx.updateParamsFromData(true); + this.currentState = state; + this.cd.markForCheck(); + }); + } this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer); this.overlayStyle = overlayStyle(this.settings.background.overlay); this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding; @@ -121,7 +125,7 @@ export class ApiUsageWidgetComponent implements OnInit, OnDestroy { updateState($event: MouseEvent, stateName: string) { $event?.preventDefault(); - if (stateName?.length) { + if (stateName?.length && this.ctx.stateController) { this.ctx.stateController.updateState(stateName, this.ctx.stateController.getStateParams(), this.ctx.isMobile); } }