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: Enabled js mode by default for Table and Select widget form display ui button #39032

Merged
merged 6 commits into from
Feb 6, 2025

Conversation

AmanAgarwal041
Copy link
Contributor

@AmanAgarwal041 AmanAgarwal041 commented Feb 5, 2025

Description

Earlier the js mode was not enabled by default when we bind the data from the response of an action to any widget either using the suggested widget or adding a new one. After this PR, this issue gets resolved.

Steps to test :

  • Create an API with response e.g. mock users api
  • Create a table widget
  • Go to the action, run it
  • Once you see the response, in the right side corner, there will be a Diplay UI button.
  • Click on the button and bind the response to the widget by selecting once with Add a new widget and then with suggested widget.
  • Both the cases should have js binding enabled for table and select widget

Fixes #38981
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

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/13174139895
Commit: 2d84c6b
Cypress dashboard.
Tags: @tag.All
Spec:


Thu, 06 Feb 2025 09:00:29 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor
    • Streamlined data binding logic for improved consistency in widget interactions.
    • Enhanced binding conditions to ensure reliable handling across various widget types.
  • Tests
    • Updated assertions in regression tests to validate property field values using data binding expressions for improved accuracy.
    • Modified validation checks in Arango Widget Binding tests to ensure expected data format is correctly asserted.

Copy link
Contributor

coderabbitai bot commented Feb 5, 2025

Walkthrough

This pull request simplifies the data binding logic for the TABLE_WIDGET_V2. In the BindDataButton component, the conditional assignment for the dynamicPropertyPathList is removed, ensuring a consistent value is always set. Additionally, the saga now checks for specific widget types (TABLE_WIDGET_V2 and SELECT_WIDGET) before altering the dynamic property path flag, refining the overall conditional logic in the binding workflow.

Changes

File Path Change Summary
app/client/src/PluginActionEditor/.../BindDataButton.tsx Removed the conditional check in the getWidgetProps function for TABLE_WIDGET_V2, so that dynamicPropertyPathList always gets assigned [ { key: "tableData" } ].
app/client/src/sagas/SnipingModeSagas.ts Modified the condition in bindDataToWidgetSaga to exclude TABLE_WIDGET_V2 and SELECT_WIDGET from setting isDynamicPropertyPath to false when the binding query matches one-click binding.
app/client/cypress/e2e/.../ApiBugs_Spec.ts Updated assertions to validate property field values for "Table data" using a new format with data binding expressions, enhancing the specificity of the validation.
app/client/cypress/e2e/.../Arango_Basic_Spec.ts Modified assertions for "Table data" to check expected value formats using template strings, improving validation checks for widget binding functionality.

Assessment against linked issues

Objective Addressed Explanation
Display on UI behavior inconsistent with other datasources (#38981)

Possibly related PRs

Suggested labels

Enhancement, Widgets Product, Query & JS Pod, Widgets & Accelerators Pod

Suggested reviewers

  • ApekshaBhosale
  • rahulbarwal
  • sneha122

Poem

In the realm of code where logic flows,
A tweak has set new binding codes.
Widgets dance with data so true,
Sagas now guide what they do.
Cheers to code refined and bright—
May our builds soar to greater height!

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64faf86 and 2d84c6b.

📒 Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@github-actions github-actions bot added Medium Issues that frustrate users due to poor UX Query & Widgets Pod All issues related to Query, JS, Eval, and Widgets Task A simple Todo Bug Something isn't working labels Feb 5, 2025
@AmanAgarwal041 AmanAgarwal041 added the ok-to-test Required label for CI label Feb 5, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts (1)

96-96: Enhance test description for clarity.

The test description could be more specific about validating both array and object response types.

-    it("5. Bug 26897, Invalid binding of table data when used existing suggested widgets for an action returning object & array", function () {
+    it("5. Bug 26897, Verify table data binding with existing suggested widgets for both array response (ARRAY_RESPONSE.data) and object response (OBJECT_RESPONSE.data.users)", function () {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 229e9c5 and 17b39cf.

📒 Files selected for processing (2)
  • app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts (3 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test ...

app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
  • app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts
  • app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (1)
app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts (1)

337-337: LGTM!

The property field value validations correctly verify the table data binding in both scenarios - new table widget and existing table widget.

Also applies to: 344-344

@sneha122
Copy link
Contributor

sneha122 commented Feb 6, 2025

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Feb 6, 2025

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/13173762590.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 39032.
recreate: .

@sneha122 sneha122 self-requested a review February 6, 2025 07:30
Copy link

github-actions bot commented Feb 6, 2025

Deploy-Preview-URL: https://ce-39032.dp.appsmith.com

sneha122
sneha122 previously approved these changes Feb 6, 2025
@sneha122
Copy link
Contributor

sneha122 commented Feb 6, 2025

@AmanAgarwal041 I have tested the PR, looks good!

@AmanAgarwal041 AmanAgarwal041 merged commit 35ba3cc into release Feb 6, 2025
85 checks passed
@AmanAgarwal041 AmanAgarwal041 deleted the fix/38981-display-ui-js-enabled branch February 6, 2025 09:20
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Medium Issues that frustrate users due to poor UX ok-to-test Required label for CI Query & Widgets Pod All issues related to Query, JS, Eval, and Widgets Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Display on UI' behavior Inconsistent with other datasources
2 participants