Skip to content

Commit

Permalink
Query Builder: Set alias automatically based on name
Browse files Browse the repository at this point in the history
  • Loading branch information
askask committed Jul 23, 2024
1 parent 7f7fb31 commit d089521
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ export class AqlBuilderSelectItemComponent implements OnInit, OnDestroy {

ngOnInit(): void {
this.aliasForm = new UntypedFormGroup({
value: new UntypedFormControl(this.item.givenName),
value: new UntypedFormControl(
this.item.givenName || this.item.name.replace(/(^[^a-zA-Z]+)|[^0-9a-zA-Z_]+/g, '_')
),
})

this.handleAliasChange(this.aliasForm.get('value').value)
this.subscriptions.add(
this.aliasForm.get('value').valueChanges.subscribe((value) => this.handleAliasChange(value))
)
Expand Down

0 comments on commit d089521

Please sign in to comment.