support validationErrorMessage in rjsf enum w/ burnettk (#311)

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
jasquat 2023-06-07 12:55:32 -04:00 committed by GitHub
parent bba28f1b9e
commit 49950b1639
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# TODO: clean up this service for a clear distinction between it and the process_instance_service # TODO: clean up this service for a clear distinction between it and the process_instance_service
# where this points to the pi service # where this points to the pi service
import decimal import decimal
import uuid
import json import json
import logging import logging
import os import os
@ -277,6 +278,7 @@ class CustomBpmnScriptEngine(PythonScriptEngine): # type: ignore
"sum": sum, "sum": sum,
"time": time, "time": time,
"timedelta": timedelta, "timedelta": timedelta,
"uuid": uuid,
} }
use_restricted_script_engine = True use_restricted_script_engine = True

View File

@ -53,9 +53,12 @@ function SelectWidget({
let errorMessageForField = null; let errorMessageForField = null;
if (rawErrors && rawErrors.length > 0) { if (rawErrors && rawErrors.length > 0) {
invalid = true; invalid = true;
// errorMessageForField = `${labelToUse.replace(/\*$/, '')} ${rawErrors[0]}`; if ('validationErrorMessage' in schema) {
errorMessageForField = (schema as any).validationErrorMessage;
} else {
errorMessageForField = rawErrors[0]; errorMessageForField = rawErrors[0];
} }
}
// ok. so in safari, the select widget showed the first option, whereas in chrome it forced you to select an option. // ok. so in safari, the select widget showed the first option, whereas in chrome it forced you to select an option.
// this change causes causes safari to act a little bit more like chrome, but it's different because we are actually adding // this change causes causes safari to act a little bit more like chrome, but it's different because we are actually adding