You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "sshiv012 (via GitHub)" <gi...@apache.org> on 2026/10/02 20:25:13 UTC
Re: [PR] feat: add a delimiter picker with regex validation [texera]
sshiv012 commented on code in PR #8644:
URL: https://github.com/apache/texera/pull/8644#discussion_r4169532576
##########
frontend/src/app/common/formly/formly-config.ts:
##########
@@ -94,6 +97,23 @@ export const TEXERA_FORMLY_CONFIG = {
{ name: "ui-udf-parameters", component: UiUdfParametersComponent, wrappers: ["form-field"] },
{ name: "constrainedvalue", component: ConstrainedValueComponent, wrappers: ["form-field"] },
{ name: "resourcevalue", component: ResourceValueSelectorComponent },
+ {
+ name: "delimiter",
+ component: DelimiterTypeComponent,
+ wrappers: ["form-field"],
+ defaultOptions: {
+ // Shown without waiting for a touch: a delimiter loaded from a saved workflow can already be
+ // invalid (an old multi-character one), and nobody touches a field they do not know is wrong.
+ validation: { show: true },
+ validators: {
+ delimiter: {
+ expression: (control: AbstractControl, field: FormlyFieldConfig) =>
+ delimiterError(control.value, delimiterModeOf(field)) === undefined,
+ message: delimiterValidationMessage,
Review Comment:
Thanks, good catch. Agreed it's a double evaluation on the error path. I'd keep it as is: the full scan only happens for match-everything patterns, few ms at most if measured correctly and every other pattern exits at the first character it misses. A module-level memo would add shared state for a negligible gain. So I believe we can accept the current cost as is.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org