-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cloud): don't apply length and pattern validation to FEEL #115
Conversation
if (isFeel(value)) { | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have access to the property, so we could theoretically add stricter validation with
if (isFeel(value)) { | |
return; | |
} | |
if (property.feel && isFeel(value)) { | |
return; | |
} |
With this, this would still apply patterns to properties that are normal string type without feel expressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the schema the feel
property can also be static
. Would that mean the property is not FEEL? In that case we'd need to check the value of the property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answered. static
still means it's a FEEL expression. So a simple check is enough.
0be4966
to
c11a626
Compare
One UX issue I found with this is that the error message stays until there is an actual value. There is some internal state of the FEEL entry that decides whether it's FEEL and doesn't actually commit the initial |
As we have validation only when a value is persisted in other places as well (e.g. when you are still typing), I think this is fine for now. In these cases, it is basically "Should not be empty" but with another error message. I don't think this will be to confusing for the user, as the message disappears once an expression is present |
@marstamm In that case it's ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great change, great addition to the existing test coverage!
Try out via
npm start
.Related to camunda/camunda-modeler#4140
Proposed Changes
Checklist
To ensure you provided everything we need to look at your PR:
@bpmn-io/sr
toolCloses {LINK_TO_ISSUE}
orRelated to {LINK_TO_ISSUE}