|
|
|
@ -64,7 +64,7 @@ export class CalculatedFieldArgumentPanelComponent implements OnInit { |
|
|
|
readonly defaultLimit = Math.floor(this.maxDataPointsPerRollingArg / 10); |
|
|
|
|
|
|
|
argumentFormGroup = this.fb.group({ |
|
|
|
argumentName: ['', [Validators.required, this.uniqNameRequired(), Validators.pattern(/^(?!ctx$).+$/), Validators.pattern(charsWithNumRegex), Validators.maxLength(255)]], |
|
|
|
argumentName: ['', [Validators.required, this.uniqNameRequired(), this.notEqualCtxValidator(), Validators.pattern(charsWithNumRegex), Validators.maxLength(255)]], |
|
|
|
refEntityId: this.fb.group({ |
|
|
|
entityType: [ArgumentEntityType.Current], |
|
|
|
id: [''] |
|
|
|
@ -237,6 +237,13 @@ export class CalculatedFieldArgumentPanelComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private notEqualCtxValidator(): ValidatorFn { |
|
|
|
return (control: FormControl) => { |
|
|
|
const trimmedValue = control.value.trim().toLowerCase(); |
|
|
|
return trimmedValue === 'ctx' ? { equalCtx: true } : null; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
private observeUpdatePosition(): void { |
|
|
|
merge( |
|
|
|
this.refEntityIdFormGroup.get('entityType').valueChanges, |
|
|
|
|