Skip to content
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

Integrate first-item FEEL validation gracefully, as a warning #381

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

nikku
Copy link
Member

@nikku nikku commented Sep 20, 2024

Proposed Changes

This ensures that first-item is not indicated as a hard error, but a warning. It also prevents first-item matches, along with any non-syntax errors, from showing off as a Unparseable FEEL expression syntax error.

capture 1K2elv_optimized

Try out via

npx @bpmn-io/sr bpmn-io/bpmn-js-properties-panel -l bpmn-io/properties-panel#first-item-warning

Related to bpmn-io/bpmn-js-properties-panel#1078

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@@ -130,14 +130,15 @@ function FeelTextfieldComponent(props) {
}
};

const handleLint = useStaticCallback(lint => {
const handleLint = useStaticCallback((lint = []) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Positive change


if (!(lint && lint.length)) {
const syntaxError = lint.some(report => report.type === 'Syntax Error');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one

@nikku nikku merged commit e9f2636 into main Sep 20, 2024
13 checks passed
@nikku nikku deleted the first-item-warning branch September 20, 2024 09:35
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants