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

feat(cloud): allow Number and Boolean custom properties #64

Merged
merged 6 commits into from
Feb 16, 2024

Conversation

marstamm
Copy link
Collaborator

related to camunda/camunda-modeler#3622

Try it out with the "Number and Boolean" example template in the npm start preview environment.

  • Persist Number and boolean values as FEEL expressions if feel: optional or feel: static is set in the template
  • We only show the FEEL editor if the value in the XML is not a primitive number/boolean

Other Refactorings

Recording 2024-02-12 at 14 42 58

@marstamm marstamm requested a review from a team February 12, 2024 13:48
@marstamm marstamm self-assigned this Feb 12, 2024
@marstamm marstamm requested review from philippfromme and barmac and removed request for a team February 12, 2024 13:48
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Feb 12, 2024
@barmac
Copy link
Member

barmac commented Feb 13, 2024

I think it would make sense to also implement the FEEL expression shortcut that we support for text fields, i.e. = should convert the number to a FEEL expression if allowed.

Comment on lines 33 to 40
const validate = useCallback((value) => {
if (isNumber(value) && value.toString().includes('e')) {
return translate('Scientific Notation is disallowed');
}

const defaultValidator = propertyValidator(translate, property);
return defaultValidator(value);
}, [ translate, property ]);
Copy link
Member

Choose a reason for hiding this comment

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

I thought initially that it doesn't work as supposed because the automatic conversion (which I love) kicked in:

Screen.Recording.2024-02-13.at.11.54.32.mov

@marstamm
Copy link
Collaborator Author

I think it would make sense to also implement the FEEL expression shortcut that we support for text fields, i.e. = should convert the number to a FEEL expression if allowed.

I think that makes sense, but is not directly related to the element template feature. I created a follow-up issue in the properties-panel repo: bpmn-io/properties-panel#346

@nikku nikku self-requested a review February 16, 2024 07:45
Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

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

Great stuff!

@marstamm marstamm merged commit a8a5aa5 into main Feb 16, 2024
8 checks passed
@marstamm marstamm deleted the support-number-boolean branch February 16, 2024 14:41
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants