Add ExpressionEditor support to LabelValueEditor and related components - #5148
Add ExpressionEditor support to LabelValueEditor and related components#5148micanipho wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdds expression-based value editing to ChangesExpression value editor
Password session handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant LabelValueEditor
participant ExpressionLabelValueList
participant useExpressionEditorContext
participant ExpressionEditor
LabelValueEditor->>ExpressionLabelValueList: select expression value mode
ExpressionLabelValueList->>useExpressionEditorContext: build shared autocomplete context
useExpressionEditorContext->>ExpressionLabelValueList: return merged ExpressionContext
ExpressionLabelValueList->>ExpressionEditor: render value cells with context
ExpressionEditor->>LabelValueEditor: emit changed expression
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shesha-reactjs/src/designer-components/checkboxGroup/settingsForm.ts`:
- Line 158: The items[].value editor in checkboxGroup/radioGroup settings is
currently using the expression editor, which allows unevaluated {{...}} strings
to be stored and then compared literally. Update the settingsForm configuration
for the checkboxGroup option values to use a plain text editor instead of the
expression editor, or add explicit runtime evaluation in the
checkboxGroup/radioGroup comparison path so the stored value matches what the
component compares against.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e2bbe86a-1b39-425d-abb4-e4213e0623fb
📒 Files selected for processing (9)
shesha-reactjs/src/components/expressionEditor/useExpressionEditorContext.tsshesha-reactjs/src/components/labelValueEditor/interfaces.tsshesha-reactjs/src/components/labelValueEditor/labelValueEditor.tsxshesha-reactjs/src/designer-components/autocomplete/settingsForm.tsshesha-reactjs/src/designer-components/checkboxGroup/settingsForm.tsshesha-reactjs/src/designer-components/entityReference/settingsForm.tsshesha-reactjs/src/designer-components/radio/settingsForm.tsshesha-reactjs/src/designer-components/settingsInput/interfaces.tsshesha-reactjs/src/providers/shaRouting/actions/navigate-arguments.ts
This pull request adds support for using a mustache-aware ExpressionEditor as the value cell in the LabelValueEditor component. It introduces a new prop to control whether the value column
uses a plain text input or the expression editor, and updates several settings forms to default to the expression editor for values. The implementation ensures that the expression editor and
its associated metadata hooks are only loaded when needed, and that the expression context is built once per editor rather than once per row optimizing performance for consumers who do not
require expression editing as well as those with many value rows.
LabelValueEditor enhancements:
'expression') and passed down to each cell, so adding N rows no longer rebuilds the context — including its async metadata — N times. The metadata/constants hooks stay entirely off the
plain-input path.
Settings form updates:
expression editor for value cells, enabling mustache expression support in these UIs.
so an expression editor there would be a false affordance.
Expression editor context support:
unavailable.
Related to issue: #5077
Summary by CodeRabbit
New Features
Bug Fixes