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

fix: [Plugin Action Editor] Avoid multiple init of Form Eval #37780

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Nov 27, 2024

Description

Noticed that we are causing the evaluation of the form twice because changeQuery also initiates the eval. Since the changeQuery also handles other aspects, will defer to that and not initiate again for UQI Forms.

Fixes #37772

Automation

/ok-to-test tags="@tag.Sanity"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12062575061
Commit: f531f84
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Thu, 28 Nov 2024 05:14:17 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes
    • Removed the useInitFormEvaluation hook from the UQIEditorForm, streamlining the form initialization process.
    • Updated the useChangeActionCall hook to directly access the action.id, enhancing reliability in action dispatching.

Copy link
Contributor

coderabbitai bot commented Nov 27, 2024

Walkthrough

The changes in this pull request involve the removal of the useInitFormEvaluation hook from the UQIEditorForm component and the deletion of its corresponding file. Additionally, the useChangeActionCall hook has been modified to directly access the id property of the action object, eliminating the optional chaining operator. The overall structure and functionality of the components remain intact.

Changes

File Change Summary
app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/UQIEditorForm.tsx Removed the useInitFormEvaluation hook from the UQIEditorForm component.
app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/hooks/useInitFormEvaluation.ts Deleted the useInitFormEvaluation hook file.
app/client/src/PluginActionEditor/components/PluginActionForm/hooks/useChangeActionCall.ts Modified the useChangeActionCall hook to access action.id directly, removing optional chaining.

Assessment against linked issues

Objective Addressed Explanation
Mongo plugin action form is not rendering properly (#37772) The changes do not address rendering issues.

Possibly related PRs

Suggested labels

Bug, ok-to-test

Suggested reviewers

  • ankitakinger
  • albinAppsmith

🌟 In the land of code where hooks reside,
A form once evaluated, now takes a slide.
With changes made, the structure stays bright,
Removing the old, embracing the light!
Let's celebrate the code, both clean and neat,
For every little change makes our journey sweet! 🎉


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 62724e9 and f531f84.

📒 Files selected for processing (3)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/UQIEditorForm.tsx (0 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/hooks/useInitFormEvaluation.ts (0 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/hooks/useChangeActionCall.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/UQIEditorForm.tsx
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/hooks/useInitFormEvaluation.ts
🔇 Additional comments (2)
app/client/src/PluginActionEditor/components/PluginActionForm/hooks/useChangeActionCall.ts (2)

18-18: LGTM! Safely removed optional chaining

The removal of optional chaining is safe here as action is guaranteed to exist from the context.


Line range hint 21-31: Verify the form evaluation behavior

Based on the PR objectives, changeQuery was causing double evaluation of forms. While this change addresses the symptom by removing useInitFormEvaluation, we should verify that this doesn't affect other plugin types that might rely on the form evaluation.

Let's verify the impact:


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hetunandu hetunandu added the ok-to-test Required label for CI label Nov 27, 2024
@github-actions github-actions bot added IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Task A simple Todo Bug Something isn't working labels Nov 27, 2024
@hetunandu hetunandu added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Nov 28, 2024
@hetunandu hetunandu merged commit 0f3593a into release Nov 28, 2024
115 of 118 checks passed
@hetunandu hetunandu deleted the fix/form-render branch November 28, 2024 05:19
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Dec 2, 2024
…horg#37780)

## Description

Noticed that we are causing the evaluation of the form twice because
`changeQuery` also initiates the eval. Since the `changeQuery` also
handles other aspects, will defer to that and not initiate again for UQI
Forms.

Fixes appsmithorg#37772

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/12062575061>
> Commit: f531f84
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12062575061&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Thu, 28 Nov 2024 05:14:17 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Removed the `useInitFormEvaluation` hook from the `UQIEditorForm`,
streamlining the form initialization process.
- Updated the `useChangeActionCall` hook to directly access the
`action.id`, enhancing reliability in action dispatching.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product ok-to-test Required label for CI Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Mongo plugin action form is not rendering properly
2 participants