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 negligible.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]