Expressions: Refinements to new functions#1217
Merged
olemartinorg merged 15 commits intomainfrom May 31, 2023
Merged
Conversation
added 13 commits
May 31, 2023 09:26
# Conflicts: # src/layout/Group/DisplayGroupContainer.tsx
…to disable (they don't work quite right in app-frontend yet)
…pt when absolutely necessary, and trying to ["upperCase", ["dataModel", "something.without.a.value.currently"]] should not spam runtime exceptions that cause the entire expression to fail. Adding more test cases, and converting the "round" function to return a string (as it can't reliably produce the number of decimals without actually returning a string - luckily strings can still be used for further calculations, but number types are not guaranteed to actually display the number of decimal places supplied to "round").
…ync with the expression function definitions
…ns. It is impossible to match multiple schemas anyway, since all of them have to start with the unique function name.
…a arguments, as auto-completion now works well with anyOf instead of oneOf
12 tasks
added 2 commits
May 31, 2023 13:09
|
Kudos, SonarCloud Quality Gate passed! |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Description
I missed the review window to #1209, but it turns out I had quite a few more comments to add, so I would have just made @framitdavid's day much worse, and bothered him unnecessarily before his holiday...
Here's the changes I would have suggested:
nullto make sure no runtime errors occcur. We can be sure that anullnever ends with the given string, so these functions (such asendsWith) should just return the expectedbooleaninstead of throwing an exception that bubbles up the stack.roundfunction optional (and implementing support for that in the validator), so that we don't have to passnullwhen you want to round to the nearest integer.nbas the defaultlanguageif the profile does not have any information. That's the default in our apps as well, andnullas the default here is not really useful.anyOfinstead ofoneOfRelated Issue(s)
Verification/QA
src/layout/layout.d.tsandlayout.schema.v1.json, and these are all backwards-compatiblekind/*label to this PR for proper release notes grouping