-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
chore: Compute default value for jsaction params #34708
base: release
Are you sure you want to change the base?
Conversation
WalkthroughThe changes primarily involve enhancements to the functionality of an asynchronous function Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9791119261. |
Deploy-Preview-URL: https://ce-34708.dp.appsmith.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- app/client/packages/ast/src/index.test.ts (3 hunks)
- app/client/packages/ast/src/index.ts (3 hunks)
- app/client/packages/ast/src/jsObject/index.ts (1 hunks)
- app/client/src/ce/workers/Evaluation/getEntityForEvalContextMap.ts (1 hunks)
- app/client/src/ee/workers/Evaluation/getJSActionForEvalContext.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- app/client/src/ee/workers/Evaluation/getJSActionForEvalContext.ts
Additional comments not posted (5)
app/client/src/ce/workers/Evaluation/getEntityForEvalContextMap.ts (1)
3-3
: Verify the new import path.Ensure that the new import path
"@appsmith/workers/Evaluation/getJSActionForEvalContext"
is correct and consistent with the updated module structure.app/client/packages/ast/src/jsObject/index.ts (1)
125-125
: Verify the additional parameters in the function call.Ensure that the additional parameters
true
andcode
passed togetFunctionalParamsFromNode
are correct and consistent with the function's signature.app/client/packages/ast/src/index.test.ts (1)
Line range hint
571-612
:
Verify the new parameters and default values formyFun2
.Ensure that the new parameters and their default values added to
myFun2
are correct and consistent with the function's intended usage.app/client/packages/ast/src/index.ts (2)
107-107
: Verify the new property in theAssignmentPatternNode
interface.Ensure that the new property
right: ArgumentTypes
is correctly added and consistent with the intended functionality.
523-523
: Verify the additional parameter in the function signature.Ensure that the additional parameter
code = ""
in thegetFunctionalParamsFromNode
function is correctly added and consistent with the function's intended functionality.
const defaultValue = | ||
paramNode.right.type === "Literal" && | ||
typeof paramNode.right.value === "string" | ||
? paramNode.right.value | ||
: `{{${defaultValueInString}}}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on how adding {{ }}
helps to maintain datatype integrity as mentioned in the description?
// if in future we need default values of each param, we could implement that in getFunctionalParamsFromNode | ||
// currently we don't consume it anywhere hence avoiding to calculate that. | ||
const params = getFunctionalParamsFromNode(node.value); | ||
const params = getFunctionalParamsFromNode(node.value, true, code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the defaultValue that will be configured here? I would like to understand how it will be used.
Description
This PR adds the values to jsArguments. The logic for this is
{{ }}
do maintain the data type integrity when evaluated.This property is currently not used anywhere in the platform and this is intended to be used by js modules to identify the default values of parameters and provide support to alter then in a UI in the app.
This PR also splits
workers/Evaluation/getJSActionForEvalContext.ts
to override in the EE for modulesPR for https://github.com/appsmithorg/appsmith-ee/pull/4612
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9850866889
Commit: 28b6f52
Cypress dashboard.
Tags:
@tag.All
Spec:
Tue, 09 Jul 2024 05:18:59 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Refactor
Code Enhancements