Browse Source

Merge pull request #14612 from ArtemDzhereleiko/AD/enh/calculated-fields/prop-output

Enhancement for calculated fields
pull/14630/head
Vladyslav Prykhodko 10 months ago
committed by GitHub
parent
commit
b5d66096c5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 14
      ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.ts
  2. 1
      ui-ngx/src/app/modules/home/components/calculated-fields/components/propagation-configuration/propagation-configuration.component.html

14
ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.ts

@ -120,6 +120,10 @@ export class CalculatedFieldOutputComponent implements ControlValueAccessor, Val
this.updatedStrategy(); this.updatedStrategy();
}); });
this.outputForm.get('strategy.saveTimeSeries').valueChanges
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(value => this.updateTimeSeriesTtl(value));
merge( merge(
this.outputForm.get('strategy.type').valueChanges, this.outputForm.get('strategy.type').valueChanges,
this.outputForm.get('strategy.useCustomTtl').valueChanges this.outputForm.get('strategy.useCustomTtl').valueChanges
@ -178,6 +182,7 @@ export class CalculatedFieldOutputComponent implements ControlValueAccessor, Val
this.updatedFormWithMode(); this.updatedFormWithMode();
this.toggleScopeByOutputType(this.outputForm.get('type').value); this.toggleScopeByOutputType(this.outputForm.get('type').value);
this.updatedStrategy(); this.updatedStrategy();
this.updateTimeSeriesTtl(this.outputForm.get('strategy.saveTimeSeries').value);
} }
} }
@ -242,4 +247,13 @@ export class CalculatedFieldOutputComponent implements ControlValueAccessor, Val
} }
} }
} }
private updateTimeSeriesTtl(value: boolean) {
if (value) {
this.outputForm.get('strategy.useCustomTtl').enable({emitEvent: true});
} else {
this.outputForm.get('strategy.useCustomTtl').disable({emitEvent: false});
this.outputForm.get('strategy.ttl').disable({emitEvent: false});
}
}
} }

1
ui-ngx/src/app/modules/home/components/calculated-fields/components/propagation-configuration/propagation-configuration.component.html

@ -55,6 +55,7 @@
[tenantId]="tenantId" [tenantId]="tenantId"
[entityName]="entityName" [entityName]="entityName"
[ownerId]="ownerId" [ownerId]="ownerId"
[watchKeyChange]="true"
[isScript]="this.propagateConfiguration.get('applyExpressionToResolvedArguments').value"/> [isScript]="this.propagateConfiguration.get('applyExpressionToResolvedArguments').value"/>
</div> </div>
<div class="tb-form-panel no-gap" [class.!hidden]="!this.propagateConfiguration.get('applyExpressionToResolvedArguments').value"> <div class="tb-form-panel no-gap" [class.!hidden]="!this.propagateConfiguration.get('applyExpressionToResolvedArguments').value">

Loading…
Cancel
Save