Browse Source

UI: disabled useLatestTs for related entity aggregation

pull/14833/head
ArtemDzhereleiko 9 months ago
parent
commit
e39a161463
  1. 15
      ui-ngx/src/app/modules/home/components/calculated-fields/components/related-entities-aggregation-configuration/related-entities-aggregation-component.component.ts

15
ui-ngx/src/app/modules/home/components/calculated-fields/components/related-entities-aggregation-configuration/related-entities-aggregation-component.component.ts

@ -120,7 +120,12 @@ export class RelatedEntitiesAggregationComponentComponent implements ControlValu
takeUntilDestroyed() takeUntilDestroyed()
).subscribe((value: CalculatedFieldRelatedAggregationConfiguration) => { ).subscribe((value: CalculatedFieldRelatedAggregationConfiguration) => {
this.updatedModel(value); this.updatedModel(value);
}) });
this.relatedAggregationConfiguration.get('output').valueChanges.pipe(
takeUntilDestroyed(),
).subscribe(() => {
this.toggleScopeByOutputType();
});
} }
validate(): ValidationErrors | null { validate(): ValidationErrors | null {
@ -158,4 +163,12 @@ export class RelatedEntitiesAggregationComponentComponent implements ControlValu
value.scheduledUpdateInterval = this.minAllowedScheduledUpdateIntervalInSecForCF; value.scheduledUpdateInterval = this.minAllowedScheduledUpdateIntervalInSecForCF;
this.propagateChange(value); this.propagateChange(value);
} }
private toggleScopeByOutputType(): void {
if (this.relatedAggregationConfiguration.get('output').value.type === OutputType.Attribute) {
this.relatedAggregationConfiguration.get('useLatestTs').disable({emitEvent: false});
} else {
this.relatedAggregationConfiguration.get('useLatestTs').enable({emitEvent: false});
}
}
} }

Loading…
Cancel
Save