feat: add d2:log and d2:exponent to program rule expression builder [DHIS2-21809] [DHIS2-21983] - #1025
Open
karolinelien wants to merge 3 commits into
Open
feat: add d2:log and d2:exponent to program rule expression builder [DHIS2-21809] [DHIS2-21983]#1025karolinelien wants to merge 3 commits into
karolinelien wants to merge 3 commits into
Conversation
…DHIS2-21809] Adds the two new grammar functions to the program rule function catalog so they can be inserted from the expression builder sidebar.
✅ Deploy Preview for dhis2-maintenance-app-beta ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The base argument of d2:log is optional, so listing the function as d2:log( <number> , <number> ) did not match the catalog convention of showing required arguments only - d2:round is listed as d2:round( <number> ) despite also taking an optional second argument. d2:exponent keeps both arguments, which are genuinely required. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
karolinelien
marked this pull request as ready for review
September 1, 2026 15:09
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.



See https://dhis2.atlassian.net/browse/DHIS2-21809 and https://dhis2.atlassian.net/browse/DHIS2-21983
Summary
d2:log( <number> )andd2:exponent( <number> , <number> )to the program rule function catalog (PROGRAM_RULE_FUNCTION_ELEMENTS) so they can be inserted from the expression builder sidebar when writing program rule expressions.d2:logis listed with its required argument only — the optional base argument is omitted, matchingd2:round( <number> ), which also takes an optional second argument.d2:logandd2:exponentto program rule grammar expression-parser#101.Test plan
d2:logandd2:exponentappear in the Functions list and insert correctlyprogramRuleElementTypesonly)yarn check-types/yarn testpassAI Assisted